Refer to Array Elements
Each entry in an array is referred to by an index. You can extract individual variables (from the array) by specifying the tag name and index using the following format:
For example, to refer to the third variable of the array "Conveyor_Speed", use the following syntax:
The index of the first entry in an array is always 0 (zero).
Note the following when using arrays:
- Do not define large arrays, because each time an individual array entry is requested, Citect SCADA reads the entire array from the I/O device. With large arrays, system performance could be reduced.
- The size of the array needs to be less than the for the driver used to connect to the I/O device. To determine the maximum request length, refer to the driver documentation.
- Declare digital arrays on a 16 bit boundary. Citect SCADA rounds each digital array down to the nearest 16 bit boundary. Consequently, digitals in the array are changed. For example, if you declare an array Test to start at bit 35, and Citect SCADA starts the array at bit 32. The index to the array also starts at bit 32; Test[0] refers to bit 32, not bit 35.
- Each individual array entry has its own data value for the field, valid and override elements, but the entries within an array share the override and control mode elements, quality and timestamps. Reading the quality or timestamp for an indexed array entry will return the quality or timestamp for the entire array. Writing to the value for an indexed array entry will change the timestamps and quality for the entire array. Changing the override mode and the control mode for an array entry will change it for the entire array.
See Also
Published June 2018