Rockwell Automation 1772-AF3,D17726.5.2 User Manual AUX FUNCT PROM User Manual

Page 13

Advertising
background image

Control

Bits

Position Number

(003 BCD in this example)

File Search Instruction

Chapter 3

3Ć5

The result word also stores control bits of the instruction in addition to the
position number. The control bits are stored in bits 17 thru 14. The 3-digit
position number is stored as a BCD bit pattern in bits 13 thru 00 (Figure 3.7).

Figure 3.7

Example Result Word

Word

Bit Location

Location

17 16 15 14

13 12 11 10

07 06 05 04

03 02 01 00

0405

EN LS DN TR

0 0 0 0

0 0 0 0

0 0 1 1

NOTE: The result word must be initialized to zero before you enable the file
search instruction for the first time. If you want to change file data or the match
word for a new search, you should do so after the instruction sets the done bit.

WARNING: Do not manipulate data in the following addresses or
bits:

Data address or result address of the instruction
Control bit 17-14 of the result word

Inadvertent changes to the above could cause the instruction to miss a match,
or detect a match when one did not exist. If this instruction directly or
indirectly controls an output, an inadvertent change to the values could
result in unpredictable operation, with possible damage to equipment and/or
injury to personnel. It could also cause a run-time error.

You enable the file search instruction in program logic using a separate rung
that precedes the instruction (Figure 3.8). Address an output or latched output
instruction to bit 17 of the file search instruction’s result address, 0405/17.
Program the rung’s input conditions to cycle a false-to-true transition of the
output instruction. This initiates a search for the next matching word in the file
in accordance with your application.

Enabling the Instruction

Advertising