Class GetAttrListReq

  • All Implemented Interfaces:
    CipReplyConsumer, CipMessage, java.io.Externalizable, java.io.Serializable

    public class GetAttrListReq
    extends CipRequest
    The Get Attribute List service, code 0x03, is described in the Logix Data Access manual and is used to retrieve multiple attributes from Logix Controller objects. As shown in the LDA, it is used to obtain information about Logix Data Type Template instances before retrieving the template member detail. This service has been shown to work to obtain attribute data from other Logix Controller Objects that do not respond to the standard Get Attribute All service. This service returns a packed payload composed of (number, status, value) tuples for each requested attribute. The attribute value is omitted if that tuple's status is non-zero. The caller must know the length of each value, or it must be encoded in the value, or it must be the last attribute requested.
    See Also:
    Serialized Form
    • Field Detail

      • attrList

        public int[] attrList
        Array of attribute numbers to be/that were encoded in this request.
      • statList

        public int[] statList
        Array of status codes, one for each attribute, created and filled in on accept() if the list of attribute value objects is present.
      • attrValues

        public BaseDataType<?>[] attrValues
        Optional array of attribute value data objects that will be filled from the payload in accept().
    • Constructor Detail

      • GetAttrListReq

        public GetAttrListReq​(CipPath target,
                              int[] attrList,
                              BaseDataType<?>... attrValues)
        Create this service request from scratch, specifying an array of attribute numbers, and an optional array of corresponding CIP Data objects that will receive the payloads. When data objects are supplied, the status list field and corresponding value object will be populated from the reply payload *before* the request callbacks are processed.
        Parameters:
        target - Application object to query
        attrList - Attribute numbers to be queried, in the order given, as 16-bit unsigned integers.
        attrValues - Data object instances that have a fixed size, an encoded length, or are otherwise delimited.
      • GetAttrListReq

        public GetAttrListReq​(CipPath target,
                              java.nio.ByteBuffer source)
        Construct this service request given an application target path and an encoded payload buffer.
        Parameters:
        target - Application object to query
        source - A buffer containing a 16-bit unsigned integer attribute count, followed by that many 16-bit unsigned integer attribute numbers.
    • Method Detail

      • setPayload

        public void setPayload​(java.nio.ByteBuffer source)
        Description copied from class: CipRequest
        Subclasses should override this method to permit reparsing of protocol packets into the desired request type.
        Specified by:
        setPayload in interface CipMessage
        Overrides:
        setPayload in class CipRequest
        Parameters:
        source - Source buffer containing the encoded new payload.
      • putPayload

        public void putPayload​(java.nio.ByteBuffer dest)
        Description copied from class: CipRequest
        Subclasses that encode fields into their payloads must override this.
        Specified by:
        putPayload in interface CipMessage
        Overrides:
        putPayload in class CipRequest
        Parameters:
        dest - Destination buffer for the encoded payload.
      • payloadLength

        public int payloadLength()
        Description copied from class: CipRequest
        Subclasses must override this unless they populate the payload and payloadActual fields.
        Specified by:
        payloadLength in interface CipMessage
        Overrides:
        payloadLength in class CipRequest
        Returns:
        The byte length of the encoded payload only.
      • replyLength

        public int replyLength()
        If this request was created with data object instances to fill in, and they all have a fixed length payload, the reply packet size can be predicted. Otherwise returns zero.
        Overrides:
        replyLength in class CipRequest
        Returns:
      • accept

        public void accept​(CipReply reply)
        Description copied from class: CipRequest
        Applications and routers call this method with the actual reply to pass back up the chain of callers. Routers must embed some form of ID code in their protocol packets to associate requests with replies. DeviceNet uses originator node address and a 16-bit transaction ID. Ethernet/IP uses the 64-bit Sender Context field of its encapsulation header. CIP over DF1 uses the 16-bit Transaction Number inside of PCCC encapsulation.
        Specified by:
        accept in interface CipReplyConsumer
        Overrides:
        accept in class CipRequest