def METHOD_NAME(self, write_buffer: WriteBuffer):
    write_buffer.push_context("ModbusPDUReadHoldingRegistersRequest")
    # Simple Field (startingAddress)
    write_buffer.write_unsigned_short(
        self.starting_address, logical_name="startingAddress"
    )
    # Simple Field (quantity)
    write_buffer.write_unsigned_short(self.quantity, logical_name="quantity")
    write_buffer.pop_context("ModbusPDUReadHoldingRegistersRequest")