示例#1
0
    def __init__(self, dest, parameter, size=1, packet="", src=0, **kwargs):
        """ Initializes a new instance

        :param address: The destination PLC address
        :param parameter: The PLC address to read
        :param size: The number of elements to read
        :param packet: Used when we already have an encoded packet
        """
        PDU.__init__(self, **kwargs)
        self.src = src
        self.dest = dest
        self.parameter = parameter
        self.sts = 0x00
        self.size = size
        self.Address = utilities.calcAddress(parameter)
        self.packet = packet
示例#2
0
    def __init__(self, dest, parameter, size=1, packet='', src=0, **kwargs):
        ''' Initializes a new instance

        :param address: The destination PLC address
        :param parameter: The PLC address to read
        :param size: The number of elements to read
        :param packet: Used when we already have an encoded packet
        '''
        PDU.__init__(self, **kwargs)
        self.src = src
        self.dest = dest
        self.parameter = parameter
        self.sts = 0x00
        self.size = size
        self.Address = utilities.calcAddress(parameter)
        self.packet = packet
示例#3
0
    def __init__(self, dest=0, parameter=None, values=None, size=1, src=0, **kwargs):
        """ Initializes a new instance

        :address: The address of the PLC to communicate with
        :parameter: The parameter address to begin writing to
        :values: a list of values to write
        :size: The number of bytes to write
        """
        PDU.__init__(self, **kwargs)
        self.src = 0
        self.dest = dest
        self.parameter = parameter
        self.values = values
        self.sts = 0x00
        self.size = size
        self.Address = utilities.calcAddress(parameter)
        self.packet = ""
示例#4
0
    def __init__(self,
                 dest=0,
                 parameter=None,
                 values=None,
                 size=1,
                 src=0,
                 **kwargs):
        ''' Initializes a new instance

        :address: The address of the PLC to communicate with
        :parameter: The parameter address to begin writing to
        :values: a list of values to write
        :size: The number of bytes to write
        '''
        PDU.__init__(self, **kwargs)
        self.src = 0
        self.dest = dest
        self.parameter = parameter
        self.values = values
        self.sts = 0x00
        self.size = size
        self.Address = utilities.calcAddress(parameter)
        self.packet = ''