Question

Is there a sample of how array tags can be accessed from a script?

Answer
Array tags defined in the FA-Panel "Panel Server" can be read and written using the ReadVal/WriteVal methods.However, it is not possible to read/write (ReadVal/WriteVal/WriteRefresh) or bind directly to each element of an array tag by script. (For example, it is not possible to read/write only the third element of an array of 100 elements.)

If you need to read or write to each element of an array tag by script or bind, please define a tag for each address that needs to be read or written, instead of using an array tag.If you have already created an array tag and need to access each element of the array tag, you can solve the problem by adding a separate tag for each element and reading/writing to that tag.In this case, the number of tags will increase, but the internal communication process is optimized, and communication performance will not be slowed down by duplicate communication.

For example, create a separate tag like the one below to access each element of the 10 array tags U01.F01.T01.
Examples.)
  • Array Tags
    U01.F01.T01 --- D0000 to D0009
  • Array element access tags
    U01.F01.T01_0 --- D0000
    U01.F01.T01_1 --- D0001
    ...
    U01.F01.T01_9 --- D0009
To add access tags to each element, it is convenient to use the "Add Tag Continuously" function.For more information, please check here.
This sample is here. Please refer to it.
Was this answer helpful to you? Yes No