Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 349
Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE) Chapter 8
File Arithmetic and Logic
(FAL)
The FAL instruction performs copy, arithmetic, logic, and function operations
on data stored in an array.
Operands:
Relay Ladder
Structured Text
Structured text does not have an FAL instruction, but you can achieve the same
results by using a SIZE instruction and a FOR...DO or other loop construct.
SIZE(destination,0,length-1);
FOR position = 0 TO length DO
destination[position] := numeric_expression;
END_FOR;
See Structured Text Programming
for information on the syntax of constructs
within structured text.
Operand Type Format Description
Control CONTROL Tag Control structure for the operation
Length DINT Immediate Number of elements in the array to
be manipulated
Position DINT Immediate Current element in array
Initial value is typically 0
Mode DINT Immediate How to distribute the operation
Select INC, ALL, or enter a number
Destination SINT
INT
DINT
REAL
Tag Tag to store the result
Expression SINT
INT
DINT
REAL
Immediate
Tag
An expression consisting of tags and/or
immediate values separated by operators
A SINT or INT tag converts to a DINT value by sign-extension.