Solution
It is possible to Read/Write an array of variables (excluding Boolean type) to a PLC Memory. Certain memory types (I, Q, M, SM, V, AI, and AQ) support operations on arrays, where Boolean arrays are not allowed.
To specify an array address, append [rows][cols] to the end of an address. If only [cols] is specified, [rows] will default to 1. With the array type, it is possible to read and write a block of 200 bytes at once.
The maximum array size for Word and Short types is 100, and for DWord, Long and Float types is 50. The array size is determined by the multiplication of rows and cols.
Note: The maximum array size also depends on the maximum block size of the device being used.
Examples:
- To read and write an array of 10 Variable Memory (Float) values starting with V10, declare an address as follows: V10 [1][10] with Float as the data type. Note: This array will read and write values to registers V10, V14, V18, V22 ... V46.
- To read and write to bit 23 of Internal Memory (Long) M20, declare an address as follows: M20.23. Choose Long for the data type.
For more information you can refer to NI OPC Server help located in
C:\Program Files (x86)\National Instruments\Shared\NI OPC Servers\V5\Help