Class GetAttrListReq
- java.lang.Object
-
- com.automation_pros.odva.cip.requests.CipRequest
-
- com.automation_pros.odva.cip.requests.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
-
-
Nested Class Summary
-
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 filled from the payload in accept().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.-
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 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.GetAttrListReq(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.GetAttrListReq
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.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.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, 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.
-
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 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.
-
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 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 GetAttrListReq 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.
-
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 classCipRequest
- 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 interfaceCipReplyConsumer
- Overrides:
accept
in classCipRequest
-
-