Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 397
Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE) Chapter 8
Size In Elements (SIZE)
The SIZE instruction finds the size of a dimension of an array.
Operands:
Relay Ladder
Structured Text
The operands are the same as those for the relay ladder SIZE instruction.
Description: The SIZE instruction finds the number of elements (size) in the designated
dimension of the Source array and places the result in the Size operand.
· The instruction finds the size of one dimension of an array.
· The instruction operates on an:
– Array
– Array in a structure
– Array that is part of a larger array
Arithmetic Status Flags: Not affected
Fault Conditions: None.
Operand Type Format Description
Source SINT
INT
DINT
REAL
structure
string
Array tag Array on which the instruction is to operate
Dimension to
Vary
DINT Immediate (0,
1, 2)
Dimension to use:
Size SINT
INT
DINT
REAL
Tag Tag to store the number of elements in the
specified dimension of the array
For The Size Of Enter
First dimension 0
Second dimension 1
Third dimension 2
SIZE(Source,Dimtovary,Size);