Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 45 of 68

Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual: SECTION 6 Program Execution Timing, pages 410 to 417

Pages 410 to 417 of 613, from Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual

The original document is the PDF (3.8 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.

Filed in the catalog under the Omron C200H-SP001 and Omron C200HW-PA204

Page 410

SECTION 6 Program Execution Timing The timing of various operations must be considered both when writing and debugging a program. The time required to execute the program and perform other CPU Unit operations is important, as is the timing of each signal coming into and leaving the PC in order to achieve the desired control action at the right time. This section explains the cycle and shows how to calculate the cycle time and I/O response times. 6-1 6-2

6-3 6-4

Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculating Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2-1 PC with I/O Units Only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2-2 PC with Host Link and Remote I/O Master Units . . . . . . . . . . . . . . . . . . . . . . . . . Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4-1 Basic Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4-2 Remote I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4-3 Host Link Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4-4 PC Link Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4-5 One-to-one Link I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4-6 Interrupt Response Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

400 404 405 405 407 418 418 419 422 422 425 427

399

Page 411

Cycle Time

6-1

Section

6-1

Cycle Time To aid in PC operation, the average, maximum, and minimum cycle times can be displayed on the Programming Console or any other Programming Device and the maximum cycle time and current cycle time values are held in AR 26 and AR 27. Understanding the operations that occur during the cycle and the elements that affect cycle time is, however, essential to effective programming and PC operations. The major factors in determining program timing are the cycle time and the I/O response time. One run through all required CPU Unit operations is called a cycle; the time required for each cycle is called the cycle time. The overall flow of the CPU Unit operation is as shown in the following flowchart.

400

Page 412

Section

Cycle Time

6-1

Flowchart of CPU Unit Operation

Power application

Clears IR area and resets all timers

Initialization on power-up

Checks I/O Unit connections

Resets watchdog timer

Checks hardware and Program Memory

NO

Overseeing processes

Check OK?

YES Resets watchdog timer and program address counter

Sets error flags and turns ON or flashes indicator

ERROR (Solid ON)

Program execution

Executes user program

ALARM/ERROR ALARM (Flashing)

End of program?

Note A minimum cycle time can be set either in DM 6619 of the PC Setup or by executing SCAN(018).

NO

YES Minimum cycle time?

NO

YES

Resets watchdog timer and waits until the set cycle time has elapsed

Cycle time calculation

PC cycle time

Calculates cycle time

Resets watchdog timer

Refreshes input bits and output signals

I/O refreshing

Services RS-232C port

RS-232C port servicing

Services Host Link

Host Link Unit servicing

Services Programming Devices

Programming Device servicing

Services Communications Board

Services Communications Board

Services SYSMAC LINK and SYSMAC NET Link Units

SYSMAC LINK and SYSMAC NET Link Unit servicing

401

Page 413

Section

Cycle Time

6-1

The first three operations immediately after power application are performed only once each time the PC is turned ON. The rest of the operations are performed in cyclic fashion. The cycle time is the time that is required for the CPU Unit to complete one of these cycles. This cycle includes basically 9 types of operation: Overseeing, Program execution, Cycle time calculation, I/O refreshing, Host Link Unit servicing, RS-232C port servicing, Programming Device servicing, Communications Board servicing, and SYSMAC NET/SYSMAC LINK servicing. The cycle time is the total time required for the PC to perform all 9 of these operations. The time required for operation 3, cycle time calculation, is negligible and can be ignored in actual calculations. Operation 1. Overseeing 2. Program execution

3. Cycle time calculation

4. I/O refreshing

Time required 0.7 ms (2.1 ms in the C200HE-CPU11-ZE)

Function Watchdog timer reset. I/O Bus, Program Memory checked. Clock refreshed. Total execution time for all instructions varies Program executed. with program size, the instructions used, and execution conditions. Refer to 6-3 Instruction Execution Times for details. Negligible, but a wait can be generated to Cycle time calculated. When the CYCLE bring the cycle time up to the minimum setTIME instruction (SCAN(018)) is exting if one has been made. ecuted, waits until the set time has elapsed and then resets the watchdog timer. Total of following times: 20 µs per input byte (8 points). 20 µs per output byte (8 points). (12-point Output Units calculated as 16 points.)

Input bits set according to status of input signals. Output signals sent according to status of output bits in memory.

PC Link Unit I/O refresh time.

Inputs and Outputs in Remote I/O Systems refreshed.

Special I/O Unit refresh time.

Special I/O Units serviced.

1.1 ms per Remote I/O Master Unit + 0.17 ms per I/O word used on Slave Racks.

Group-2 High-density I/O Units serviced.

Group-2 (High-density) I/O Unit refresh time. Refer to the tables below for details on PC Link, Special I/O Unit, and Group-2 Highdensity I/O Unit refresh times. 5. Host Link Unit servicing

6 ms per Unit max.

Commands from computers connected through Rack-mounting Host Link Units processed.

6. RS-232C port servicing

0 ms when no device is connected.

Communications with devices connected to RS-232C port processed.

7. Programming Device servicing 8. Communications Board servicing

9. SYSMAC NET Link/ SYSMAC LINK servicing PC card servicing

402

0.26 ms minimum or T × 0.05, where T is the cycle time calculated in operation 3 0 ms when no device is connected. 0.26 ms minimum or T × 0.05, where T is the cycle time calculated in operation 3 0.5 ms + processing time per port. The processing time per port is as follows: 0.26 ms minimum or T × 0.05, where T is the cycle time calculated in operation 3 0 ms when no Communications Unit is mounted. For or 0.8 ms + 15 ms max. per Unit. For 3.5 ms max. per Unit. For C200HW-PCU01/PCS01: 6 ms max.

Commands from Programming Devices (computers, Programming Consoles, etc.) processed. Commands from the Communications Board (RS-232C, RS-422, or RS-485) are processed. Commands from computers and other devices connected to SYSMAC NET Link/ SYSMAC LINK/PC Card Units processed.

Page 414

Section

Cycle Time PC Link Unit I/O Refresh

I/O pts to refresh

6-1

Time required (ms)

Special I/O Unit Refresh

512

7.4

256

4.1

128

2.7

64

1.7

Unit C200H-ID501/215 C200H-OD501/215 C200H-MD501/215 C200H-CT001-V1/CT002 C200H-CT021 C200H-NC111/NC112 C200HW-NC113 C200H-NC211 C200HW-NC213 C200HW-NC413 C200H-MC221 C200H-AD001 C200H-DA001 C200H-TS001/TS101 C200H-ASC02 C200H-IDS01-V1/IDS21 C200H-OV001 C200H-FZ001

C200H-CP114 C200H-AD002

C200H-DA002 C200HW-SRM21 C200HW-DRM21-V1 C200HW-DRT21

Time required per Unit 0.6 ms 0.6 ms when set for 32 I/O pts. 1.6 ms when set for dynamic I/O 2.0 ms 0.7 ms 2.1 ms 2.6 ms 5.0 ms 2.9 ms 4.5 ms 2 ms for normal operation 3 ms for refreshing expansion data area 1.1 ms 0.9 ms 1.2 ms 1.9 ms normally, 5.0 ms for @ format 2.0 ms normally, 5.5 ms for command transfer 3.3 ms 2.0 ms 2.7 ms 2.0 ms 1.4 ms 2.7 ms 1.0 ms 0.44 ms when the max. number of Slaves is 16. 0.88 ms when the max. number of Slaves is 32.1.72 ms + 0.022 × the number of words

Group-2 High-density I/O Unit Refresh

Unit C200H-ID216 C200H-OD218 C200H-ID217 C200H-OD219

NT Links

If the PC is connected to a Programmable Terminal (PT) via a C200HX/HG/HE Interface Unit, the times shown in the following table will be required to refresh I/O for the PT.

Time required per Unit 0.18 ms 0.14 ms 0.31 ms 0.23 ms

Number of table entries for PT

Watchdog Timer and Long Cycle Times

I/O refresh time

Minimum setting: Character string table: 0 Numeral table: 0

2.5 ms

Maximum setting: Character string table: 32 Numeral table: 128

5.4 ms

Within the PC, the watchdog timer measures the cycle time and compares it to a set value. If the cycle time exceeds the set value of the watchdog timer, a FALS

403

Page 415

Section

Calculating Cycle Time

6-2

9F error is generated and the CPU Unit stops. WDT(094) can be used to extend the set value for the watchdog timer. Even if the cycle time does not exceed the set value of the watchdog timer, a long cycle time can adversely affect the accuracy of system operations as shown in the following table. Cycle time (ms) 10 or greater 20 or greater 100 or greater 200 or greater 6,500 or greater

Online Editing

0.1-second clock pulse (SR 25500) not accurately readable and Cycle Time Error Flag (SR 25309) turns ON. 0.2-second clock pulse (SR 25501) not accurately readable. FALS code 9F generated regardless of watchdog timer setting and the system stops.

When online editing is executed from a Programming Device, interrupts will be masked and operation will be interrupted for a maximum of 160 ms for the C200H-CPU85-EZ/CPU65-EZ CPU Units and 80 ms for other CPU Units to rewrite the user program. No warnings will be given for long cycle times during this interval. Check the effects on I/O response time before editing the program online. When bits 00 to 07 of AR 25 contain the password code of “5A,” online editing will be disabled and the CPU Unit will be in standby status while the Online Edit Disable Bit (AR 2509) is ON. The Online Edit Standby Flag (AR 2510) will be ON while the CPU Unit is in standby status. Processing will be executed when AR 2509 is turned OFF. (AR 2510 will be turned OFF, too.) ! Caution

6-2

Possible adverse affects TIMH(015) inaccurate when TC 016 through TC 511 are used. (Accuracy when using TC 000 through TC 0015 not affected.) 0.02-second clock pulse (SR 25401) not accurately readable.

Editing the program online can cause delays in I/O responses with no warnings being given from the system for the long cycle time produced by editing online. Before editing online, make sure that delays in I/O responses will not create a dangerous situation in the controlled system.

Calculating Cycle Time The PC configuration, the program, and program execution conditions must be taken into consideration when calculating the cycle time. This means taking into account such things as the number of I/O points, the programming instructions used, and whether or not Programming Devices are employed. This section shows some basic cycle time calculation examples. To simplify the examples, the instructions used in the programs have been assumed to be all either LD or OUT. The average execution time for the instructions is thus 0.156 µs. (Execution times are given in the table in 6-3 Instruction Execution Times.)

404

Page 416

Section

Calculating Cycle Time

6-2

6-2-1 PC with I/O Units Only Here, we’ll compute the cycle time for a simple PC. The CPU Unit controls only I/O Units, eight on the CPU Rack and five on a 5-slot Expansion I/O Rack. The PC configuration for this would be as shown below. It is assumed that the program contains 5,000 instructions requiring an average of 0.156 µs each to execute. 8-point Input Units

8-point Output Units

CPU Rack

Expansion I/O Rack

16-point Input Units

12-point Output Units

8-point Output Unit

Calculations

The equation for the cycle time from above is as follows: Cycle time =

Overseeing time + Program execution time + I/O refresh time + Programming Device servicing time

Process

Calculation

With Programming Device

Without Programming Device

Overseeing

Fixed

0.7 ms

0.7 ms

Program execution

0.156 µs/instruction × 5,000 instructions See below.

0.78 ms

0.78 ms

0.34 ms

0.34 ms

Minimum time

0.26 ms

0.0 ms

Total of above

2.08 ms

1.82 ms

I/O refresh Programming Device servicing Cycle time

The I/O refresh time would be as follows for two16-point Input Units, four 8-point Input Units, two 12-point Output Units (12-point Units are treated as 16-point Units), and five 8-point Output Units controlled by the PC: (16 pts × 2) + (8 pts × 4) 8 pts

× 20 µs +

(16 pts × 2) + (8 pts × 5) 8 pts

× 20 µs = 0.34 ms

6-2-2 PC with Host Link and Remote I/O Master Units Here, the cycle time is computed for a PC with a Host Link Unit and Remote I/O Master Unit installed. The PC configuration for this could be as shown below. The CPU Unit controls three 8-point Input Units, three 8-point Output Units, a Host Link Unit, and a Remote I/O Master Unit connected to a Remote I/O Slave Rack containing four 16-point Input Units and four 12-point Output Units.

405

Page 417

Section

Calculating Cycle Time

6-2

It is assumed that the program contains 5,000 instructions requiring an average of 0.156 µs each to execute, and that nothing is connected to the RS-232C port and no SYSMAC NET/SYSMAC LINK Unit is mounted.

Host Link Unit Remote I/O Master Unit

8-point Input Units

8-point Output Units

CPU Rack

Computer

Slave Rack

16-point Input Units

Calculations

12-point Output Units

The equation for the cycle time is as follows: Cycle time =

Overseeing time + Program execution time + I/O refreshing time + Host Link Unit servicing time + Programming Device servicing time

Process

Calculation

With Programming Device

Without Programming Device

Overseeing

Fixed

0.7 ms

0.7 ms

Program execution

0.78 ms

0.78 ms

I/O refresh

0.156 µs/instruction × 5,000 instructions See below.

2.58 ms

2.58 ms

Host Link servicing

Fixed

6.0 ms

6.0 ms

Programming Device servicing

0.7 + 0.78 + 2.58 + 6 = 10.06

0.50 ms

0.0 ms

Cycle time

10.06 × 0.05 = 0.50 Total of above

10.56 ms

10.06 ms

The I/O refreshing time would be as follows for three 8-point Input Units and three 8-point Output Units mounted in the CPU Rack, and eight Units mounted in a Slave Rack. (8 pts × 3) + (8 pts × 3) × 20 µs + 1.1 ms + 8 Units × 0.17 ms = 2.58 ms 8 pts

406