The text of a manual · part 16 of 59
Mini-PLC-2/02, -2/16, -2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 8 - Scan Theory
Pages 119 to 126 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 119
Chapter
8
Scan Theory
Chapter Objectives
In this chapter you will read about: scan function scan time
Scan Function
The processor controls the status of output devices or instructions in accordance with program logic. Every instruction in your program requires execution time. These times vary greatly depending upon the instruction, the amount of data to be operated on, and whether the instruction is true or false. As a review from chapter 2, there are two types of scans (Figure 8.1): I/O scan Program scan
8-1
Page 120
Chapter 8 Scan Theory
Figure 8.1 The Processor Scans With This Sequence
Output Image Table
Output Terminals
Copy output image table status into output terminal circuits. I/O Scan
Input Image Table
Input Terminals
Copy input terminal status into input image table
( )
Program Statement
Program Scan
Execute each program rung in sequence, writing into bits in the data table, including the output image table.
10351-I
Upon power-up, the processor begins the scan sequence with a program pre-scan. The processor then proceeds with the I/O scan. Data from output image table is written to the output modules. Data from the input modules is read into the input image table.
8-2
Page 121
Chapter 8 Scan Theory
Next, the processor scans the program statement by statement: 1.
For each condition, the processor checks, or “reads,” the image table to see if the condition has been met.
2.
If the set of conditions has been met, the processor writes a one into the bit location in the output image table corresponding to the output terminal to be energized. On the other hand, if the set of conditions has not been met, the processor writes a zero into that bit location, indicating that the output terminal should not be energized.
Important: When your processor is in the Remote Test mode, all outputs are held off. When your processor is in the Run/Program mode, all outputs are controlled by the user program.
Average Scan Time
Average scan time is the average amount of time it takes the processor to monitor and update input and outputs, and to execute instructions in the program. The scan is performed serially; first the I/O image table is updated, other parts of the data table are not scanned, then the user program is scanned. There are two ways to measure average scan time: Append the rungs in Figure 8.2 to your program. Figure 8.2 Average Scan Time Rung 1
Rung 2
031
Rung 3
14
031 14 031
032 G 000
Store 1 G 010
Rung 4
Rung 5
14 031 14
Rung 6
031 CTU PR 999 AC 000 031 CTU PR 999 AC 000 032 RTO 0.1 PR 999 AC 000 Store Store 2 3 : : 000 . 000 032 RTR PR 999 AC 000 032 RTR PR 999 AC 000
8-3
Page 122
Chapter 8 Scan Theory
Add the execution values for each instruction by using Table 8.A. The sum of these values added to the I/O scan time is the average scan time. Table 8.A These Are the Approximate Execution Time Per Scan (in average microseconds) and Words Per Scan for Each Instruction Instruction Instruction Name
Symbol
True average µ sec.
False average µ sec.
Words Per Instruction
These instructions are features of the Mini-PLC-2/02, Mini-PLC-2/16, and Mini-PLC-2/17 Examine On Examine Off Output Energize Output Latch Output Unlatch
-[ ]-[ / ]-( )-(L)-(U)-
7 10 5 10 8 10 7 10 7 10
6 10 5 10 8 10 6 10 6 10
1 1 1 1 1 1 1 1 1 1
Get Put Equal Less Than Get Byte Limit Test
-[G]-(PUT)-(=)-(<)-]B[-]L[-
15 10 12 10 12 10 14 10 11 10 13 10
7 13 10 13 10 14 10
1 1 1 1 1 1 1 1 1 1 1 1
Counter Reset Retentive Timer Reset Timer On-Delay Retentive Timer On-Delay Timer Off-Delay Up Counter Down Counter
-(CTR)-(RTR)-(TON)-(RTO)-(CTD)-(CTU)-(CTD)-
19 19 51 52 55 38 36
6 6 36 33 39 30 31
1 1 1 1 1 1 1
1 2 3 4 5 6 7 8 9 10 11
8-4 add 1 word per instruction when its address is 4008 or greater add 2 words per instruction when its address is 4008 or greater 1 word 999 words 1 bit 999 bits with 2 data values with 10 data values with 50 data values add 8 µs per instruction when its address is 4008 or greater add 16 µs per instruction when its address is 4008 or greater
Page 123
Chapter 8 Scan Theory
Table 8.A (continued) These Are the Approximate Execution Time Per Scan (in average microseconds) and Words Per Scan for Each Instruction Instruction Instruction Name
Symbol
True average µ sec.
False average µ sec.
Words Per Instruction
Add Subtract Multiply Divide Add Subtract Multiply Divide Square Root BCD to Binary Binary to BCD FIFO Load
-(+)-(-)-(x)-(x)-(:)-(:)EAF 01 EAF 02 EAF 03 EAF 04 EAF 05 EAF 13 EAF 14 EAF 28 EAF 29
9 10 8 10 18 11 20 11 30 30 30 30 30 31 31 116 116 117 117 55 55 56 55
1 1 1 1 2 2 2 2 3 3 3 3 3 3 3 3
FIFO Unload
29 10 32 10 201 11 184 9 247 252 915 1442 1007 228 192 409 3 8051 4 377 3 8051 4 222 5 534 6 234 5 482 6
Bit Shift Left Bit Shift Right
3 5 5
Examine Off Bit Shift Examine On Bit Shift Set Bit Shift Reset Bit Shift
EAF 18 EAF 19 EAF 16 EAF 17
58 60 61 61
18 18 20 20
3 3 3 3
Log 10 Sin X Cos X
EAF 30 EAF 35 EAF 36
807 538 538
30 30 30
3 3 3
1 2 3 4 5 6 7 8 9 10 11 add 1 word per instruction when its address is 4008 or greater add 2 words per instruction when its address is 4008 or greater 1 word 999 words 1 bit 999 bits with 2 data values with 10 data values with 50 data values add 8 µs per instruction when its address is 4008 or greater add 16 µs per instruction when its address is 4008 or greater
8-5
Page 124
Chapter 8 Scan Theory
Table 8.A (continued) These Are the Approximate Execution Time Per Scan (in average microseconds) and Words Per Scan for Each Instruction Instruction Instruction Name
Symbol
True average µ sec.
False average µ sec.
Words Per Instruction
10x Master Control Reset Zone Control Last State Branch Start Branch End End, Temporary End Subroutine Area Immediate Input Update Immediate Output Update
EAF 37 -(MCR)-(ZCL)-
685 7 12 8 8 11 * 62 67
30 7 8 6 10 8 13 9
3 1 1 1 1 1 1 1 1
Label Return Jump to Subroutine Jump Block Transfer Read Block Transfer Write Sequencer Output Sequence input Sequencer Load File-To-File Move Word-To-File Move File-To-Word Move
LBL -(RET)-(JSR)-(JMP)-
17 * * 34 54 54 343 418 283 291 153 153
0 9 10 52 52 72 36 69 60 49 49
1 1 1 1 2 2 5 5 4 5 4 4
T. END SBR -[I]-(IOT)-
SEQ 0 SEQ 1 SEQ 2 FILE 10 FILE 11 FILE 12
* = combined execution time - 79 µs 1 add 1 word per instruction when its address is 4008 or greater 2 add 2 words per instruction when its address is 4008 or greater 3 1 word 4 999 words 5 1 bit 6 999 bits 7 with 2 data values 8 with 10 data values 9 with 50 data values 10 add 8 µs per instruction when its address is 4008 or greater 11 add 16 µs per instruction when its address is 4008 or greater
8-6
Page 125
Chapter 8 Scan Theory
Table 8.A (continued) These Are the Approximate Execution Time Per Scan (in average microseconds) and Words Per Scan for Each Instruction Instruction Instruction Name
Symbol
True average µ sec.
False average µ sec.
Words Per Instruction
These EAF instructions are features of the Mini-PLC-2/17 only. Set Clock Set Date Set Leap Year and Day of Week Read Clock Read Date Read Leap Year and Day of Week PID
EAF 10 EAF 11 EAF 12
217 225 167
30 30 31
3 3 3
EAF 15 EAF 16 EAF 17
203 205 138
30 30 31
3 3 3
EAF 27
2450 (typical) 3500 (max.)
118
3
Loge Powers of e (e+/-x) Powers of Y (y+/-x) Reciprocal (1/x) Average (3-digit
EAF 31 EAF 32 EAF 33 EAF 34 EAF 06
30 30 30 30 101 101
3 3 3 3 3
Average (6-digit)
EAF 06
Standard Deviation (3-digit)
EAF 07
Standard Deviation (6-digit)
EAF 07
1727 2071 1500 1620 2463 7 6787 8 2784 9 2103 7 3374 8 10038 9 4260 7 34430 8 162384 9 13532 7 23322 8 70746 9
1 2 3 4 5 6 7 8 9 10 11
98 98 98 119 119 119 101 101 101
3 3 3 add 1 word per instruction when its address is 4008 or greater add 2 words per instruction when its address is 4008 or greater 1 word 999 words 1 bit 999 bits with 2 data values with 10 data values with 50 data values add 8 µs per instruction when its address is 4008 or greater add 16 µs per instruction when its address is 4008 or greater
8-7
Page 126
Chapter 8 Scan Theory
Here is an explanation of the rungs in Figure 8.2: Rung 1 - The count increments its accumulated value each time this rung is true. Rung 2 - This rung enables the counter to increment on the next scan. If we did not have this rung, the counter would always be true and it would not increment. Remember: Counters increment only on false to true transitions. Rung 3 - The timer times in tenths of seconds when we are counting. This value is displayed on the industrial terminal screen. Rung 4 - The average scan time is displayed beneath store 2 and store 3 in milliseconds. Replace store 1 using Editing a Get Instruction in a Completed Rung, chapter 12. Replace store 2 and store 3 instructions. Refer to three-digit math in chapter 13. Rung 5 - The counter overflow bit is re-setting the timer. Rung 6 - The counter overflow bit is resetting the counter.
8-8