D-19, Diagnostic instructions – Rockwell Automation 1785-Lxxx Enhanced and Ethernet PLC-5 Programmable Controllers User Manual
Page 319

Publication 1785-UM012D-EN-P - July 2005
Instruction Set Quick Reference D-19
Diagnostic Instructions
Instruction
Description
File Bit Compare
FBC
Status Bits:
EN - Enable
DN - Done Bit
ER - Error Bit
IN - Inhibit Bit
FD - Found Bit
When the input conditions go from false-to-true, the controller
compares the number of bits specified in the CMP Control
Length (48) of the Source file (#I:031) with the bits in the
Reference file (#B3:1). The controller stores the results
(mismatched bit numbers) in the Result file (#N7:0). File R6:4
controls the compare and file R6:5 controls the file that
contains the results. The file containing the results can hold up
to 10 (the number specified in the Length field) mismatches
between the compared files.
Note: To avoid encountering a possible run-time error when
executing this instruction, add a ladder rung that clears S:24
(indexed addressing offset) immediately before a FBC
instruction.
Diagnostic Detect
DDT
Status Bits:
EN - Enable
DN - Done Bit
ER - Error Bit
IN - Inhibit Bit
FD - Found Bit
When the input conditions go from false-to-true, the controller
compares the number of bits specified in the CMP Control
Length (20) of the Source file (# I:030) with the bits in the
Reference file (#B3:1). The controller stores the results
(mismatched bit numbers) in the Result file (#N10:0). Control
element R6:0 controls the compare and the control element
R6:1 controls the file that contains the results (#N10:0). The file
containing the results can hold up to 5 (the number specified in
the Length field) mismatches between the compared files. The
controller copies the source bits to the reference file for the
next comparison.
The difference between the DDT and FBC instruction is that
each time the DDT instruction finds a mismatch, the controller
changes the reference bit to match the source bit. You can use
the DDT instruction to update your reference file to reflect
changing machine or process conditions.
Note: To avoid encountering a possible run-time error when
executing this instruction, add a ladder rung that clears S:24
(indexed addressing offset) immediately before a DDT
instruction.
Data Transition
DTR
The DTR instruction compares the bits in the Source (I:002)
through a Mask (0FFF) with the bits in the Reference (N63:11).
When the masked source is different than the reference, the
instruction is true for only 1 scan. The source bits are written
into the reference address for the next comparison. When the
masked source and the reference are the same, the instruction
remains false.
FBC
FILE BIT COMPARE
Source
Result
#I:031
#N7:0
#B3:1
R6:4
Reference
Cmp Control
Length
Result Control
Position
48
0
Position
Length
R6:5
10
0
DDT
DIAGNOSTIC DETECT
Source
Result
#I:030
#N10:0
#B3:1
R6:0
Reference
Cmp Control
Length
Result Control
Position
20
0
Position
Length
R6:1
5
0
DTR
DATA TRANSITION
Source
Reference
I:002
N63:11
Mask
0FFF