Class GetInstAttrListReq
- java.lang.Object
-
- com.automation_pros.odva.cip.requests.CipRequest
-
- com.automation_pros.odva.cip.requests.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GetInstAttrListReq.InstanceAttributes
Each remote instance found in the payload is loaded into this object for the caller's convenience.-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.requests.CipRequest
CipRequest.CallbackException, CipRequest.ChainedException, CipRequest.ReplyFuture
-
-
Field Summary
Fields Modifier and Type Field Description int[]
attrList
Array of attribute numbers to be/that were encoded in this request.BaseDataType<?>[]
attrValues
Optional array of attribute value data objects that will be cloned and filled from the payload in accept().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.-
Fields inherited from class com.automation_pros.odva.cip.requests.CipRequest
acceptTrace, acceptTS, callbacks, creationTrace, deadline, forecastReply, maxreply, path, scheduler, sentTS, sLogger, svccode
-
-
Constructor Summary
Constructors Constructor Description GetInstAttrListReq()
CIP requests are externalizable, so must have a public no-args constructor.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.GetInstAttrListReq(CipPath target, java.nio.ByteBuffer source)
Construct this service request given an application target path and an encoded payload buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(CipReply reply)
Applications and routers call this method with the actual reply to pass back up the chain of callers.GetInstAttrListReq
clone()
int
payloadLength()
Subclasses must override this unless they populate the payload and payloadActual fields.void
putPayload(java.nio.ByteBuffer dest)
Subclasses that encode fields into their payloads must override this.void
setPayload(java.nio.ByteBuffer source)
Subclasses should override this method to permit reparsing of protocol packets into the desired request type.-
Methods inherited from class com.automation_pros.odva.cip.requests.CipRequest
accept, accept, addCallback, addCallback, addFutureCallback, bytes, decode, forecast, getPayload, getServiceCode, getSyncReply, getSyncReply, getTarget, payloadBytes, payloadString, put, putSyncReplyPayload, putSyncReplyPayload, readExternal, replyLength, rewrapRequest, service, service, serviceName, set, takeCallbacks, toBytes, toString, writeExternal
-
-
-
-
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 queryattrList
- 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 querysource
- A buffer containing a 16-bit unsigned integer attribute count, followed by that many 16-bit unsigned integer attribute numbers.
-
-
Method Detail
-
clone
public GetInstAttrListReq clone()
- Overrides:
clone
in classCipRequest
-
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 interfaceCipMessage
- Overrides:
setPayload
in classCipRequest
- 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 interfaceCipMessage
- Overrides:
putPayload
in classCipRequest
- 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 interfaceCipMessage
- Overrides:
payloadLength
in classCipRequest
- 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 interfaceCipReplyConsumer
- Overrides:
accept
in classCipRequest
-
-