Chapter 8
Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)
Array_1
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000001111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
364
Example 1:
Search for a match between two arrays. When enabled, the FSC instruction
compares each of the first 10 elements in array_1 to the corresponding elements
in array_2.
Array_2
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
11111111111111110000000000000000
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Control_3.pos
0
1
2
3
The FSC instruction finds that these elements are
not equal. The instruction sets the .FD and.IN bits.
4
The .POS value (4) indicates the position of the
elements that are not equal. To continue
5
comparing the rest of the array, clear the .IN bit.
6
7
8
9