[Question] How to create NxN Dataset (or array) of an OPC UDT?

I have a UDT in my S7-1500 CPU and an NxN array instance (square matrix) of it in a global data block (this is the configuration in the data block: myPlcMatrix, Array[1…3, 1…3] of “myUdt”).

I have an OPC UDT definition in Ignition Designer, the same as in the PLC.

I want to create a tag in Designer (calling it myDesMatrix) that can read/write data from/to the PLC.

Is it possible to create a Dataset of my designer UDT? From what I know about data sets is that each row/column entry must be a primitive tag (not supporting structured tags…aka UDTs). Is this true?

I created a new tag by browsing the PLC, selected myPlcMatrix instance and edited Data Type from String to DataSet but instead of a 3x3 data set (which is what I was hoping for) I end up with a 9R x 1C data set…not exactly what I want…and each row is a String data type.

Is it possible to nest a data set inside a data set?

I guess knowing what I want to do would help:
1 Display information from my udt in a NxN table
2 Perform matrix calculations (such as multiplication, inversion, determinant etc.) on specific
values within udt in the matrix.

I’m really hoping I don’t have to do this the hard way…as in creating a derived tag of data type string array (in this case I’d need 3) and bind it to one of the string values in the data set then parse the string for the specific data I want…or even create a new data set for the specific information I need and create a derived tag data set using an expression (or custom script) to parse the bound tag…each for which I have to figure out which of each 9 rows in the data set match the n x m matrix element…

This is getting complicated. Do you know of a better approach?

Thank you!
Ted.

I’m still confused, but I’m still waking up. :wink:

Edited for readability. Told you I was just waking up…

It’s not possible to nest datasets, but a couple of ideas:

  1. A folder structure of UDTs. Workable, but maybe more difficult to maintain for different sizes.
  2. Using a script to read the OPC values (or UDT tags, if you want to monitor individually) and storing it as a json document.
1 Like

@JordanCClark
Thank for taking the time to reply. I’m avoiding json for as long as I can, it give me a brain cramp :slight_smile: but only because I’m impatient. I think I’m going to have to implement the arrays in Python for the matrix mathematics and just have to bite the bullet and write my own parsing code (wouldn’t be the first time).
Thanks again Jordan.
Regards,
Ted.