You can take advantage of reading whole structs in OPC UA servers as of Ignition 7.9.12 and 8.0.0.
When you bring the tag in you’ll notice Ignition presents a JSON value. The strategy here is a little involved but it works.
For each of the UDTs you’ll be subscribing to in the PLC you make a corresponding UDT in Ignition. It should have a “Source” OPC tag member that will correspond to the Node with the struct value in the server and as a result have a JSON value in Ignition. Then for each member of the UDT you have a Derived Tag member that references the “Source” tag using the jsonGet and jsonSet expression functions to get/set the member value out of the JSON value.
Where struggling with the same issues here. But we can’t find any documentation on how to a “sibling”-tag within the UDT for the derived tag.
E.G. We have a struct called CamPreset in de the PLC with pan, Tilt, zoom en focus integer values and float values.
We created a UDT called CamPreset and created a tag called “Source” in the UDT which is a OPC tag pointing to the PLC-struct. From here we thought to created derived tags Pan, Tilt, Zoom en Focus to delve into the Source-tag details… But how to reference the Source tag… Any suggestions?
I know, but I’m looking into the Source parameter of the derived tag. How to reference the UDT member with the OPC-configuration… Then when we have an exact copy, I can further specify the details I want to use in my derived tag with de Read-expression…
I am trying to use a derived tag in a UDT as well (Ignition 8.0.4). When the source tag is buried more than 1 level deep inside a folder it does not work. For example, if the source tag location is “[.]Folder/SubFolder/SourceTag”, the value comes back as blank. Same result if i browse the UDT tags to select the tag as the source, resulting in the path “[default]types/Ex1/Folder/SubFolder/SourceTag”. Maybe a bug, or is there something I am missing here?
Thanks! I was having problems using the Sources/SourceTag as the source for DerivedTags/DerivedTag (in image below). Seeing your post made me look for the relative tag path documentation which explained that i need the following syntax in the source for DerivedTags/DerivedTag.
Is there an example of what the “SourceTag” setup looks like in that above picture? I get that I’m going to read a document data type but what do I put as OPC Item Path? I have a Siemens DB1 with multiple instances of a UDT called DigitalInput where a DigitalInput is made of a Bool, Bool, Time, Int, Int, Bool.
You’ll want to ignore the directions of using the Siemens driver to connect to the PLC.
My example used a memory tag for source tag to simulate.
If your Siemens PLC has the firmware that includes a built-in opc ua server, you can go under Ignition’s OPC connections, and create a connection to the PLC from there.
From there you will be able to browse the OPC server (from the designer) and actually pull the struct as a tag into Ignition. This tag will appear as a JSON formatted string of key value pairs.
If you can indulge me as I’m very unfamiliar with Siemens… The DB, *.xls, has several tabs that seemed to describe the STRUCT you’re referring to. Only one tab has ref. to ‘UDT’… Can you subscribe to the STRUCT in the same way? Or, is the UDT a special way to create a subscribing source?
i'm also using the onboard opcua of siemens for one of my project.
I'm trying to use the method of @Kevin.Herron but when importing a udt with a special type (Like Toff_Time) i get a bad quality in ignition. When deleted it works fine.
Also if you need to get some data into a folder or struct into the udt. How to you need to syntax this properly into the source and value of the derived tag?
You cannot have a timer in the struct if you want to read it with OPC UA. Only other structs, atomic member or other UDTs (which also don’t contain timers or other illegal types).