Mitsubishi OPC Server - Ignition String Array compatibility

Hi

I am trying to copy information returned from an SQL query to a group of tags.

I could pull the information from database into a String Array(Memory Tag created in Ignition) but my PLC OPC server doesn’t have an equivalent of string array which can be recognized in ignition.

The best I could do is make a Data Structure with 40 string type tags.
(40 is because of the limitation of my PLC memory)

My SQL query is “SELECT DeviceID FROM DeviceLimits”.

I have attached few screenshots below from my transaction Group.

Transaction Group with the sql script displayed. This copies the data in a String array memory tag locally created.

Below is the screenshot of the Memory Tag.
IgnitionFeb192020-2

Data Structure created in PLC OPC Server. Each string below is a 16 bit string.

Mitsubishi OPC Server Manual - Page 33 onward it mentions about the Array tags. Unfortunately String data type can’t be choose for creating arrays.

https://dl.mitsubishielectric.com/dl/fa/document/manual/plc/sh081694eng/sh081694engd.pdf

I want to know the best way to get the information returned from SQL query to copy into the String tags data structure created in my PLC OPC Server.

Should I use a for loop? Can I use a for loop to iterate over the data received from the DB because SQL doesn’t allow to use for loops.

Is there any alternate way to solve this issue?

I could see you doing it a couple ways. I will admit I don’t have an 8.0 gateway in front of me right now.
One would be to build expression tags that look up their corresponding data from the tag holding the results of your query. Then you can have your expression tag write back to the PLC over OPC. If you need to use these tags inside of your project this can be a good option.

Another option would be to do a tag change script. When your query tag see a change you can loop through the data in the tag and write directly to your PLC over OPC using system.opc.writeValues(). This option limits the tags your creating in Ignition and helps limit how often your communicating with the PLC since you wouldn’t be polling the PLC. If you did want tags that poll the PLC you could also do a variation of this where you loop through your query tag on change and do write to your OPC tags when the data returned from your query changes.

1 Like

How do i access Ignition Memory tag which is of a data type “String Array”.

I have an array which is of size 13 elements.

IgnitionFeb192020-2

As per your suggestion above, If i use expression tag to copy DeviceIDArray[0] value to String000.

How do i address the DeviceIDArray[0] from my expression tag ? I was unable to do that.

To again confirm, Do i write the equation of copying the values from DeviceIDArray to individual string tags in Expression/SQL page?(as shown in the below screen shot?)

Thanks for the quick response by the way.