350 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 8 Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)
CONTROL Structure
Description: The FAL instruction performs the same operations on arrays as the CPT
instruction performs on elements.
The examples that start on page 356
show how to use the .POS value to step
through an array. If a subscript in the expression of the Destination is out of
range, the FAL instruction generates a major fault (type 4, code 20).
Arithmetic Status Flags: Arithmetic status flags are affected.
Fault Conditions:
Mnemonic Data Type Description
.EN BOOL The enable bit indicates that the FAL instruction is enabled.
.DN BOOL The done bit is set when the instruction has operated on the last element (.POS = .LEN).
.ER BOOL The error bit is set if the expression generates an overflow (S:V is set). The instruction stops executing
until the program clears the .ER bit. The .POS value contains the position of the element that caused the
overflow.
.LEN DINT The length specifies the number of elements in the array on which the FAL instruction operates.
.POS DINT The position contains the position of the current element that the instruction is accessing.
A major fault will occur if Fault type Fault code
Subscript is out of range 4 20
.POS < 0 or .LEN < 0 4 21