Arrays Support
- Last UpdatedMar 14, 2024
- 4 minute read
To associate a Plant SCADA variable tag with an OPC array, you can place a delimiter like "!" after OPC array address string. The capital letter "A" which when combined as below, instructs the Plant SCADA OPCLX driver that the address is for an array. Follow both with the array size as an integer enclosed within square brackets, as below:
<OPCTOPIC><OPCArrayName>,L<OPCArrayLength>!A[<OPCArrayLength>]
Note: Replace the placeholders <OPCTOPIC>, <OPCArrayName>, and <OPCArrayLength> in the Address box with the actual valid values of the OPC Topic, OPC array name, and length you want to use, as defined in the OPC server.
In the following example with an OPCLX tag defined on a OPC server, five register addresses are associated with the Plant SCADA variable tag named Status_Flags:
-
Variable Tag Name: Status_Flags
-
Address: [OPCLX_test]status_flags,L10!A[10]
You can access individual elements of an OPC array in Plant SCADA by specifying the Plant SCADA tag name and an index number representing the individual element of the array. For example, to refer to the third variable of the array in the above example (Status_Flags), use this syntax in Plant SCADA:
Variable tag: Status_Flags[2]
Note: OPC arrays use zero-based indexing. For example, a five register array would contain individual elements indexed as 0, 1, 2, 3, and 4.
The OPCLX address checking in Plant SCADA always checks if the '!A[<n>]'suffix is used; otherwise the tag is not recognized as an OPC array. Therefore the format '!A[<n>]' must be followed in a tag address if the tag is defined as an array tag.
|
|
|
UNINTENDED EQUIPMENT OPERATION Ensure that the OPCLX address format used is compliant for the OPC server with which you are communicating. Failure to follow these instructions can result in death, serious injury, or equipment damage. |
Example
When Plant SCADA writes to an OPC array, the whole array is read from the driver cache, modified, then written back to the OPC server. However, the driver cache is not updated with the newer data until the server performs its housekeeping tasks and notifies the driver that the array value has been changed. During this time, it is possible for another write request to have been issued with a now out-of-date copy of the original array data from the not-yet-updated driver cache. Later if you write back to the server, any changes made in the first request of this scenario may be lost inadvertently if they are overwritten by the original duplicated data in the second write-back.
To minimize this, the OPCLX driver in Plant SCADA is forced to do a synchronized read before data is modified. However it still has the possibility of losing data if that data is changed by other OPC clients between the time the data is read out and written back. For this reason, it is not recommended that OPC arrays be used in Plant SCADA while other OPC clients may be accessing the same data.
|
|
|
UNINTENDED EQUIPMENT OPERATION Do not use OPC arrays in Plant SCADA while other OPC clients have access to the same data. Failure to follow these instructions can result in death, serious injury, or equipment damage. |
The table below describes the syntax and examples for configuring a full array accessing tags:
|
Address |
Plant SCADA type |
OPCLX type |
Example |
|---|---|---|---|
|
[OPCTopic]<item_id>, |
DIGITAL |
array of |
[OPCLX_test]bool_symbol, |
|
[OPCTopic]<item_id>, |
BYTE |
array of |
[OPCLX_test]byte_symbol, |
|
[OPCTopic]<item_id>, |
INT |
array of |
[OPCLX_test]int_symbol, |
|
[OPCTopic]<item_id>, |
LONG |
array of |
[OPCLX_test]long_symbol, |
|
[OPCTopic]<item_id>, |
REAL |
array of |
[OPCLX_test]real_symbol, |
The table below describes the syntax and examples for configuring index-based array tags:
|
Address |
Plant SCADA type |
OPCLX type |
Example |
|---|---|---|---|
|
[OPCTopic] |
DIGITAL |
VT_BOOL |
[OPCLX_test]bool_symbol[9] |
|
[OPCTopic] |
BYTE |
VT_UI1 |
[OPCLX_test]byte_symbol[9] |
|
[OPCTopic] |
INT |
VT_I2 |
[OPCLX_test]int_symbol[9] |
|
[OPCTopic] |
LONG |
VT_I4 |
[OPCLX_test]long_symbol[9] |
|
[OPCTopic] |
REAL |
VT_R4 |
[OPCLX_test]real_symbol[9] |
The table below describes the syntax and examples for configuring full array accessing tags from the specified start index:
|
Address |
Plant SCADA type |
OPCLX type |
Example |
|---|---|---|---|
|
[OPCTopic]<item_id> |
DIGITAL |
array of |
[OPCLX_test]bool_symbol[1], |
|
[OPCTopic]<item_id> |
BYTE |
array of |
[OPCLX_test]byte_symbol[1], |
|
[OPCTopic]<item_id> |
INT |
array of |
[OPCLX_test]int_symbol[1], |
|
[OPCTopic]<item_id> |
LONG |
array of |
[OPCLX_test]long_symbol[1], |
|
[OPCTopic]<item_id> |
REAL |
array of |
[OPCLX_test]symbol[1], |
The table below describes the syntax and examples for configuring structured array tags:
|
Address |
Plant SCADA type |
OPCLX type |
Example |
|---|---|---|---|
|
[OPCTopic]<item_id> |
DIGITAL |
array of |
[OPCLX_test]bool_symbol[1].tag[2], |
|
[OPCTopic]<item_id> |
BYTE |
array of |
[OPCLX_test]byte_symbol[1].tag[2], |
|
[OPCTopic]<item_id> |
INT |
array of |
[OPCLX_test]int_symbol[1].tag[2], |
|
[OPCTopic]<item_id> |
LONG |
array of |
[OPCLX_test]long_symbol[1].tag[2], |
|
[OPCTopic]<item_id> |
REAL |
array of |
[OPCLX_test]symbol[1].tag[2], |

