Class GetInstAttrListReq

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

    public class GetInstAttrListReq
    extends CipRequest
    The Get Instance Attribute List service, code 0x55, is described in the Logix Data Access manual and is used to enumerate tags in a Logix Controller. As shown in the LDA, it returns multiple attribute values for each tag object instance after the request path's starting point. The responses start with a 32-bit unsigned instance number, immediately followed by the requested attributes. This service returns a packed payload composed of (instance number, value, value...) tuples for each instance found. The caller must know the length of each value, or it must be encoded in the value.
    See Also:
    Serialized Form
    • Field Detail

      • attrList

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

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

        public java.util.List<GetInstAttrListReq.InstanceAttributes> instances
        If attribute value data objects have been supplied when this request accept()s a reply, and the reply status is 0 or 6, a list of enumerated instances will be created from the payload. The supplied data objects will be cloned before being filled in.
    • Constructor Detail

      • GetInstAttrListReq

        public GetInstAttrListReq()
        CIP requests are externalizable, so must have a public no-args constructor.
      • GetInstAttrListReq

        public GetInstAttrListReq​(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, a list of enumerated instances 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.
      • GetInstAttrListReq

        public GetInstAttrListReq​(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.
      • 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