1772-6.5.2, 4 - file diagnostic instruction, File diagnostic instruction – Rockwell Automation 1772-AF3,D17726.5.2 User Manual AUX FUNCT PROM User Manual

Page 18

Advertising
background image

Chapter

4

4Ć1

File Diagnostic Instruction

The auxiliary file diagnostic instruction is an output instruction. It compares
data in a file of actual values with another file of user-entered reference values,
word-by-word and bit-by-bit. The instruction starts at the beginning of the files
and searches from lowest to highest word address and from lowest to highest bit
number. When the instruction finds a mismatch, it stops at the word containing
the mismatch and sets a bit. The instruction sets the true bit (described later) to
signal that a new mismatch was found. Then, in the same scan, it temporarily
stores the following information:

Word address and bit number found mismatched in the file of actual values
Number of mismatched values found to that point in the file
Status of the bit in the file of actual values that did not match the reference

bit

The instruction stores the above information in a 3-word result file. Your
program logic can detect the setting of the true bit, and perform the application
logic associated with the mismatch. On the next execution of the instruction,
the comparison search continues from the word/bit address where the previous
mismatch was found.

Your program must cycle the instruction’s enable bit through a false-to-true
transition for each mismatch of file data, until the instruction sets its done bit.
The instruction sets a done bit after it finds the last mismatch in the file, or if it
finds no mismatch in the file. In the next false-to-true transition of the enable
bit, the instruction clears its stored data and resets its control bits. If your
program has cycled the enable bit, the instruction will immediately begin the
search again from the beginning of the files.

Generally, a minimum of two scans is required to detect each mismatch. In the
first scan that the instruction is enabled, it finds the mismatch, stores the
information, and sets the true bit. In the next scan, the instruction resets the true
bit, and your program can reset the enable bit. Later in this chapter we will
describe a program that detects a mismatch on each scan.

General

Advertising