Chapter 4. Ladder Diagram (LD) Programming
GFK-2950C February 2018 141
4.8.2 Array Size Dimension Function Blocks
Array Size Dimension 1
Returns the value of the Array Dimension 1 property of an array and
writes the value to output Q. If a non-array variable is assigned to IN, the
value of Q is 0.
In an LD or ST block that is not a parameterized block or a User Defined
Function Block (UDFB), you can use the output Q value to ensure that a
loop using a variable index to access array elements does not exceed the
array’s first dimension.
Data flow, I, Q, M, T, S, SA, SB,
SC, G, discrete symbolic, I/O
variable
The value of the Array Dimension 1 property of the array
assigned to input IN. The value is set to 0 if a non-array is
assigned to IN.
Note: Because the index of the first element of an
array is zero, the index of the last element is one
less than the value assigned to Q.
DINT or DWORD variable.
Data flow, I, Q, M, T, G, R, P, L,
AI, AQ, W, symbolic,
I/O variable
Returns the value of the Array Dimension 2 property of an array and writes
the value to output Q. If a non-array variable is assigned to IN, the value of
Q is 0.
In an LD or ST block that is not a parameterized block or a User Defined
Function Block (UDFB), you can use the output Q value to ensure that a
loop using a variable index to access array elements does not exceed the
array'’s second dimension.
Data flow, I, Q, M, T, S, SA, SB,
SC, G, discrete symbolic, I/O
variable
The value of the Array Dimension 2 property of the array
assigned to input IN. The value is set to 0 if a non-array is
assigned to IN.
Note: Because the index of the first element of an
array is zero, the index of the last element is one
less than the value assigned to Q.
DINT or DWORD variable.
Data flow, I, Q, M, T, G, R, P, L,
AI, AQ, W, symbolic,
I/O variable