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

Page 15

Advertising
background image

File Search Instruction

Chapter 3

3Ć7

Bit: 15

Function: Done (DN)

Description: The instruction sets this bit in the same scan that it detects the last
match in the file. The done bit remains set until the next false-to-true transition
of the enable bit. Then, the instruction resets bits 16 thru 00 of the result word
(last state, done, and true bits and the position umber in bits 13 thru 00) and
starts the search at the top of the file. The enable bit, bit 17 of this word, is
controlled by program logic.

The search of a file containing several consecutive match words takes less time
than a file search containing no match words. The scan of a 100 word file with
no match words takes approximately 5.5ms.

If you should enter an erroneous address, erroneous data, or erroneous function
number when entering the instruction into your program logic, the processor
will indicate a run-time error when switched from program mode to run or
run/program mode. You will have to correct the error before the processor can
execute your program.

Address Error - An address error occurs when you assign addresses that
extend into illegal areas of memory. These areas include processor word spaces
from addresses 0000-0007 and 0100-0107, and into the user program which is
dependent upon the size of the data table. The industrial terminal will display
the prompt ILLEGAL ADDRESS and the processor will not execute your
program.

Data Error - A data error occurs when you set the file length to zero, or if your
program inadvertently changes the position number in the result word to a value
greater than the file length. The industrial terminal will display the prompt
ILLEGAL DATA and the processor will not execute your program.

Function Number Error - A function number error occurs when you enter a
function number not associated with the auxiliary function PROM being used.
The industrial terminal will display the prompt ILLEGAL OPCODE and the
processor will not execute your program.

The following examples of program logic should help you to design your own
logic for using the file search instruction.

Search Each Scan - You can program the file search instruction to search for a
match every scan by programming two instructions as shown in Figure 3.9.

Instruction Execution Time

Response To Errors in

UserĆEntered Data

Example Programs

Advertising