Package com.automation_pros.odva.omron
Class OmronProbe
- java.lang.Object
-
- com.automation_pros.odva.omron.OmronProbe
-
public class OmronProbe extends java.lang.ObjectReverse engineered probe for Omron NJ/NX global variables and associated data types. Global variables set to "Do Not Publish" are excluded from the responses described here.Basic Sequence:
- Open a large messaging connection, size 1996 bytes, for the following.
- Obtain UDINT quantity from class 0x6a instance 0 attribute 0x68. Note: this is not a max instance number, but the actual quantity to recover.
- Request start of tag list via service 0x5f class 0x6a instance 0 with payload StartInstance=UDINT Qty=UDINT Unk=UINT where StartInstance is 1, Qty is from above, and Unk is 2.
Decode response. Buffer starts with UDINT response quantity, followed by that many of tag browse structures, which include instance numbers and tag names.
- Request continuation if necessary, where StartInstance is one beyond the last instance previously reported.
- For each tag instance reported, issue GAA against class 0x6b for that
instance. See
gaaTagSrc. - For defined types, issue GAA against class 0x6c for the start
instance, which names the type, and linked instances, which name
each member. See
gaaTypeSrc. For the start instance, allocation is the size of the complete type, nested and dimq must be zero, and innerinst2/4 points at the first member. For member instances, membersq and crc are zero, chaininst2/4 points at the next member, and innerinst2/4 point at nested type instances.
Results are delivered at the end via the serializable type
OmronProbeReport.Tag names, type names, and type member names are limited to 127 bytes, not including the padding, and after UTF-8 encoding.
Final results are expected to be wrapped in an
OmronProbeContextfor instance (decoder/encoders) creation and path traversals.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classOmronProbe.DoMemberGaa
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Integer,OmronProbeReport.OmBrowsedTag>browsedprotected intbrowsedQtyprotected intbrowseQtystatic AnonStructSegbrowseTagInnerprotected static java.lang.StringbrowseTagInnerSrcstatic AnonStructSegbrowseTagOuterprotected booleancancelledprotected intcapacityprotected CipReplyConsumerdoTagGaaprotected CipReplyConsumerdoTagListprotected CipReplyConsumerdoTagQtyprotected CipReplyConsumerdoTypeGaaprotected java.util.concurrent.CompletableFuture<OmronProbeReport>futurestatic AnonStructSeggaaTagprotected static java.lang.StringgaaTagSrcstatic AnonStructSeggaaTypeprotected static java.lang.StringgaaTypeSrcstatic CipPathgasTagQtyPathstatic AnonStructSeggetTILstatic CipPathgetTILPathprotected static java.lang.StringgetTILSrcprotected java.io.StringWriterlogprotected java.util.Map<java.lang.Integer,OmronProbeReport.OmProbedMember>looseMembersprotected intmaxInstprotected AutoBatchMsgProcmpprotected OmronProbeReportpriorReportprotected CipPathroutestatic org.slf4j.LoggersLoggerprotected java.util.Map<java.lang.Integer,OmronProbeReport.OmProbedTag>tagsprotected CipUDINTtilFirstInstprotected CipStructtilRequestprotected java.util.Map<java.lang.Integer,OmronProbeReport.OmProbedType>typesprotected java.util.BitSettypesRequestedprotected booleanverbose
-
Constructor Summary
Constructors Constructor Description OmronProbe(boolean verbose)No variant probe behavior for Omron.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddLog(java.lang.String s)protected voidassembleType(OmronProbeReport.OmProbedType pType)protected booleanconditionalLogException(CipReply reply)protected voidconditionMemberReq(int memberInst, OmronProbeReport.OmProbedType pType)protected OmronProbeReportconstructReport()static voidmain(java.lang.String[] args)protected java.lang.StringresetLog()protected voidsend(CipRequest bare)Common code for sending the queries the probe state machine produces.voidsetSkipQtyMatch(OmronProbeReport prior)java.util.concurrent.CompletableFuture<OmronProbeReport>start(CipMsgProcessor mp, CipPath route)Actual message traffic begins when a Message Processor is supplied, either an UnConnected Message Manager, or an established Messaging Connection.
-
-
-
Field Detail
-
sLogger
public static final org.slf4j.Logger sLogger
-
gasTagQtyPath
public static final CipPath gasTagQtyPath
-
getTILPath
public static final CipPath getTILPath
-
getTILSrc
protected static final java.lang.String getTILSrc
- See Also:
- Constant Field Values
-
getTIL
public static final AnonStructSeg getTIL
-
browseTagInnerSrc
protected static final java.lang.String browseTagInnerSrc
- See Also:
- Constant Field Values
-
browseTagInner
public static final AnonStructSeg browseTagInner
-
browseTagOuter
public static final AnonStructSeg browseTagOuter
-
gaaTagSrc
protected static final java.lang.String gaaTagSrc
- See Also:
- Constant Field Values
-
gaaTag
public static final AnonStructSeg gaaTag
-
gaaTypeSrc
protected static final java.lang.String gaaTypeSrc
- See Also:
- Constant Field Values
-
gaaType
public static final AnonStructSeg gaaType
-
verbose
protected final boolean verbose
-
priorReport
protected OmronProbeReport priorReport
-
mp
protected transient AutoBatchMsgProc mp
-
route
protected transient CipPath route
-
future
protected transient java.util.concurrent.CompletableFuture<OmronProbeReport> future
-
capacity
protected transient int capacity
-
log
protected transient java.io.StringWriter log
-
cancelled
protected volatile boolean cancelled
-
browseQty
protected int browseQty
-
browsedQty
protected int browsedQty
-
maxInst
protected int maxInst
-
tilRequest
protected CipStruct tilRequest
-
tilFirstInst
protected CipUDINT tilFirstInst
-
browsed
protected java.util.Map<java.lang.Integer,OmronProbeReport.OmBrowsedTag> browsed
-
tags
protected java.util.Map<java.lang.Integer,OmronProbeReport.OmProbedTag> tags
-
looseMembers
protected java.util.Map<java.lang.Integer,OmronProbeReport.OmProbedMember> looseMembers
-
typesRequested
protected final java.util.BitSet typesRequested
-
types
protected java.util.Map<java.lang.Integer,OmronProbeReport.OmProbedType> types
-
doTagQty
protected CipReplyConsumer doTagQty
-
doTagList
protected CipReplyConsumer doTagList
-
doTagGaa
protected CipReplyConsumer doTagGaa
-
doTypeGaa
protected CipReplyConsumer doTypeGaa
-
-
Method Detail
-
setSkipQtyMatch
public void setSkipQtyMatch(OmronProbeReport prior)
-
addLog
protected void addLog(java.lang.String s)
-
conditionalLogException
protected boolean conditionalLogException(CipReply reply)
-
resetLog
protected java.lang.String resetLog()
-
constructReport
protected OmronProbeReport constructReport()
-
send
protected void send(CipRequest bare)
Common code for sending the queries the probe state machine produces. The next downstream message processor performs the batching. If necessary, another downstream message processor adds an unconnected messaging route wrapper.- Parameters:
bare- Single CipRequest with sequence callback already attached.
-
start
public java.util.concurrent.CompletableFuture<OmronProbeReport> start(CipMsgProcessor mp, CipPath route)
Actual message traffic begins when a Message Processor is supplied, either an UnConnected Message Manager, or an established Messaging Connection. If the former, include any necessary route path to the target processor (through the port). If the latter, route must be null or empty. Execution proceeds asynchronously via a dedicated thread.Progress reports are delivered to listeners as responses are received, except when assembling fragments of a data type template definition.
- Parameters:
mp- The message processor instance. If an UnConnected Message Manager, it will typically be an instance ofTcpConx, though it could also be an implementation ofAbstractPort.route- The route may be null or empty if connecting to a target processor's built-in ethernet port.- Returns:
- The completable future that will receive the final
OmronProbeReport. Use of theCompletableFuture.whenComplete(BiConsumer)method to attach a handler is recommended.
-
assembleType
protected void assembleType(OmronProbeReport.OmProbedType pType)
-
conditionMemberReq
protected void conditionMemberReq(int memberInst, OmronProbeReport.OmProbedType pType)
-
main
public static void main(java.lang.String[] args)
-
-