本文整理汇总了Python中pymodbus.pdu.ModbusResponse类的典型用法代码示例。如果您正苦于以下问题:Python ModbusResponse类的具体用法?Python ModbusResponse怎么用?Python ModbusResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModbusResponse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, values, **kwargs):
''' Initializes a new instance
:param values: The values to write to
'''
ModbusResponse.__init__(self, **kwargs)
self.registers = values or []
示例2: __init__
def __init__(self, values):
''' Initializes a new instance
:param values: The requested values to be returned
'''
ModbusResponse.__init__(self)
self.bits = [] if values == None else values
示例3: __init__
def __init__(self, status=0x00, **kwargs):
''' Initializes a new instance
:param status: The status response to report
'''
ModbusResponse.__init__(self, **kwargs)
self.status = status
示例4: __init__
def __init__(self, values=None, **kwargs):
''' Initializes a new instance
:param values: The list of values of the fifo to return
'''
ModbusResponse.__init__(self, **kwargs)
self.values = values or []
示例5: __init__
def __init__(self, values):
''' Initializes a new instance
:param values: The values to write to
'''
ModbusResponse.__init__(self)
self.registers = values if values != None else []
示例6: __init__
def __init__(self, records=None):
''' Initializes a new instance
:param records: The requested file records
'''
ModbusResponse.__init__(self)
self.records = records or []
示例7: __init__
def __init__(self, values=None, **kwargs):
''' Initializes a new instance
:param values: The register values to write
'''
ModbusResponse.__init__(self, **kwargs)
RegisterResponseMixin.__init__(self, values)
示例8: __init__
def __init__(self, values, **kwargs):
''' Initializes a new instance
:param values: The requested values to be returned
'''
ModbusResponse.__init__(self, **kwargs)
self.bits = values or []
示例9: __init__
def __init__(self, identifier='\x00', status=True, **kwargs):
''' Initializes a new instance
:param identifier: The identifier of the slave
:param status: The status response to report
'''
ModbusResponse.__init__(self, **kwargs)
self.identifier = identifier
self.status = status
示例10: __init__
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
'''
ModbusResponse.__init__(self, **kwargs)
self.address = address
self.value = value
示例11: __init__
def __init__(self, address=None, count=None):
''' Initializes a new instance
:param address: The starting variable address written to
:param count: The number of values written
'''
ModbusResponse.__init__(self)
self.address = address
self.count = count
示例12: __init__
def __init__(self, read_code=None, information=None, **kwargs):
''' Initializes a new instance
:param read_code: The device information read code
:param information: The requested information request
'''
ModbusResponse.__init__(self, **kwargs)
self.read_code = read_code or DeviceInformation.Basic
self.information = information or {}
self.number_of_objects = len(self.information)
self.conformity = 0x83 # I support everything right now
# TODO calculate
self.next_object_id = 0x00 # self.information[-1](0)
self.more_follows = MoreData.Nothing
示例13: __init__
def __init__(self, values=None, **kwargs):
ModbusResponse.__init__(self, **kwargs)
self.values = values or []
示例14: __init__
def __init__(self):
'''
Base initializer for a diagnostic response
'''
ModbusResponse.__init__(self)
示例15: __init__
def __init__(self, address):
ModbusResponse.__init__(self)
self.address = address
self.count = 16