Rockwell Automation 1772-AF3,D17726.5.2 User Manual AUX FUNCT PROM User Manual
Page 16
File Search Instruction
Chapter 3
3Ć8
If the logic conditions of rung 1 are true, the enable bit, 0405/17, will latch on.
Rung 2 will execute the file search instruction. Rung 3 will unlatch the enable
bit because its logic conditions are identical to those of rung 1. The file search
instruction in rung 4 will see the enable bit reset and will likewise reset the last
state bit. Then execution can continue in the next scan. Both file search
instructions must be identical.
Figure 3.9
Example Logic for Search Every Scan
L
0405
010
00
011
00
17
U
0405
010
00
011
00
OFF 17
21
0400
0405
Function
Funtion Number:
Data Addr:
Rresult Addr:
21
0400
0405
Function
Funtion Number:
Data Addr:
Rresult Addr:
Execute Aux
Execute Aux
Example Program to Demonstrate the File Search Instruction
You can watch the results of the file search instruction by observing the change
in position number each time the instruction finds a match. The program
repeatedly counts in 1.5 second intervals from 000 thru 999.
Enter the program in Figure 3.10 into processor memory. Clear the memory
before entering the program using [CLEAR MEMORY] 99. Enlarge the data
table to accommodate the size of your files (nine 128-word data table sections
in this example). Enter [SEARCH] [5] [0] followed by the number of data table
sections.
Enter data into the addresses as shown in Figure 3.11 using [SEARCH] 53.
With a match word of zero and the instruction file containing all zeros, the
program stops and finds a match at each word.