beautypg.com

Operation – sequencer compare, Effect on index register in slc 5/02 processors – Rockwell Automation 1747-PT1, D1747NP002 Hand-Held Terminal User Manual

Page 328

background image

Chapter 24
Sequencer Instructions

24–6

Operation – Sequencer Compare

The SQC instruction compares a word or file of input data, through a mask,
to a word or file of reference data for equality. When the status of all
non-masked bits in an input word match those of the corresponding reference
word, the instruction sets the found bit (FD) in the respective control word.
Otherwise, when the input word does not match, the found bit (FD) is
cleared.

Mask data by resetting bits in the mask word. The bits mask data when reset,
pass data when set. Unless you set mask bits, the instruction will not
compare bits in the reference file against the input value. The mask can be
fixed by entering a hex code. The mask can be a variable by entering an
element address or a file address for changing the mask at each step.

When the rung goes from false–to–true, the instruction increments to the next
step (word) in the sequencer file. Data stored there is transferred through a
mask and compared against the source data for equality. If the source data
equals the reference data, the FD bit is set in the SQC’s control file or word
(R6:x/FD). Current data is compared against the source every scan that the
rung evaluates as true.

Applications of the SQC instruction include machine diagnostics. The
following figure explains how the SQC instruction functions:

0010

0100

1001

1101

1111

1111

1111

0000

0010

0100

1001

1010

0
1
2
3
4

Step

B10:11

12
13
14
15

Word

Input Word I:3.0

Mask Value FFF0

Sequencer Compare File #B10:11

(EN)

(DN)

SQC

SEQUENCER COMPARE
File

#B10:11

Mask

FFF0

Source

I:3.0

Control

R6:21

Length

4

Position

2

(FD)

The FD bit R6:21/FD is set in this example, since the input word matches the sequencer reference
value using the mask value.

Effect on Index Register in SLC 5/02 Processors

The value present in the index register S:24 is overwritten when the
sequencer compare instruction is true. The index register value will equal
the position value of the instruction.