Sequencer and Shift Register Instructions Chapter 12 245
Parameters that may be required to be entered in se-
quencer instructions can be summarized as follows:
File —Is the starting address for the registers in the se-
quencer le and you must use the indexed le indica-
tor (#) for this address. The le contains the data that
will be transferred to the destination address when the
instruction undergoes a false-to-true transition. Each
word in the le represents a position, starting with
position 0 and continuing to the le length.
Mask —Is the bit pattern through which the sequencer
instruction moves source data to the destination ad-
dress. Recall that in the mask bit pattern, a 1 passes
values while a 0 blocks the data ow. You use a mask
register or le name when you want to change the
mask pattern under program control. An h is placed
behind the parameter to indicate that the mask is
a hexadecimal number or a B to indicate binary
notation. Decimal notation is entered without any
indicator.
Source —Is the address of the input word or le from
which the SQC and SQL instruction obtains data for
comparison or input to its sequencer le.
Destination —Is the address of the output word or le
to which the SQO moves the data from its sequencer
le.
Control —Is the address that contains the parameters
with control information for the instruction. The con-
trol register stores the status byte of the instruction,
the length of the sequencer le, and the instantaneous
position in the le as follows:
- The enable bit (EN; bit 15) is set by a false-to-true
rung transition and indicates that the instruction is
enabled. It follows the rung condition.
- The done bit (DN; bit 13) is set after the last word
in the sequencer le is transferred. On the next
false-to-true transition of the rung with the done bit
set, the position pointer is reset to 1.
- The error bit (ER; bit 11) is set when the proces-
sor detects a negative position value, or a negative
or zero length value.
12.2 Sequencer Instructions
PLC sequencer instructions replace the mechanical drum
sequencer that is used to control machines that have a
stepped sequence of repeatable operations. Programmed
sequencers can perform the same speci c on or off pat-
terns of outputs that are continuously repeated with a
drum switch, but with much more exibility. Sequencer
instructions simplify your ladder program by allowing
you to use a single instruction or pair of instructions to
perform complex operations. For example, the on/off op-
eration of 16 discrete outputs can be controlled, using a
sequencer instruction, with only one ladder rung. By con-
trast, the equivalent contact-coil ladder control arrange-
ment would need 16 rungs in the program.
Depending on the PLC manufacturer, various sequencer
instructions can be programmed. Figure 12-6 shows the
Sequencer menu tab for the Allen-Bradley SLC 500
PLC and its associated RSLogix software. For the Allen-
Bradley line of controllers, sequencer commands may
include the following:
SQO (Sequencer Output) —Is an output instruction
that uses a le to control various output devices.
SQI (Sequencer Input) —Is an input instruction that
compares bits from an input le to corresponding bits
from a source address. The instruction is true if all
pairs of bits are the same.
SQC (Sequencer Compare) —Is an output instruc-
tion that compares bits from an input source le to
corresponding bits from data words in a sequence le.
If all pairs of bits are the same, then a bit in the con-
trol register is set to 1.
SQL (Sequencer Load) —Is an output instruction
used to capture reference conditions by manually
stepping the machine through its operating sequences.
It transfers data from the input source module to the
sequencer le. The instruction functions much like a
le-to-word transfer instruction.
Figure12-7 shows an example of an SQO (Sequencer
Output) instruction. The SQO instruction reads data le
elements (words) one at a time, applies a mask word to
enable or disable bits from the current data le element,
and transfers the masked data le element to a designated
output.
Figure 12-6 Sequencer menu tab.
BSL BSR SQC SQL SQO FFL
File Shift / Sequencer
File/Misc Program Control
FFU LFL LFU
Figure 12-7 SQO (Sequencer Output) instruction.
SQO
SEQUENCER OUTPUT
File
Mask
Destination
Control
Length
Position
DN
EN
pet10882_ch12_242-267.indd 245pet10882_ch12_242-267.indd 245 7/27/10 4:32 PM7/27/10 4:32 PM