File Search and File Diagnostic Instructions
Chapter 17
174
Figure 17.3
FILE SEARCH Example Rung
FILE SEARCH
COUNTER ADDR: 200
POSITION: 003
FILE LENGTH: 064
WORD ADDR: 141
FILE: 400- 477
200
(EN)
17
200
(DN)
15
The File Diagnostic instruction can be used for programmed machine
diagnostic error detection in conjunction with File-to-File XOR or
Word-to-File XOR instructions. First, an XOR operation is performed
(Figure 17.4a) between File A, containing actual I/O states, and File B,
containing desired I/O states at a particular point in time. Any bits in
File A that differ in state from those in File B will be recorded in the
corresponding bits in File R as 1. A File Diagnostic instruction can then be
performed on File R.
The File Diagnostic instruction, on a false-true transition of the rung,
searches the specified file (File R from the XOR instruction) for 1. When a
1 is found, the Diagnostic instruction cross-references the bit address in the
file to the corresponding bit address in the base file (File A from the XOR
instruction). Refer to Figure 17.4.
The error number and the cross-referenced bit address will be stored
in BCD in the error file as shown in Figure 17.4b. On each successive
false-true transition, the instruction will continue searching the file from
the point it left off until it finds the next 1. These new error numbers and
cross-referenced bit addresses will be stored in the error file in place of the
old data. When the entire file has been searched, the done bit is set. On the
next false-true transition, the done bit is reset and the instruction begins
searching for 1 at the beginning of the file.
17.2
File Diagnostics
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com