How to use the pymodbus.pdu.ModbusRequest.__init__ function in pymodbus

To help you get started, we’ve selected a few pymodbus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github riptideio / pymodbus / pymodbus / bit_write_message.py View on Github external
def __init__(self, address=None, values=None, **kwargs):
        ''' Initializes a new instance

        :param address: The starting request address
        :param values: The values to write
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.address = address
        if not values: values = []
        elif not hasattr(values, '__iter__'): values = [values]
        self.values  = values
        self.byte_count = (len(self.values) + 7) // 8
github riptideio / pymodbus / pymodbus / other_message.py View on Github external
def __init__(self, **kwargs):
        ''' Initializes a new instance
        '''
        ModbusRequest.__init__(self, **kwargs)
github D3f0 / txscada / src / brainstorming / tornado / modbus / pymodbus / register_write_message.py View on Github external
def __init__(self, address=None, count=None):
        ''' Initializes a new instance

        :param address: The address to start writing to
        :param count: The number of registers to write to
        '''
        ModbusRequest.__init__(self)
        self.address = address
        if count != None and count > 0:
            self.registers = [0] * count
        else: self.registers = []
github riptideio / pymodbus / pymodbus / other_message.py View on Github external
def __init__(self, **kwargs):
        ''' Initializes a new instance
        '''
        ModbusRequest.__init__(self, **kwargs)
github riptideio / pymodbus / pymodbus / diag_message.py View on Github external
def __init__(self, **kwargs):
        '''
        Base initializer for a diagnostic request
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.message = None
github riptideio / pymodbus / pymodbus / register_write_message.py View on Github external
def __init__(self, address=0x0000, and_mask=0xffff, or_mask=0x0000,
                 **kwargs):
        ''' Initializes a new instance

        :param address: The mask pointer address (0x0000 to 0xffff)
        :param and_mask: The and bitmask to apply to the register address
        :param or_mask: The or bitmask to apply to the register address
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.address = address
        self.and_mask = and_mask
        self.or_mask = or_mask
github D3f0 / txscada / src / brainstorming / tornado / modbus / pymodbus / bit_write_message.py View on Github external
def __init__(self, address=None, count=None):
        ''' Initializes a new instance

        :param address: The starting request address
        :param count: Number of bits to read after address
        '''
        ModbusRequest.__init__(self)
        self.address = address
        if count != None and count > 0:
            self.coils = [False] * count
        else: self.coils = []
github riptideio / pymodbus / pymodbus / bit_read_message.py View on Github external
def __init__(self, address, count, **kwargs):
        ''' Initializes the read request data

        :param address: The start address to read from
        :param count: The number of bits after 'address' to read
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.address = address
        self.count = count
github D3f0 / txscada / src / brainstorming / tornado / modbus / pymodbus / bit_write_message.py View on Github external
def __init__(self, address=None, value=None):
        ''' Initializes a new instance

        :param address: The variable address to write
        :param value: The value to write at address
        '''
        ModbusRequest.__init__(self)
        self.address = address
        self.value = 0xff00 if value else 0x0000