I have a Control Logix PLC and am using the standard Logix Ignition driver to access tags.
I want to create a single Ignition UDT in which I can use the name of the UDT instance to create the OPCitempath (no parameters).
For example:
Assume the name of the array UDT in the PLC is 'productData[2]'.
I want to name my tags productData_00, productData_01 and be able to have the UDT parse the array element number from the name and pass into the OPCitempath parameterization properly.
Reason: To make new tags I simply duplicate and make sure the array index number in the name is correct. No messsing around with the OPCitempath directly or entering array index numbers in a parameter which is very easy to overlook and forget to change.
I currently can do this with non-arrayed UDT's with the following entry in the
parameter:
But with an array UDT I can't use the root instance name because it has the array index in it in the wrong format for the OPCitempath .
The correct path syntax for the the Control logix is:
ns=1;s=[MYPLC]productData[0].count
The code above creates this incorrect path:
ns=1;s=[MYPLC]productData_00.count
So the only way I can figure out how to do this is to add a parameter called 'arrayIndex00, arrayindex01' and nest the UDT array elements inside another UDT. Very messy. And I have varying lengths of UDT arrays all over in the PLC.
Ideas ?
Assume the following PLC UDT array for my example:
productData[2]
The productData UDT is defined in the PLC as:
productData[0].name (string)
productData[0].count (integer)
when the tag productData is imported into Ignition it creates a folder called "productData"
The tag paths are:
productData/productData_0_/name
productData/productData_0_/count
productData/productData_1_/name
productData/productData_1_/count