当前位置: 首页>>代码示例>>Python>>正文


Python ModbusRequest.__init__方法代码示例

本文整理汇总了Python中pymodbus.pdu.ModbusRequest.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ModbusRequest.__init__方法的具体用法?Python ModbusRequest.__init__怎么用?Python ModbusRequest.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymodbus.pdu.ModbusRequest的用法示例。


在下文中一共展示了ModbusRequest.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, records=None, **kwargs):
        ''' Initializes a new instance

        :param records: The file record requests to be read
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.records  = records or []
开发者ID:semyont,项目名称:pymodbus,代码行数:9,代码来源:file_message.py

示例2: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, status):
        ''' Initializes a new instance

        :param status: The status response to report
        '''
        ModbusRequest.__init__(self)
        self.status = status
开发者ID:D3f0,项目名称:txscada,代码行数:9,代码来源:other_message.py

示例3: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
 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
开发者ID:rgborges,项目名称:sensorNetwork,代码行数:10,代码来源:bit_read_massage.py

示例4: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, read_code=None, object_id=0x00, **kwargs):
        ''' Initializes a new instance

        :param read_code: The device information read code
        :param object_id: The object to read from
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.read_code = read_code or DeviceInformation.Basic
        self.object_id = object_id
开发者ID:semyont,项目名称:pymodbus,代码行数:11,代码来源:mei_message.py

示例5: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, address=None, value=None, **kwargs):
        ''' Initializes a new instance

        :param address: The address to start writing add
        :param value: The values to write
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.address = address
        self.value = value
开发者ID:bashwork,项目名称:pymodbus,代码行数:11,代码来源:register_write_message.py

示例6: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, address=None, value=None, **kwargs):
        ''' Initializes a new instance

        :param address: The variable address to write
        :param value: The value to write at address
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.address = address
        self.value = bool(value)
开发者ID:bashwork,项目名称:pymodbus,代码行数:11,代码来源:bit_write_message.py

示例7: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    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
开发者ID:D3f0,项目名称:txscada,代码行数:11,代码来源:bit_write_message.py

示例8: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, address, count, **kwargs):
        ''' Initializes a new instance

        :param address: The address to start the read from
        :param count: The number of registers to read
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.address = address
        self.count = count
开发者ID:thom-nic,项目名称:pymodbus,代码行数:11,代码来源:register_read_message.py

示例9: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    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 = []
开发者ID:D3f0,项目名称:txscada,代码行数:13,代码来源:register_write_message.py

示例10: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, address, count, **kwargs):
        ''' Initializes a new instance

        :param address: The address to start the read from
        :param count: The number of registers to read
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.address = address
        self.count = count
        frame_struct = struct.Struct('>HH')
        self._unpack = frame_struct.unpack
        self._pack = frame_struct.pack
开发者ID:vrtsystems,项目名称:pymodbus,代码行数:14,代码来源:register_read_message.py

示例11: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, address=None, values=None, **kwargs):
        ''' Initializes a new instance

        :param address: The address to start writing to
        :param values: The values to write
        '''
        ModbusRequest.__init__(self, **kwargs)
        self.address = address
        self.values = values or []
        if not hasattr(values, '__iter__'):
            values = [values]
        self.count = len(self.values)
        self.byte_count = self.count * 2
开发者ID:4rc4n4,项目名称:pymodbus,代码行数:15,代码来源:register_write_message.py

示例12: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
    def __init__(self, raddress=None, rcount=None, waddress=None, wcount=None):
        ''' Initializes a new request message

        :param raddress: The address to start reading from
        :param rcount: The number of registers to read from address
        :param waddress: The address to start writing to
        :param wcount: The number of registers to write from address
        '''
        ModbusRequest.__init__(self)
        self.raddress = raddress
        self.rcount   = rcount
        self.waddress = waddress
        self.wbyte_count = 0
        if wcount != None and wcount > 0:
            self.wregisters = [0] * wcount
        else: self.wregisters = []
开发者ID:D3f0,项目名称:txscada,代码行数:18,代码来源:register_read_message.py

示例13: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
 def __init__(self, address=None, **kwargs):
     ModbusRequest.__init__(self, **kwargs)
     self.address = address
     self.count = 16
开发者ID:bashwork,项目名称:pymodbus,代码行数:6,代码来源:custom_message_async_clients.py

示例14: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
 def __init__(self):
     '''
     Base initializer for a diagnostic request
     '''
     self.message = None
     ModbusRequest.__init__(self)
开发者ID:thom-nic,项目名称:pymodbus,代码行数:8,代码来源:diag_message.py

示例15: __init__

# 需要导入模块: from pymodbus.pdu import ModbusRequest [as 别名]
# 或者: from pymodbus.pdu.ModbusRequest import __init__ [as 别名]
 def __init__(self, **kwargs):
     '''
     Base initializer for a diagnostic request
     '''
     ModbusRequest.__init__(self, **kwargs)
     self.message = None
开发者ID:bashwork,项目名称:pymodbus,代码行数:8,代码来源:diag_message.py


注:本文中的pymodbus.pdu.ModbusRequest.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。