# Array read/write opc problems

**URL:** <https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602>\
**Category:** Ignition\
**Created:** [December 19, 2012, 11:37am UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602 "2012-12-19T11:37:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Antonio](https://forum.inductiveautomation.com/u/Antonio)\
**Post date:** [December 19, 2012, 11:37am UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/1 "2012-12-19T11:37:47Z")

</div>

Hi!

I need help, I can’t write in and Array tag of floats. The last version of ignition allow me to read this OPC tag like STRING, but when I’m trying to write it (also like string) I got this error

[color=#0000BF]COMSubscription Error executing write to OPC-COM items.

java.lang.IllegalArgumentException: Unable to find appropriate variant type for the given parameter: [0.0, 1.0, 2.0]  
at com.jniwrapper.win32.automation.types.Variant.setValue(SourceFile:942)  
at com.jniwrapper.win32.automation.types.Variant.(SourceFile:795)  
at com.inductiveautomation.opccom.wrapper.ComUtil.getVariantForValue(ComUtil.java:213)  
at com.inductiveautomation.opccom.wrapper.subscriptions.COMSubscription$WriteJob.internalRun(COMSubscription.java:1230)  
at com.inductiveautomation.opccom.wrapper.OleJob.run(OleJob.java:50)  
at com.jniwrapper.win32.MessageLoopThread$ThreadSynchronizedAction.run(MessageLoopThread.java:585)  
at com.jniwrapper.win32.MessageLoopThread$LoopThread.run(MessageLoopThread.java:527)  
[/color]  
I’m also trying to read a single item in the array and I can’t find the way to get it: I try with:  
Bucket Brigade.ArrayOfReal8 is the tag path  
Bucket Brigade.ArrayOfReal8.0  
Bucket Brigade.ArrayOfReal8[0]  
Bucket Brigade.ArrayOfReal8:0  
…  
and nothing works.

I’m using now the Matrikon server simulation, but just for check if Igntion can handle arrays of floats. The final OPC server where I have to work is TOSDIC-CIE DS OPC Server (DA2.0) of TOSHIBA.  
I have read somewhere in this forum that the way to read/write items in arrays depend on the OPC server.  
But I can’t find nothing about it, and i know that matrikon explorer can read/write the OPC server of TOSHIBA without any problem.  
somebody have any idea about it?

---

<div class="post-metadata">

**Author:** ![Michael.Stofan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.stofan/32/3342_2.png) [@Michael.Stofan](https://forum.inductiveautomation.com/u/Michael.Stofan)\
**Post date:** [December 21, 2012, 12:37am UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/2 "2012-12-21T00:37:20Z")

</div>

Unfortunately, we don’t support array data structures in our software. We do you best to display them as strings while reading, but writing will certainly not work.

Your best bet is to create SQLTags for each individual item in that array (if you can address them that way). You could potentially use SQLTags UDTs fir this as well. Hope this helps.

---

<div class="post-metadata">

**Author:** ![TimE](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@TimE](https://forum.inductiveautomation.com/u/TimE)\
**Post date:** [December 21, 2012, 5:03pm UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/3 "2012-12-21T17:03:58Z")

</div>

Are there any plans to support arrays? When I upgraded to Ignition I never put the old FactorySQL to rest because Ignition did not support arrays and I cannot address individual elements. I am still waiting for Ignition to catch up to the abilities of the software it replaced.

I would really like to someday use the same software to do it all.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [December 21, 2012, 6:32pm UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/4 "2012-12-21T18:32:25Z")

</div>

With Ignition, you should be able to address individual items in an array as separate tags. We didn’t lose that functionality.

---

<div class="post-metadata">

**Author:** ![TimE](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@TimE](https://forum.inductiveautomation.com/u/TimE)\
**Post date:** [December 21, 2012, 8:17pm UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/5 "2012-12-21T20:17:44Z")

</div>

Hi Travis,

The link below will take you to the previous post where more information can be found. Please look at it and determine if it is possible.

[http://inductiveautomation.com/forum/viewtopic.php?f=70&t=5564](http://inductiveautomation.com/forum/viewtopic.php?f=70&t=5564)

Thanks,

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [December 21, 2012, 9:48pm UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/6 "2012-12-21T21:48:15Z")

</div>

Ok, FactorySQL did give you the ability to write an array to the database as a string. However, if you want to do something with the value in the database you have to perform string calculations. Ignition doesn’t have this ability. We have never really had array support in FactorySQL or Ignition.

With that said, you can still make individual tags in transaction groups or SQLTags that reference a value from the array usually by adding a “[index]” to the end of the OPC item path. If you need to make a lot of them you can export/import the group or tags in SQLTags through xml or csv.

---

<div class="post-metadata">

**Author:** ![TimE](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@TimE](https://forum.inductiveautomation.com/u/TimE)\
**Post date:** [December 21, 2012, 11:08pm UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/7 "2012-12-21T23:08:10Z")

</div>

Writing the array to the database as a string is what I am no longer able to do. I already have routines to process the data once it gets to the database.

The reason I cannot do this is because in Ignition I get a config error no matter what I do. I am not able to create individual tags because I cannot address a single element of the array by using an index.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [January 14, 2013, 6:27pm UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/8 "2013-01-14T18:27:30Z")

</div>

Ok, I have put a ticket in to get this fixed in Ignition (or at least work the way it did in FactorySQL). We will let you know when it is implemented.

---

<div class="post-metadata">

**Author:** ![Antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Antonio](https://forum.inductiveautomation.com/u/Antonio)\
**Post date:** [January 16, 2013, 6:05am UTC](https://forum.inductiveautomation.com/t/array-read-write-opc-problems/5602/9 "2013-01-16T06:05:40Z")

</div>

Thank you very much Travis!!
