File Arithmetic and Logic
(FAL)
Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)
The FAL instruction performs copy, arithmetic, logic, and function operations
on data stored in an array.
Operands:
Relay Ladder
Operand
Control
Length
Position
Mode
Destination
Expression
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
within structured text.
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Type
Format
CONTROL
Tag
DINT
Immediate
DINT
Immediate
DINT
Immediate
SINT
Tag
INT
DINT
REAL
SINT
Immediate
INT
Tag
DINT
REAL
A SINT or INT tag converts to a DINT value by sign-extension.
for information on the syntax of constructs
Description
Control structure for the operation
Number of elements in the array to
be manipulated
Current element in array
Initial value is typically 0
How to distribute the operation
Select INC, ALL, or enter a number
Tag to store the result
An expression consisting of tags and/or
immediate values separated by operators
Chapter 8
349