Array Support
- Last UpdatedSep 28, 2021
- 1 minute read
The OFSOPC driver allows you to write to an individual array item without updating the whole array. This operation is performed by creating a temporary subscription to the individual sub-item and issuing a write to that item.
For example, the following expression indicates to the OFSOPC driver to assign a value of 8 to the fifth element of the "MyArray" tag in OFS:
MyArray [5] = 8
Note: Plant SCADA indexes an array starting from zero, while some OFS applications allow you to specify an array's lower bound (as a positive or negative value). The OFSOPC driver will dynamically determine an array's lower bound and map the Plant SCADA array to it.
Large array support
The maximum size of an array tag is limited to 256 bytes due to the underlying infrastructure of Plant SCADA. For example, if the type is integer (2 bytes), Plant SCADA only allows the array tag to be configured with 128 elements.
However, special array offset syntax can be used to address multiple array tags configured with the same address as sub-arrays. A variable tag can therefore represent a sub-array with the particular offset and range within a large array.
The following demonstrates the variable tag address syntax used to facilitate this:
[<alias>!]<ITEM_ID>\<OFFSET>!A[SIZE]
Example
The following provides an example of how sub-arrays can be used to map to a large array in an OFS system.
To address IntArray[17] in OFS, you would use the variable tag address LargeArrayPart1[17].
To address IntArray[193], you would use LargeArrayPart2[65] (as 65 = 193-128).