The text of a manual · part 13 of 60
DL205 PLC User Manual, Volume 1 of 2, pages 121 to 130
Pages 121 to 130 of 598
The original document is the PDF (12 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 AutomationDirect D2-04TD1, AutomationDirect D2-08TD2, AutomationDirect D2-16ND3-2, AutomationDirect D2-32ND3, Konnect-It D2-04TD1, Koyo D2-04TD1, Konnect-It D2-08TD2, Koyo D2-08TD2, and 5 more models
Page 121
Chapter 3: CPU Specifications and Operations
Solve Application Program
1 2 3 4 5 6 7 The internal control relays (C), the stages (S), and the 8 variable memory (V) are also updated in this segment. You may recall the CPU may have obtained and stored forcing information when it serviced 9 the peripheral devices. If any I/O points or memory data have been forced, the output image register also contains this information. 10 NOTE: If an output point was used in the application program, the results of the program solution will overwrite any forcing information that was stored. For example, if Y0 was forced on by the programming 11 device, and a rung containing Y0 was evaluated such that Y0 should be turned off, then the output image register will show that Y0 should be off. Of course, you can force output points that are not used in the application program. In this case, the point remains forced because there is no solution that results from 12 the application program execution. 13 Solve PID Loop Equations The DL260 CPU can process up to 16 PID loops and the DL250–1 can process up to 4 PID loops. The loop calculations are run as a separate task from the ladder program execution, 14 immediately following it. Only loops that have been configured are calculated, and then only according to a built-in loop scheduler. The sample time (calculation interval) of each loop is A programmable. Please refer to Chapter 8, PID Loop Operation, for more on the effects of PID loop calculation on the overall CPU scan time. B Write Outputs Once the application program has solved the instruction logic and constructed the output C image register, the CPU writes the contents of the output image register to the corresponding output points located in the local CPU base or the local expansion bases. Remember, the CPU D also made sure any forcing operation changes were stored in the output image register, so the The CPU evaluates each instruction in the application program during this segment of the scan cycle. The instructions define the relationship between input conditions and the system outputs. The CPU begins with the first rung of the ladder program, evaluating it from left to right and from top to bottom. It continues, rung by rung, until it encounters the END coil instruction. At that point, a new image for the outputs is complete. X0
X1
Y0 OUT
C0
Read Inputs from Specialty I/O Service Peripherals, Force I/O CPU Bus Communication
Update Clock, Special Relays
Solve the Application Program
Solve PID equations (DL250-1/DL260)
C100 X5
Read Inputs
LD
X10
K10
Write Outputs
Y3 OUT END
Write Outputs to Specialty I/O Diagnostics
230 240
250-1 260 forced points get updated with the status specified earlier.
DL205 User Manual, 4th Edition, Rev. D
3-25
Page 122
Chapter 3: CPU Specifications and Operations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3-26
Write Outputs to Specialty and Remote I/O After the CPU updates the outputs in the local and expansion bases, it sends the output point information that is required by any Specialty modules that are installed. For example, this is the portion of the scan that writes the output status from the image register to the Remote I/O racks. NOTE: It may appear the Remote I/O point status is updated every scan. This is not quite true. The CPU will send the information to the Remote I/O Master module every scan, but the Remote Master will update the actual remote modules during the next communication sequence between the master and slave modules. Remember, the Remote I/O link communication is managed by the Remote Master, not the CPU.
Diagnostics During this part of the scan, the CPU performs all system diagnostics and other tasks, such as: • calculating the scan time • updating special relays
Read Inputs Read Inputs from Specialty I/O Service Peripherals, Force I/O
• resetting the watchdog timer CPU Bus Communication DL205 CPUs automatically detect and report many different error conditions. Appendix B contains a listing of the various error codes Update Clock, Special Relays available with the DL205 system. Solve the Application Program One of the more important diagnostic tasks is the scan time calculation and watchdog timer Solve PID Loop Equations control. DL205 CPUs have a “watchdog” timer that stores the maximum time allowed for the CPU to complete the solve application segment Write Outputs of the scan cycle. The default value set from the factory is 200ms. If this time is exceeded the CPU Write Outputs to Specialty I/O will enter the Program Mode, turn off all outputs, and report the error. For example, the Handheld Diagnostics Programmer displays “E003 S/W TIMEOUT” when the scan overrun occurs. You can use AUX 53 to view the minimum, maximum, and current scan time. Use AUX 55 to increase or decrease the watchdog timer value. There is also an RSTWT instruction that can be used in the application program to reset the watch dog timer during the CPU scan.
DL205 User Manual, 4th Edition, Rev. D
Page 123
Chapter 3: CPU Specifications and Operations
I/O Response Time
1 I/O response time is the amount of time required for the control system to sense a change in an input point and update a corresponding output point. In the majority of applications, the 2 CPU performs this task practically instantaneously. However, some applications do require extremely fast update times. Four things can affect the I/O response time: 3 • The point in the scan period when the field input changes states • Input module Off to On delay time 4 • CPU scan time • Output module Off to On delay time 5 Normal Minimum I/O Response 6 The I/O response time is shortest when the module senses the input change before the Read Inputs portion of the execution cycle. In this case the input status is read, the application program is solved, and the output point gets updated. The following diagram shows an 7 example of the timing for this situation. 8 9 10 11 12 13 14 In this case, you can calculate the response time by simply adding the following items: A Input Delay + Scan Time + Output Delay = Response Time B Normal Maximum I/O Response The I/O response time is longest when the module senses the input change after the Read Inputs portion of the execution cycle. In this case the new input status does not get read until C the following scan. The following diagram shows an example of the timing for this situation. In this case, you can calculate the response time by simply adding the following items: D Input Delay +(2 x Scan Time) + Output Delay = Response Time Is Timing Important for Your Application?
Scan
Scan
Solve Program
Solve Program
Read Inputs
Solve Program
Solve Program
Write Outputs
Field Input
Input Module Off/On Delay
CPU Reads Inputs
CPU Writes Outputs
Output Module Off/On Delay
I/O Response Time
DL205 User Manual, 4th Edition, Rev. D
3-27
Page 124
Chapter 3: CPU Specifications and Operations Scan
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Solve Program
Solve Program
Scan
Read Inputs
Solve Program
Solve Program
Write Outputs
Field Input CPU Reads Inputs
Input Module Off/On Delay
CPU Writes Outputs
Output Module Off/On Delay I/O Response Time
Improving Response Time You can do a few things to help improve throughput. • Choose instructions with faster execution times • immediate I/O instructions (which update the I/O points during the ladder program execution segment) • Choose modules that have faster response times Immediate I/O instructions are probably the most useful technique. The following example shows immediate input and output instructions and their effect. Scan Solve Program
Scan
Normal Read Input
Solve Program Read Input Immediate
Solve Program Write Output Immediate
Solve Program
Normal Write Outputs
Field Input Input Module Off/On Delay Output Module Off/On Delay
3-28
I/O Response Time
In this case, you can calculate the response time by simply adding the following items: Input Delay + Instruction Execution Time + Output Delay = Response Time
The instruction execution time is calculated by adding the time for the immediate input instruction, the immediate output instruction, and all instructions in between. NOTE: When the immediate instruction reads the current status from a module, it uses the results to solve that one instruction without updating the image register. Therefore, any regular instructions that follow will still use image register values. Any immediate instructions that follow will access the module again to update the status.
DL205 User Manual, 4th Edition, Rev. D
Page 125
Chapter 3: CPU Specifications and Operations
CPU Scan Time Considerations The scan time covers all the cyclical tasks that the operating system performs. You can use DirectSOFT or the Handheld Programmer to display the minimum, maximum, and current scan times that have occurred since the previous Program Mode to Run Mode transition. This information can be very important when evaluating system performance. As shown previously, there are several segments that make up the scan cycle. Each of these segments requires a certain amount of time to complete. Of all the segments, the only one you really have the most control over is the amount of time it takes to execute the application program. This is because different instructions take different amounts of time to execute. So, if you think you need a faster scan, then you can try to choose faster instructions. Your choice of I/O modules and system configuration, such as expansion or remote I/O, can also affect the scan time; however, the application usually dictates them. For example, if you need to count pulses at high rates of speed, then you will probably have to use a High-Speed Counter module. Also, if you have I/O points that need to be located several hundred feet from the CPU, then you need remote I/O because it is much faster and cheaper to install a single remote I/O cable than it is to run all those signal wires for each individual I/O point. The following paragraphs provide some general information on how much time some of the segments can require.
Power up
Initialize hardware Check I/O module config. and verify Initialize various memory based on retentive configuration
Update input Read input data from Specialty and Remote I/O Service peripheral
CPU Bus Communication
Update Clock / Calendar
PGM
Mode? RUN Execute ladder program
PID Equations (DL250-1/DL260)
Update output Write output data to Specialty and Remote I/O
Do diagnostics
OK OK?
YES
NO Report the error, set flag, register, turn on LED
Fatal error
NO
YES Force CPU into PGM mode
DL205 User Manual, 4th Edition, Rev. D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3-29
Page 126
Chapter 3: CPU Specifications and Operations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Initialization Process The CPU performs an initialization task once the system power is on. The initialization task is performed once at power up, so it does not affect the scan time for the application program.
Reading Inputs Initialization Minimum Time Maximum Time
DL230
DL240
1.6 Seconds 3.6 Seconds
1.0 Seconds 2.0 Seconds
DL250–1
DL260
1.2 Seconds 2.7 Seconds(w/ 2 exp. bases)
1.2 Seconds 3.7 Seconds (w/ 4 exp. bases)
The time required to read the input status for the input modules depends on which CPU you are using and the number of input points in the base. The following table shows typical update times required by the CPU. For example, the time required for a DL240 to read two 8-point input modules would be Timing Factors Overhead Per input point
3-30
DL230 64.0 µs 6.0 µs
DL240 32.0 µs 12.3 µs
DL250–1 12.6 µs 2.5 µs
DL260 12.6 µs 2.5 µs calculated as follows, where NI is the total number of input points: Formula Time = 32µs + (12.3 x NI) Example Time = 32µs + (12.3 x 16) Time = 228.8 µs NOTE: This information provides the amount of time the CPU spends reading the input status from the modules. Don’t confuse this with the I/O response time that was discussed earlier.
DL205 User Manual, 4th Edition, Rev. D
Page 127
Chapter 3: CPU Specifications and Operations
Reading Inputs from Specialty I/O
1 • Specialty Modules (such as High-Speed Counter, etc) 2 The time required to read any input status from these modules depends on which CPU you are using, the number of modules, and the number of input points. 3 Remote Module DL230 DL240 DL250–1 DL260 Overhead 4 Per module (with inputs) Per input point 5 For example, the time required for a DL240 to read two 8-point input modules (located in a Remote base) would be calculated as follows, where NM is the number of modules and NI is 6 the total number of input points: 7 Remote I/O Formula 8 Time = 6µs + (67µs x NM) + (40µs x NI) Example 9 Time = 6µs + (67µs x 2) + (40µs x 16) Time = 780µs 10 Service Peripherals Communication requests can occur at any time during the scan, but the CPU only “logs” the 11 requests for service until the Service Peripherals portion of the scan. The CPU does not spend any time on this if there are no peripherals connected. 12 To Log Request (anytime) DL230 DL240 DL250–1 DL260 13 Nothing Connected 14 Port 1 A Port 2 B C D During this portion of the cycle the CPU reads any input points associated with the following: • Remote I/O
N/A N/A N/A
6.0 µs 67.0 µs 40.0 µs
1.82 µs 17.9 µs 2.0 µs
1.82 µs 17.9 µs 2.0 µs
Min. & Max.
0 µs
0 µs
0 µs
0 µs
Send Min. / Max. Rec. Min. / Max. Send Min. / Max. Rec. Min. / Max.
22/28 µs 24/58 µs N/A N/A
23/26 µs 52/70 µs 26/30 µs 60/75 µs
3.2/9.2 µs 25.0/35.0 µs 3.6/11.5 µs 35.0/44.0 µs
3.2/9.2 µs 25.0/35.0 µs 3.6/11.5 µs 35.0/44.0 µs
DL205 User Manual, 4th Edition, Rev. D
3-31
Page 128
Chapter 3: CPU Specifications and Operations During the Service Peripherals portion of the scan, the CPU analyzes the communications request and responds as appropriate. The amount of time required to service the peripherals depends on the content of the request.
1 To Service Request DL230 DL240 DL250–1 DL260 2 Minimum Run Mode Max. 3 Program Mode Max. CPU Bus Communication 4 Some specialty modules can also communicate directly with the CPU via the CPU bus. During this portion of the cycle the CPU completes any CPU bus communications. The actual time 5 required depends on the type of modules installed and the type of request being processed. NOTE: Some specialty modules can have a considerable impact on the CPU scan time. If timing is critical in 6 your application, consult the module documentation for any information concerning the impact on the scan time. 7 Update Clock/Calendar, Special Relays, Special Registers The clock, calendar, and special relays are updated and loaded into special V-memory locations 8 during this time. This update is performed during both Run and Program Modes. 9 Modes DL230 DL240 DL250–1 DL260 10 Program Mode Run Mode 11 Writing Outputs 12 The time required to write the output status for the local and expansion I/O modules depends on which CPU you are using and the number of output points in the base. The following table 13 shows typical update times required by the CPU. Timing Factors DL230 DL240 DL250–1 DL260 14 Overhead Per output point A For example, the time required for a DL240 to write data for two 8-point output modules B would be calculated as follows (where NO is the total number of output points): Formula C Time = 33 + (NO x 14.6 µs) Example D Time = 33 + (16 x 14.6 µs) 260µs 30ms 3.5 Seconds
Minimum Maximum Minimum Maximum
66.0 µs 8.5 µs
250µs 20ms 4 Seconds
8.0 µs fixed 8.0 µs fixed 20.0 µs 26.0 µs
8µs 410µs 2 Seconds
35.0 µs 48.0 µs 60.0 µs 85.0 µs
33.0 µs 14.6 µs
Time = 266.6 µs
3-32
DL205 User Manual, 4th Edition, Rev. D
11.0 µs 11.0 µs 19.0 µs 26.0 µs
28.1 µs 3.0 µs
8µs 410µs 3.7 Seconds
11.0 µs 11.0 µs 19.0 µs 26.0 µs
28.1 µs 3.0 µs
Page 129
Chapter 3: CPU Specifications and Operations
Writing Outputs to Specialty I/O
1 • Specialty Modules (such as High-Speed Counter, etc) 2 The time required to write any output image register data to these modules depends on which CPU you are using, the number of modules, and the number of output points. 3 Remote Module DL230 DL240 DL250–1 DL260 Overhead 4 Per module (with outputs) Per output point 5 For example, the time required for a DL240 to write two 8-point output modules (located in a Remote base) would be calculated as follows, where NM is the number of modules and NO 6 is the total number of output points: 7 Remote I/O Formula 8 Time = 6µs + (67.5 µs x NM) + (46µs x NO) Example 9 Time = 6µs + (67.5 µs x 2) + (46µs x 16) Time = 877µs 10 NOTE: This total time is the actual time required for the CPU to update these outputs. This does not include any additional time that is required for the CPU to actually service the particular specialty modules. 11 Diagnostics 12 The DL205 CPUs perform many types of system diagnostics. The amount of time required depends on many things, such as the number of I/O modules installed, etc. The following 13 table shows the minimum and maximum times that can be expected. Diagnostic Time DL230 DL240 DL250–1 DL260 14 Minimum Maximum A B C D During this portion of the cycle the CPU writes any output points associated with the following. • Remote I/O
N/A N/A N/A
600.0 µs 900.0 µs
6.0 µs 67.5 µs 46.0 µs
422.0 µs 855.0 µs
1.9 µs 17.7 µs 3.2 µs
26.8 µs 103.0 µs
1.9 µs 17.7 µs 3.2 µs
26.8 µs 103.0 µs
DL205 User Manual, 4th Edition, Rev. D
3-33
Page 130
Chapter 3: CPU Specifications and Operations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 3-34
Application Program Execution The CPU processes the program from the top (address 0) to the END instruction. The CPU executes the program left to right and top to bottom. As each rung is evaluated, the appropriate image register or memory location is updated. The time required to solve the application program depends on the type and number of instructions used and the amount of execution overhead. You can add the execution times for all the instructions in your program to find the total program execution time. For example, the execution time for a DL240 running the program shown would be calculated as follows: Instruction
Time
STR X0 OR C0 ANDN X1 OUT Y0 STRN C100 LD K10 STRN C101 OUT V2002 STRN C102 LD K50 STRN C103 OUT V2006 STR X5 ANDN X10 OUT Y3 END
1.4µs 1.0µs 1.2µs 7.95µs 1.6µs 62.0µs 1.6µs 21.0µs 1.6µs 62.0µs 1.6µs 21.0µs 1.4µs 1.2µs 7.95µs 16.0µs
TOTAL
210.5µs
X0
X1
Y0 OUT
C0
C100
LD
C101
OUT
C102
LD
C103
X5
OUT
X10
K10 V2002
K50 V2006
Y3 OUT
END
Appendix C provides a complete list of instruction execution times for DL205 CPUs. Program Control Instructions, the DL240, DL250–1 and DL260 CPUs offer additional instructions that can change the way the program executes. These instructions include FOR/ NEXT loops, Subroutines, and Interrupt Routines. These instructions can interrupt the normal program flow and affect the program execution time. Chapter 5 provides detailed information on how these different types of instructions operate.
DL205 User Manual, 4th Edition, Rev. D