OPC array item PI points
- Last UpdatedMay 21, 2025
- 2 minute read
OPC servers can contain arrays of data, which are composed of multiple values of the same data type plus a single quality and time stamp. Because Data Archive does not support array data types, you must configure one PI point for each array element that you want to store, or use the TimeArray plug-in. For details, see PI Interface for OPC DA - Plug-In DLLs.
To define a PI point to contain an element from an OPC array, specify the ItemID of the array item in the instrumenttag attribute and set userint1 to the index number of the element in the array. You must define a PI point for the first array element (userint1 = 1), even if you do not require its data. However, you do not need to define points for all array elements, only for the first array element and any individual elements of interest.
If an array tag from the OPC server is read into multiple PI points, each PI point receives the value of the array element indexed by the userint1 setting and the same time stamp and quality, because an array contains multiple values but only one time stamp and quality. To read an OPC array tag into a single PI point, you must use the TimeArray plug-in, which stores an array of values into a single PI point as successive data values, incrementing the time stamp that came with the array by a configured interval for each value. For details, refer to the TimeArray plug-in manual.
All PI points configured for an OPC array must have identical settings for pointsource, location1, and location4 (and userint2, if they are event points). For advise points, set location3 to 1. For polled points, set location3 to 0.
When configuring PI points to read OPC arrays, note the following:
-
You must define a point that reads the first array element.
-
Assign the points to the same scan class.
-
To optimize CPU usage, do not use the same scan class to read more than one OPC array.
-
If you need to read the same OPC array element into more than one point, you must assign the points to different scan classes.