OptoServer and Numeric Table conversion to SQL Tags

I have an OptoOPCServer installed on the ignition gateway to communicate to a thermal oven in our process. The oven is a purchased component and our safety dept does not want us modifying the program at all because of liability issues (I suppose they don’t want us accidentally burning the place to the ground). So we are locked into the program structure of the OEM. We are able to edit the IP address of the device and get it connected to the network though.

Everything is great, OPC server up and running in ingnition and we can see all the configured tags in the Ignition designer. The only problem is that the original program uses loads of numeric tables.

I would like to be able to access some of the data contained in those numeric tables as SQL tags. The only problem is that best I can tell, Ignition doesn’t support this datatype.

So here is my work around…

  1. Create a new SQL tag (New Tag3) and reference the OPC tag of the numeric table that you want in the OptoOPCServer. Use the “string” datatype and you get a comma seperated string of the contents of the numeric table.
  2. Create a new Expression tag of the datatype you want. In my case, I wanted a float.
  3. Under the expression, use the following to split the string and reference the index of the parameter you want from the numeric table. In this example, I am getting the value of the numeric table from index 2
 tofloat(trim(replace(replace(runScript("'" + {[~]New Tag3} +"'.split(',')[1]"),"[",""),"]","")))

This will allow you to create an expression tag for individual components of the numeric table. If you really want to, a new datatype could be built using this method to recreate the numeric table in something a little more palatable for later use in ignition (new datatype containing an array of expression tags of type float, for example)