Potentially vendor-specific (Siemens S7-1500) OpcUa server structure question about Codec/UDT registration #1526
peterfranciscook
started this conversation in
General
Replies: 1 comment 4 replies
-
I wonder if maybe your PLC has multiple "Server Interfaces" defined and the UDTs are defined in each explicitly, or get defined in each implicitly, etc... I don't really know enough about how the Siemens OPC UA server works to answer any of this confidently. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
NOTE: @kevinherron mentioned in this thread that
DataTypeTreeSessionInitializer
is deprecated in milo 1.x, so this may be a milo 0.6.X quirk (but I suspect its more of Siemens OpcUa server configuration behavior).Observation 1: after connecting a milo client to my PLC/OpcUa server and inspecting the
DataTypeTree
... I notice anything that is a UDT defined in the Siemens project has 2 entries in the
DataTypeTree
i.e. (for one UDT at random)
Browsing these nodes yields similar-looking results despite the different identifiers:
Observation 2: Only the numeric IDs actually work for encoding/decoding
ExtensionObject
(using the string ID fails). When I inspect aUaVariableNode
for that UDT type, it points to the numericNodeId
when I callgetDataType()
rather than theNodeId
with a friendlier name.I can work with this - I'm successfully decoding streams (subscriptions) of UDTs in my app, but this behavior has always irked me.
Questions:
browseName
(e.g. building a Map<NodeId, NodeId> to map the friendlier name to the numeric one, or an O(n^2) loop to update refs), is there a way to coerce milo or Siemens TIA Portal to link (on the VariableNodes themselves) one identifier versus the other?Some more context - I have a codegen tool to write my UDT codec classes. Whenever the hardware team I work with updates the Siemens project, it shuffles the (numeric, but not String!) type and binary encoding ids of the UDTs (even if a particular UDT itself is unchanged), so I have to regenerate/recompile the UDT codec classes in order for the
TYPE_ID
andBINARY_ENCODING_ID
fields to be usable. It only takes a few seconds to run, but I don't love checking in ~200 changed files to git every time this happens... Life would be slightly simpler along this axis of complexity if I could coerce Siemens or Milo to map to the String identifier rather than the numeric one.Even more context - I do also have a startup service that validates Codec type id and binary encoding ids vs what is actually present on the server, and will have my app use the server's binary encoding ids if there is a mismatch, so its not entirely dependent on accurate
TYPE_ID
andBINARY_ENCODING_ID
from the Codec classes themselves. Still, its a hassle.Beta Was this translation helpful? Give feedback.
All reactions