0% found this document useful (0 votes)
8 views40 pages

P15C Sequencer Functions 1

The document describes the operation and setup of a sequencer that simulates mechanical drum or disk sequencers, allowing programmers to store and output preset sequences of states. It details the components involved, including the sequencer output instruction, memory allocation, and the importance of using both SQO and SQC instructions for effective control. Additionally, it warns against common pitfalls when using sequencers, such as lack of feedback and timing issues, emphasizing the need for careful programming and setup.

Uploaded by

ryanisawaome
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views40 pages

P15C Sequencer Functions 1

The document describes the operation and setup of a sequencer that simulates mechanical drum or disk sequencers, allowing programmers to store and output preset sequences of states. It details the components involved, including the sequencer output instruction, memory allocation, and the importance of using both SQO and SQC instructions for effective control. Additionally, it warns against common pitfalls when using sequencers, such as lack of feedback and timing issues, emphasizing the need for careful programming and setup.

Uploaded by

ryanisawaome
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Sequence instructions simulate the function performed

by mechanical drum or disk sequencers. These


devices used pins or cams and switches to program a
output sequence.

CAM SENSOR SWITCHES


ROTATION
STEP 6
STEP 5
STEP 4
STEP 3
STEP 2
STEP 1

Drum Sequencer Illistration


Sequencer Function:
•Allows programmer to store a preset sequence of output states
as 16 bit words.
•Each word is then sequenced to the real outputs.
•Sections of the 16 bit output word can be masked off if needed.
Sequencer Output Instruction and Memory Usage:
PB #1 SQO
SEQUENCER OUTPUT EN
FILE #B12:1
MASK 0FFFFh
DEST O:2 DN
CONTROL R6:2
LENGTH 8
POSITION XX

Sequencer Instruction Memory Allocation


File Address:
This file address is the first word in the processor file, which
contains the output data to be sequenced by the instruction. It
should be a bit or word type file; and we recommend using a
separate file above #9. You must use the (#) character in front of
this address to indicate it is a file address. Using the pre-assigned
B3 file can cause problems if the programmer is not careful in
allocating new bit functions. There is no write protection or
warning issued against over writing words assigned to the
sequencer.
Mask Word:
All data transferred from the file address to the output word will
be passed through this mask word. The mask can be a hex value
as is shown in slide 3 or an additional file address. In any case,
each position set to a 1 will pass data; each position set to a 0 will
block data. If the mask is a file, the file length will be the same
as the instruction file length and the position will track in
sequence. Note that when entering a hex number higher than
9FFF you must precede the number with a “0”. To set the mask
at FFFF you would have to enter 0FFFFh.
Destination Word:
This is the output word destination for the SQO instruction.
Each time the rung conditions go from FALSE to TRUE, the
contents of the next position in the bit file are transferred through
the mask to this location. This address can be a real output word
or an internal memory address.
Control Address:
This is the position of the three status words allocated in the
control file R6 that are used to keep track of status bits and
position counts for this instruction. The programmer must be
careful to keep track of the control file addresses used in his
program. If you assign the same control address to more than one
instruction unpredictable operation will result.
Length Variable:
Contains the number of steps assigned to the instruction
beginning at step 1. All SQO instructions start at position “0”
when the PLC is switched from program mode to run mode. Due
to this extra state, all sequencer files use file length +1 number of
words. The sequencer resets to position 1 after reaching the last
step and not to position 0.
Sequencer Status Bits:
EN- The enable bit, which is on any time the rung conditions are TRUE.
DN- The done bit, which is set on when the sequencer steps to the last
position in the file. The next FALSE-to-True transition of the rung
clears this bit and resets the position counter to position 1. Note that
position 0 is only encountered when the PLC is switched from program
to run mode.
ER- The error bit, which is set on if the processor sees a negative
position value or no length value. This error condition would only be
encountered if you were changing the sequencer’s setup values as part of
the ladder program.
FD- This bit is only used in SQC instructions. It will be explained when
we examine the SQC instruction format.
Sequencer Setup Procedure:
1. Determine how many outputs you will have to manipulate:
2. Assign each position in the sequencer output word to one of these
functions.
3. Map the output word and step values in a chart.
4. Open the bit file and program in the step values in Hex or in bit
format.
5. Test Sequencer function to debug program.
Sample Program: Setting up the output word type.
If all the I/O bits we need for the application are contained in one
16-bit output module we can use that output module as our
output word. If, as is the usual case, the I/Os are spread over
several output modules then we must use an internal word of
memory as our output word. We then must use additional ladder
rungs to take each of these internal memory bits and drive the
real output bit from the rung.
Setting up the Mask:
Let us assume we have all the outputs for this station connected
to one output module. This is a rare case in the real world but for
our first example it makes things simpler. Note that four
addresses of our I/O module are assigned to a different
mechanism and therefore will not be controlled by this
sequencer.
I/O Assignments:

O:2.0/15 CYLINDER 6 EXT SOL O:2.0/7 DIFFERENT STATIONS I/O


O:2.0/14 CYLINDER 6 RET SOL O:2.0/6 DIFFERENT STATIONS I/O
O:2.0/13 DIFFERENT STATION S I/O O:2.0/5 CYLINDER 3 EXT SOL
O:2.0/12 CYLINDER 5 EXT SOL O:2.0/4 CYLINDER 3 RET SOL
O:2.0/11 CYLINDER 5 RET SOL O:2.0/3 CYLINDER 2 EXT SOL
O:2.0/10 CYLINDER 4 EXT SOL O:2.0/2 CYLINDER 2 RET SOL
O:2.0/9 CYLINDER 4 RET SOL O:2.0/1 CYLINDER 1 EXT SOL
O:2.0/8 DIFFERENT STATIONS I/O O:2.0/0 CYLINDER 1 RET SOL
Setting the Mask Word:

CY3 EXT

CY2EXT
CY5EXT

CY1EXT
CY4EXT

CY3RET

CY1RET
CY2RET
CY6RET

CY5RET

CY4RET
CY6EXT

NU

NU
NU
NU
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00

MASK 1 1 0 1 1 1 1 0 0 0 1 1 1 1 1 1
D E 3 F
Sequence of Operation:
1. Extend cylinder #1
2. Extend cylinders #3 & #4
3. Extend cylinder #5
4. Extend cylinder #2 & #6
5. Return cylinder #6
6. Return cylinder #2
7. Return cylinder #5
8. Return cylinder #3 & #4
9. Return cylinder #1
Sequencer Instruction:

PB #1 SQO
SEQUENCER OUTPUT EN
FILE #B12:0
MASK DE3Fh
DEST O:2.0 DN
CONTROL R6:2
LENGTH 10
POSITION XX
Data File Transfer Diagram:
Output
Word O:2

Mask
Sequencer File B12
0
1
Position
count = 3 2
3
4
5
6
7
8
9
10
11
Sequencer File Setup:

CY3 EXT

CY2EXT

CY1EXT
CY5EXT

CY4EXT

CY1RET
CY3RET

CY2RET
CY4RET
CY6RET

CY5RET
CY6EXT

NU

NU
NU
NU
Output
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 Word

Step Bit Pattern Word

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0=0000h
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1=0000h
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 2=0002h
3 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 3=0420h
4 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 4=1000h
5 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 5=8008h
6 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6=4000h
7 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 7=0004h
8 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 8=0800h
9 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 9=0210h
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 10=0001h
11
Warning On Sequencer SQO Operation:
It is important to point out that the sequencer will step each time
the button is pressed even if the previous step was not completed.
In a manual mode type of operation, this is only a minor problem
because an operator will be present to watch the operation. If
however, you were going to use a sequencer output file to control
a mechanism in auto mode it becomes a major problem.
Warning On Sequencer SQO Operation:
A common mistake many inexperienced programmers make is
attempting to use SQO instructions to control the automatic
machine cycle. At first glance it seems to be so much easier than
writing all those rungs of code we would normally need if we
were using standard ladder logic. We could just use two timers
tied together for step timing and run the whole machine in auto
cycle with just one sequencer instruction. Although this seems
like a good idea, it has some major problems.
Warning On Sequencer SQO Operation:
The first major control problem is the lack of any mechanical
position feedback. In our standard ladder programming we use
the position switches on the mechanisms to trigger the next
movement. If the previous output movement is not sensed to be
complete, the sequence stops. In this SQO program the sequence
will step regardless of the completion of the previous step. If a
mechanism becomes jammed, the sequence will continue anyway
and may cause extensive damage to our equipment.
Warning On Sequencer SQO Operation:
The second problem with using an SQO-only design is that of
timing. Because we only have one set of step timers running, we
must chose a time delay between steps that is long enough for the
slowest mechanism in the machine. This means most of the other
mechanisms will have completed their movement and be waiting
for the next step time-out. Due to this timing limitation, the
machine will cycle at a much slower rate that it is capable of.
Warning On Sequencer SQO Operation:
An additional problem will occur if some variable in the machine
design changes. If the air pressure is set lower or some of the
cylinder seals become worn, the machine will have repeated jam
ups because it cannot sense the changes and the timer will
assume everything takes the same amount of time to complete as
before.
SQO-SQC Combination:
For the reasons previously given, the use of sequencer output
instructions by themselves to control the auto cycle of a machine
is not recommended. The way to overcome these feedback
problems is to use a combination of the SQC and SQO
instructions working together.
SQC Instruction Format and Memory Allocation:
STEP SQC
SEQUENCER COMPARE EN
FILE #B12:20
MASK 0FFFFh
SOURCE I:02 DN
CONTROL R6:9
LENGTH 8
POSITION XX FD

15 14 13 12 11 10 9 8 0
EN DN ER FD
SEQUENCER LENGTH
STEP POSITION
SQC Addresses and Variables:
All the addresses and variables are the same format as was shown
in the SQO instruction except the FD status bit.
FD- found bit, which is set on when a match is found between
the contents of the input word and the contents of the word being
pointed to in the SQC file. The contents of the input word are
passed through the mask before the compare function is
performed.
SQC-SQO Data Transfer and Handshake Interface:
Input Output
B12:5 B12:4
Word EN Word
SQC SQO
Instruction FD Instruction Mask
Mask
SQC Data SQO Data
SQC B12:30 B12:10 SQO
Position Position
counter B12:31 B12:11 counter
B12:32 B12:12
B12:33 B12:13
B12:34 B12:14
B12:35 B12:15
B12:36 B12:16
B12:37 B12:17
B12:38 B12:18
B12:39 B12:19
NU LAMP 15 (Position 1)
NU NU
NU NU
NU NU
NU NU
NU LAMP 3( Cyl 3 Ext)
NU LAMP 2 (Cyl 2 Ext)
START PB LAMP 1( Cyl 1 Ext)
TIMER 2 DN Bit TIMER 2
TIMER 1 DN Bit TIMER 1
CY3RET LS CY3RET
CY3 EXT LS CY3 EXT
CY2RET LS CY2RET
CY2EXT LS CY2EXT
CY1RET LS CY1RET
Input – Output Word Bit Assignments:

CY1EXT LS CY1EXT
Input
Word

Word
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 B12:4

15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 B12:5
Output
Operational Sequence:
1) When switched to Run mode light lamp 15 and wait for the Start PB.
2) When start PB closes extend cylinder 1, light lamp 1, turn off lamp 15.
3) When cylinder 1 extend switch closes extend cylinder 2 and light lamp 2.
4) When cylinder 2 extend switch closes wait 5 seconds.
5)When timer is done extend cylinder 3 and light lamp 3.
6) When cylinder 3 extend switch closes return cylinder 3 and turn off lamp 3
7) When Cylinder 3 return switch closes wait 3 seconds.
8) When timer is done return cylinder 2 and turn off lamp 2.
9) When cylinder 2 return switch is closed return cylinder 1 and turn off lamp 1.
10) When cylinder 1 return switch closes move to step 1
Output Data Table:

LAMP 15 (Position 1)

LAMP 1( Cyl 1 Ext)


LAMP 2 (Cyl 2 Ext)
LAMP 3( Cyl 3 Ext)

CY3 EXT
TIMER 2
TIMER 1

CY1EXT
CY2EXT
CY3RET

CY2RET

CY1RET
NU
NU
NU
NU
Output
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 Word B12:4

Step Bit Pattern File B12


0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10=0000h
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11=8000h
2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 12=0101h
3 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 13=0305h
4 0 0 0 0 0 0 1 1 0 1 0 0 0 1 0 1 14=0345h
5 0 0 0 0 0 1 1 1 0 0 0 1 0 1 0 1 15=0715h
6 0 0 0 0 0 0 1 1 0 0 1 0 0 1 0 1 16=0325h
7 0 0 0 0 0 0 1 1 1 0 1 0 0 1 0 1 17=03A5h
8 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 18=0129h
9 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 19=002Ah
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20=0000h
21
Input Data Table:

TIMER 2 DN Bit
TIMER 1 DN Bit

CY3 EXT LS

CY1EXT LS
CY2EXT LS
CY3RET LS

CY2RET LS

CY1RET LS
START PB
NU

NU
NU
NU
NU
NU
NU
Input
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 Word B12:5

Step Bit Pattern File B12


0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 30=002Ah
1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 31=012Ah
2 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 32=0029h
3 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 33=0025h
4 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 34=0065h
5 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 35=0015h
6 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 36=0025h
7 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 37=00A5h
8 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 38=0029h
9 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 39=002Ah
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 40=0000h
41
Debugging Sequencer Files:
Sequencer Load Instructions and Memory Allocation:

STEP SQL
SEQUENCER LOAD EN
FILE #B12:20
SOURCE I:02
CONTROL R6:9 DN
LENGTH 8
POSITION XX

15 14 13 12 11 10 9 8 0
EN DN ER
SEQUENCER LENGTH
STEP POSITION
SQL Instruction Use:
The SQL instruction can be used to load a sequence of data
values into successive memory locations or to transfer a sequence
of memory locations into a sequencer file. Each time the input
rung goes from False to True the SQL instruction will copy the
source word to the position in the file currently being pointed to
by the position counter. In this way a programmer can load
different pre-stored programs into a sequencer operation or
record the actual input conditions that exist when a SOQ
instruction runs.
SQL File Address:
The file address is the first word in the processor file where data
will be stored by the sequencer instruction. It can be a bit or
word type file and you must use the (#) character in front of it to
indicate it is a file address. Using the pre-assigned B3 file can
cause problems if the programmer is not careful when allocating
new bit functions.
SQL Source Address:
The source address can be a word address or a file address. In
both cases it is the input address for the SQL instruction. Each
time the rung conditions go from FALSE to TRUE, the contents
of this address are stored at the file word pointed to by the
position counter. If the address is a file address then the two files
will be stepped in sequence as the load instruction runs.
SQL Control Word:
This is the position of the three status words allocated in the
control file that are used to keep track of status bits and position
counts for this instruction. The programmer must be careful to
keep track of the control addresses used in his program. If you
assign the same control address to more than one instruction
unpredictable operation will result.
SQL Length Variable:
Contains the number of steps assigned to the
instruction beginning at step 1. All SQL instructions
start at position 0 when the PLC is switched from
program mode to run mode. Due to this extra state all
sequencer files use file length +1 number of words.
SQL Position Variable:
The actual position in our sequence file being loaded from the
input word.
SQL Status Bits:
EN- The enable bit, which is on any time the rung conditions are TRUE.
DN- The done bit, which is set on when the sequencer steps to the last
position in the file. The next FALSE-to-True transition of the rung
clears this bit and resets the position counter to position 1. Note that
position 0 is only encountered when the PLC is switched from program
to run mode.
ER- The error bit, which is set on if the processor sees a negative
position value or no length value. This error condition would only be
encountered if you were changing the sequencer’s setup values as part of
the ladder program.

You might also like