Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 361
Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE) Chapter 8
File Search and Compare
(FSC)
The FSC instruction compares values in an array, element by element.
Operands:
Relay Ladder
CONTROL Structure
Description: When the FSC instruction is enabled and the comparison is true, the instruction
sets the .FD bit and the .POS bit reflects the array position where the instruction
found the true comparison. The instruction sets the .IN bit to prevent further
searching.
Arithmetic Status Flags: Arithmetic status flags are affected.
Fault Conditions:
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 Offset into array
Initial value is typically 0
Mnemonic Data Type Description
.EN BOOL The enable bit indicates that the FSC 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 not modified.
.IN BOOL The inhibit bit indicates that the FSC instruction detected a true comparison. You must clear this bit to
continue the search operation.
.FD BOOL The found bit indicates that the FSC instruction detected a true comparison.
.LEN DINT The length specifies the number of elements in the array on which the 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
.POS < 0 or .LEN < 0 4 21