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