Array data type usage considerations
An array is a data value that contains multiple elements, each of which maps to one or more
FactoryTalk
data tags. An array may have one or more dimensions.Arrays are denoted by square brackets that identify the number of elements in each dimension of the array.
Example
- A single-dimension arrayTagName[1]
- A three-dimension arrayTagName[1,2,3]
Some OPC UA nodes can operate as an array or a scalar. The OPC UA Server determines the operational mode of the node. Once the OPC UA Server sets an operational mode for the node, it continues to operate under that mode for the duration of the session.
When working with the array data type, be aware of these considerations:
- All OPC UA Servers include some data arrays. For example, the nodesNamespaceArrayandServerArray.
- Array length may be dynamic and can change in any dimension at run time. OPC UA Servers determine the length.
- Array elements must all share the same data type; they cannot be a mix of Booleans, Strings, and Integers.Exception: If theDataTypeof the value is defined as a Variant (BaseDataType), each element can be anyDataTypeand any shape (for example, structured or non-structured, scalar or array). The Variant will convert the scalar items to strings.
- If the Array access method -Access subset of array (indexed elements)- is not selected when configuring OPC UA Server properties, all elements in the array are read or written.TIP:In this mode, a write operation could overwrite other values in the array.
- When the Array access method -Access subset of array (indexed elements)- is selected, the array is partitioned into subsets of elements. When a Live Data tag is subscribed to the connector locates the partition it belongs to and subscribes to that partition. When any element in that partition changes, all the values for that partition are sent to the OPC UA Connector.
- When the Array access method -Operate on entire array at once (all elements)- is selected, when any element in the array changes, all of the array data is sent to the OPC UA Connector.
- Arrays used with method input arguments have special considerations as described inWorking with input arguments that contain arrays.
Provide Feedback