@PGriffith @Kevin.Herron
As a follow-up to this, assuming I am using Siemens OPC-UA server, it appears the best way to reference complex / structured data types (with lots of members) is to read the PLC UDT in as a Document and then use "jsonGet" in a Derived tag to access the individual members. A great thread was here.
Is there any official training or reference material in the online manual that shows more examples, or are most examples going to be from the forums?
So in my case:
- I'd set up an OPC tag to, let's say, "CM_Pressure[1]" via the OPC-UA server on the PLC, Let's call the Ignition Tag "Pressure1"
- Create a Derived tag to access a particular member. Let's say I am accessing Pressure[1].HMI.bAlarmEnable and this would be set up as a Boolean type.
- Point the Source Tag Path to the source Ignition Tag "Pressure1"
- Set the Read expression with a jsonGet:
- jsonGet({source},"HMI.bAlarmEnable")
- Set the Write expression with a jsonSet:
- jsonSet({source},"HMI.bAlarmEnable", ?????)
More questions:
- I'm not sure where I go with the "value" parameter ????. Is this another tag that holds the value to be written (in this case, true or false / 1 or 0)
- What prevent this derived tag from constantly writing? If this was bound to a pushbutton object in the HMI, I only want the write to occur when the button is pressed.
- Is this method of using the JSON object unique to OPC UA, or just a quirk with Siemens? I intentionally chose OPC UA as opposed the Siemens TCP driver since I cannot access symbolic tags that way.
- If I was using a Rockwell / AB CLX PLC over the native Ignition OPC drivers, I assume this support accessing UDTs directly this way or would there be a similar approach to accessing PLC UDTs (I'm sure this is a while different topic.).
Thanks again.