The text of a manual · part 39 of 59
Mini-PLC-2/02, -2/16, -2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 21 - Sequencers, pages 325 to 332
Pages 325 to 332 of 490, from Mini-PLC-2/02, -2/16, -2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual
The original document is the PDF (2.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1772-LX / LXP
Page 325
Chapter
21
Sequencers
Chapter Objectives
This describes the three types of sequence instructions: sequencer input sequencer output sequencer load These instructions either transfer information from the data table to output word addresses, compare I/O word information with information stored in tables, or transfer I/O word information into the data table.
Comparison with File Instructions
Sequencer instructions are similar to file instructions but have some marked differences. Both are block instructions that contain a counter and a file. The instructions require the entry of more than one address. Each has a corresponding data monitor display for monitoring, loading or editing file data. File instructions operate on files that are 1 word (16 bits) wide. In contrast, sequencer instructions operate on files that are as many as 4 words (64 bits) wide with as many as 999 rows. A sequencer file can be represented graphically by a sequencer table (Figure 21.1.) Figure 21.1 Sequencer Table
Step
Word 1
Word 2
Word 3
Word 4
001 002 003 " " " " " " 024
00110101 11000101 01110100 00011101 " " " " " " " 00010101 10100000
00011101 11001010 00010111 00110011 " " " " " " " 10100010 10101000
10111011 11001011 " " " " " " " " 01010000 01011111
01011101 01011111 01010101 01010101 " " " " " " " 10111100 00110011
Important: The sequencer’s data table is one word wide by many long. A sequencer table appears in the data table as one continuous file. The length of the file in the data table equals the product of the number of steps and the length as shown in Figure 21.2. As an example, a 24 step x 4 word wide sequencer table occupies 96 consecutive words in the data table.
21-1
Page 326
Chapter 21 Sequencers
Figure 21.2 Sequencer Table Format in the Data Table
Data Table Step 001 002
00 11 01 01 01 11 01 00
11 00 01 01 00 01 11 01 Word #1
024
00 01 01 01
10 10 00 00
Step 001 002
00 01 11 01 00 01 01 11
11 00 10 10 00 11 00 11
024
10 10 00 10
10 10 10 00
Step 001 002
10 11 10 11
11 00 10 11
024
01 01 00 00
01 01 11 11
Step 001 002
01 01 11 01 01 01 01 01
01 01 11 11 01 01 01 01
024
10 11 11 00
00 11 00 11
Word #2
The 4 words per step (columns) of the sequencer table are located sequentially in the data table.
Word #3
Word #4
Data Table 10152-I
Internally indexed file instructions perform the operation and then increment to the next step. In contrast, internally indexed sequencer instructions increment to the next step and then the operation is performed.
Mask
A special programming technique called a “mask” is used with the sequencer instructions. A mask is a means of controlling what bits are controlled/compared by the sequencer instruction. By masking bits, you ensure that the sequencer instruction does not affect them. The masked bits may then be used for other program purposes. A zero (0) in a mask bit location prevents the sequencer instruction transferring data from its file to the output bit location. The output bit is left in its current/last state. A one (1) in a mask bit location allows the instruction to transfer data from the file to the output bit. For all data bits to transfer, a mask of all ones should be used. Figure 21.3 shows the result of masking transfer data. Although a word contains 16 bits, only 8 bits are shown for clarity.
21-2
Page 327
Chapter 21 Sequencer
Figure 21.3 Masking Transfer Data Sequencer Word (Current Step)
0
1
0
1
1
0
1
0
Mask Word
1
0
0
1
1
0
0
1
Output Word prior to Sequencer Operations
1
1
1
0
1
0
0
0
Output word result after Sequencer Operations
0
1
1
1
1
0
0
0
10393-I
Other instructions can change a mask in the user program. If a changing mask is required for different steps in the sequencer operation, a Get/Put or file move can be used.
ATTENTION: When choosing a mask word address, be sure that the next 1, 2, or 3 consecutive word addresses are not already assigned. Other data written into a mask could cause unpredictable machine operation. This could cause damage to your equipment and/or injury to your personnel.
Programming Limitations
Only one step is executed at a time for each instruction. The Sequencer Input instruction can be programmed in the same rung as the Sequencer Output instruction. The sequencer input counter (step counter) can be indexed by the Sequencer Output instruction. The step counter in both instructions is given the same address. When programmed in this manner, the Sequencer Input and Output instructions will track through a controlled sequence of operations. The length of the sequencer is equal to the number of steps (Seq Length) in the sequencer data table.
Sequencer Instructions
Use Figure 21.4 while you read about each sequencer instruction.
21-3
Page 328
Chapter 21 Sequencers
Figure 21.4 Sequencer Instructions Key Sequence SEQ 0
SEQ 1
SEQ 2
1770-T3 Display SEQUENCER OUTPUT COUNTER ADDR: 030 CURRENT STEP: 001 SEQ LENGTH: 001 WORDS PER STEP: 1 FILE: 110- 110 MASK: 010- 010 OUTPUT WORDS 2: 1: 010 3: 4:
030 EN 17 030 DN 15
LOAD WORDS 1: 010 3:
Output instruction Increments, then transfers data. Same data transferred each scan that the rung is true. Counter is indexed by the instruction. Unused output bits can be masked. Requires 5-8 words of your program.
Input instruction. Compares input data with current step for equality. Counter must be externally indexed by a counter instruction within your program. Unused input bits can be masked. Requires 5-8 words of your program.
SEQUENCER INPUT COUNTER ADDR: 030 CURRENT STEP: 000 SEQ LENGTH: 001 WORDS PER STEP: 1 FILE: 110- 110 MASK: 010- 010 INPUT WORDS 2: 1: 010 3: 4:
SEQUENCER LOAD COUNTER ADDR: 030 CURRENT STEP: 000 SEQ LENGTH: 001 WORDS PER STEP: 1 FILE: 110- 110
Instruction Notes
030 EN 17 030 DN 15
Output instruction. Increments, then loads data. Counter is indexed by the instruction. Does not mask. Requires 4-7 words of your program.
2: 4:
Important: Numbers shown are default values. Numbers in shaded areas must be replaced by user-entered values. The number of default address digits displayed (3 or 4) will depend on the size of the data table.
Here is an explanation of each value:
21-4
This Value:
Stores the:
Counter Address
Address of the instruction in the accumulated value area of the data table
Position
Position in the sequencer table (accumulated value of counter)
Seq Length
Number of steps (preset value of the counter)
Words per Step
Width of the sequencer table
File
Starting address of the source file
Mask
Starting address of the mask file
Word Address
Address of the source word or destination word outside of the file
Output Words
Words controlled by the instruction
Load Words
Words fetched by the instruction
Input Words
Words monitored by the instruction
Page 329
Chapter 21 Sequencer
Sequencer Input
The Sequencer Input instruction compares all 16 bits of input data to data stored in its file (data table) for equality. Here are some characteristics of the sequencer input instruction. You can compare up to 64 bits. This instruction is programmed as an input instruction (can be programmed in the same rung as a sequencer output instruction). You can mask the unused input bits. The sequencer input instruction is externally controlled by a counter instruction with ladder logic in your program. This instruction requires 5-8 words of your program. If the rung becomes: True False
The instruction increments to the next step and compares the input word(s) to current step for equality. No action is taken. ATTENTION: The counter address for the Sequencer Output instruction should be reserved for that instruction. Do not manipulate the counter accumulated or preset values. Inadvertent changes to these values could result in hazardous machine operation or a run time error. Damage to equipment and/or personal injury could result.
To enter a Sequencer Input instruction, start by expanding your data table if required. Expand it to a size large enough to store your program.
SEARCH
The word SEARCH appears in the lower left corner of the Industrial Terminal Screen. Puts the processor in the remote program mode.
592 50
The DATA TABLE CONFIGURATION appears. The cursor is on the first digit of NUMBER OF 128 WORD D. T. BLOCKS.
04
To be able to use the sequencer input, output ,and load examples, do the following:
21-5
Page 330
Chapter 21 Sequencers
The cursor moves to the digit 4 and DATA TABLE SIZE changes to 512. This gives you a 512 word data table. After you adjust the data table press CANCEL COMMAND. You are now ready to insert this program. SEQUENCER INPUT COUNTER ADDR: CURRENT STEP: SEQ LENGTH: WORDS PER STEP: FILE: 400MASK: 070INPUT WORDS 2: 1: 110 3: 4:
SEQUENCER OUTPUT COUNTER ADDR: 200 001 CURRENT STEP: SEQ LENGTH: 006 WORDS PER STEP: 2 FILE: 600- 613 MASK: 075- 076 OUTPUT WORDS 2: 013 1: 012 3: 4:
200 001 006 2 413 071 201
200 EN 17 200 DN 15
The word SEQUENCER appears in the lower left hand corner of the screen. SEQ
SEQUENCER INPUT COUNTER ADDR: 030 CURRENT STEP: 000 SEQ LENGTH: 001 WORDS PER STEP: 1 FILE: 110- 110 MASK: 010- 010 INPUT WORDS 2: 1: 010 3: 4:
1
Notice that the words SEQUENCER INPUT are flashing, the cursor is on the first digit of counter address, and the default values are shown. Insert the following values. Your cursor will move automatically throughout the sequencer instruction. The values are: COUNTER ADDR: CURRENT STEP: SEQ LENGTH: WORDS PER STEP: FILE: MASK: INPUT WORDS:
21-6
200 001 006 2 400 070 1: 110 2: 201
Page 331
Chapter 21 Sequencer
The instruction should look like this: SEQUENCER INPUT COUNTER ADDR: CURRENT STEP: SEQ LENGTH: WORDS PER STEP: FILE: 400MASK: 070INPUT WORDS 2: 1: 110 3: 4:
200 001 006 2 413 071 201
To continue, enter your data using the binary data monitor mode. You will get your data from the worksheet in Figure 21.5. A filled in block means that a 1 should be inserted in the corresponding bit position.
21-7
Page 332
Chapter 21 Sequencers
Figure 21.5 Completed Sequencer Input Worksheet
PROJECT NAME Bottle DESIGNER
ALLEN-BRADLEY Programmable Controller Sequencer Table Bit Assignments
PAGE
PROCESSOR
Mini–PLC–2/16
Filling Applications
SEQUENCER FILE
200
WORD ADDR:
110
Timer 200
MASK ADDR:
070
071
WORD #1
TO
413
10 07
SEQ LENGTH:
006
WORD #3 00 17
10 07
WORD #4 00 17
10 07
00
Timer
PC
LS1
00 17
LS2
Auto
D E N V A I M C E E
400
WORD #2
10 07
2
Input
COUNTER ADDR:
17
OF
TO
DATA TABLE ADDR
Engineer
1
MASK STEP
1 2 3 4 5 6
FROM ADDR TO ADDR
Note: A filled-in box means that each device is actuated
21-8
10145-I