The text of a manual · part 44 of 60
SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual: SECTION 7 PC Operations and Processing Time, pages 398 to 406
Pages 398 to 406 of 520, from SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual
The original document is the PDF (2.1 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 Omron CQM1-CPU21
Page 398
SECTION 7 PC Operations and Processing Time This section explains the internal processing of the CQM1/CPM1/CPM1A/SRM1, and the time required for processing and execution. Refer to this section to gain an understanding of the precise timing of CQM1/CPM1/CPM1A/SRM1 operation. 7-1
7-2
7-3
CQM1 Cycle Time and I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1-1 The CQM1 Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1-2 CQM1 Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1-3 I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1-4 One-to-one Link I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1-5 Interrupt Processing Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1-6 CQM1 Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CPM1/CPM1A Cycle Time and I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2-1 The CPM1/CPM1A Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2-2 CPM1/CPM1A Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2-3 I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2-4 One-to-one Link I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2-5 Interrupt Processing Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2-6 CPM1/CPM1A Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . SRM1 Cycle Time and I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3-1 The SRM1 Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3-2 SRM1 Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3-3 I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3-4 One-to-one Link I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3-5 Interrupt Processing Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3-6 SRM1 Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
382 382 383 385 386 388 389 400 400 401 402 403 405 406 411 411 412 414 414 416 417
381
Page 399
Section
CQM1 Cycle Time and I/O Response Time
7-1
7-1
CQM1 Cycle Time and I/O Response Time
7-1-1 The CQM1 Cycle CQM1 Operation Flowchart
The overall flow of CQM1 operation is as shown in the following flowchart. Power application
Is DIP switch pin 2 set to ON?
OFF
ON Initialization
Transfer contents of Memory Cassette to CQM1.
Clear IR, SR, AR areas; preset system timers; and check I/O Units.
Check hardware and Program Memory. No
Check OK? Overseeing processes Yes
Set error flags and activate indicators. ERROR or ALARM? ERROR (lit)
Preset cycle time monitoring time. ALARM (flashing)
Execute user’s program. End of program?
No
Program execution
Yes Check cycle time setting. Minimum cycle time? Yes
Cycle time No Cycle time processing
Wait until minimum cycle time expires.
Compute cycle time.
382
Refresh input bits and output terminals.
I/O refreshing
Service RS-232C port.
Service RS-232C interface.
Service peripheral port.
Service peripheral port.
Page 400
Section
CQM1 Cycle Time and I/O Response Time
7-1
One cycle of CPU Unit operation is called a cycle. The time required for one cycle is called the cycle time. I/O Refresh Methods
Input/Output Input
Output
CQM1 I/O refresh operations are broadly divided into two categories. The first of these, input refresh, involves reading the ON/OFF status of input points to the input bits. The second, output refresh, involves writing the ON/OFF status after program execution to the output points. The CQM1 I/O refresh methods are as shown in the following table.
I/O refresh method
Function
Cyclic refresh Interrupt input refresh
Input refresh is executed at a set time once per cycle. Input refresh is executed before execution of the interrupt processing routine whenever an input interrupt, interval timer interrupt, or high-speed counter interrupt occurs. (The cyclic refresh is also executed.)
Cyclic refresh Direct refresh
Output refresh is executed at a set time once per cycle. When there is an output from the user’s program, that output point is immediately refreshed. (The cyclic refresh is also executed.)
The initial status of the CQM1 I/O refresh is as follows: Input: Only cyclic refresh executed. Output: Only cyclic refresh executed. Cyclic refresh must be executed for both inputs and outputs. If input refresh is to be executed at the time of interrupts, then set the input refresh range in the PC Setup (DM 6630 to DM 6638). Stopping direct refresh can be set in DM 6639 of the PC Setup. In addition to the methods described above, it is also possible to execute I/O refreshes in the program by means of IORF(97).
7-1-2 CQM1 Cycle Time The processes involved in a single CQM1 cycle are shown in the following table, and their respective processing times are explained. Process
Content
Time requirements
Setting cycle watchdog timer, I/O bus check, UM check, refreshing clock, refreshing bits allocated to new functions, etc.
0.8 ms (0.9 ms when a Memory Cassette equipped with a clock is mounted)
Program execution
User program is executed.
Total time for executing instructions. (Varies according to content of user’s program.)
Cycle time calculation
Standby until set time, when minimum cycle time is set in DM 6619 of PC Setup. Calculation of cycle time.
Almost instantaneous, except for standby processing.
I/O refresh
Input Unit’s input information is read to input bits. Output information (results of executing program) is written to Output Unit’s output bits.
Number of input words × 0.01 ms
RS-232C port servicing
Devices connected to RS-232C port serviced.
5% or less of cycle time (see note)
Peripheral port servicing
Devices connected to peripheral port serviced.
5% or less of cycle time (see note)
Overseeing
Add an additional 0.1 ms for the CPU Units.
Note The percentages can be changed in the PC Setup (DM 6616, DM 6617).
383
Page 401
Section
CQM1 Cycle Time and I/O Response Time Cycle Time and Operations
The effects of the cycle time on CQM1 operations are as shown below.
Cycle time 10 ms or longer 20 ms or longer 100 ms or longer 120 ms or longer 200 ms or longer
7-1
Operation conditions TIMH(15) may be inaccurate when TC 016 through TC 511 are used (operation will be normal for TC 000 through TC 015) (see note 1). Programming using the 0.02-second Clock Bit (SR 25401) may be inaccurate. Programming using the 0.1-second Clock Bit (SR 25500) may be inaccurate. A CYCLE TIME OVER error is generated (SR 25309 will turn ON) (see note 2). The FALS 9F monitoring time SV is exceeded. A system error (FALS 9F) is generated, and operation stops (see note 3). Programming using the 0.2-second Clock Bit (SR 25501) may be inaccurate.
Note
1. The number of timers to undergo interrupt processing can be set in DM 6629 of the PC Setup. The default setting is for TC 000 through TC 015. 2. The PC Setup (DM 6655) can be used to disable detection of CYCLE TIME OVER error. 3. The FALS 9F cycle monitoring time can be changed by means of the PC Setup (DM 6618).
Cycle Time Example
In this example, the cycle time is calculated for a CQM1 with 80 I/O points. The I/O is configured as follows: DC inputs: 48 points (3 words) Bit outputs: 32 points (2 words) The rest of the operating conditions are assumed to be as follows: User’s program:2,000 instructions (configured of LD and OUT instructions) Clock: None RS-232C port: Not used Cycle time: Variable (no minimum set) Note The average processing time for a single instruction in the user’s program is assumed to be 0.625 µs. The cycle times are as shown in the following table.
Process
Calculation method
Overseeing
Fixed
Time with peripheral device 0.8 ms
Program execution
0.625 × 2000 (µs)
1.25 ms
1.25 ms
Cycle time calculation
Negligible
0 ms
0 ms
I/O refresh
0.01 × 3 + 0.005 × 2 (µs)
0.04 ms
0.04 ms
RS-232C port servicing
Not used.
0 ms
0 ms
Peripheral port servicing
Minimum time
0.34 ms
0 ms
Cycle time
(1) + (2) + (3) + (4) + (5) + (6)
2.43 ms
2.09 ms
Note
Time without peripheral device 0.8 ms
1. The cycle time can be automatically read from the PC via a Peripheral Device. 2. The maximum and current cycle time are stored in AR 26 and AR 27. 3. The cycle time can vary with actual operating conditions and will not necessarily agree precisely with the calculated value. 4. The RS-232C and peripheral port service time will be 0.34 ms minimum, 87 ms maximum.
384
Page 402
Section
CQM1 Cycle Time and I/O Response Time
7-1
7-1-3 I/O Response Time The I/O response time is the time it takes after an input signal has been received (i.e., after an input bit has turned ON) for the PC to check and process the information and to output a control signal (i.e., to output the result of the processing to an output bit). The I/O response time varies according to the timing and processing conditions. The minimum and maximum I/O response times are shown here, using the following program as an example. Output Input
The following conditions are taken as examples for calculating the I/O response times. Input ON delay: Overseeing time: Instruction execution time: Output ON delay: Position of output instruction: Communications ports:
8 ms 1 ms 14 ms 10 ms Beginning of program Not used.
Note The input ON delay for DC Input Units can be set in the PC Setup. Minimum I/O Response Time The CQM1 responds most quickly when it receives an input signal just prior to the input refresh phase of the cycle, as shown in the illustration below. Input point
I/O refresh Input ON delay
Overseeing, etc.
Input bit Cycle time CPU processing
Instruction execution
Instruction execution With direct output refresh Output ON delay
With cyclic output refresh
Output point
When cyclic output refreshing is used: Minimum I/O response time = 8 + 15 + 10 = 33 ms When direct output refreshing is used: Minimum I/O response time = 8 + 1 + 10 = 19 ms Maximum I/O Response Time The CQM1 takes longest to respond when it receives the input signal just after the input refresh phase of the cycle, as shown in the illustration below. In that case, a delay of approximately one cycle will occur. Input point
I/O refresh Input ON delay
Overseeing, etc.
Input bit Cycle time CPU processing
Instruction execution
Instruction execution
With direct output refresh Output ON delay
Instruction execution With cyclic output refresh
Output point
385
Page 403
Section
CQM1 Cycle Time and I/O Response Time
7-1
When cyclic output refreshing is used: Minimum I/O response time = 8 + 15 × 2 + 10 = 48 ms When direct output refreshing is used: Minimum I/O response time = 8 + 15 + 10 = 33 ms
7-1-4 One-to-one Link I/O Response Time When two CQM1s are linked one-to-one, the I/O response time is the time required for an input executed at one of the CQM1s to be output to the other CQM1 by means of one-to-one link communications. One-to-one link communications are carried out reciprocally between the master and the slave. The respective transmission times are as shown below, depending on the number of LR words used. Number of words used
Transmission time
64 words (LR 00 to LR 63)
39 ms
32 words (LR 00 to LR 31)
20 ms
16 words (LR 00 to LR 15)
10 ms
The minimum and maximum I/O response times are shown here, using as an example the following instructions executed at the master and the slave. In this example, communications proceed from the master to the slave. Output (LR) Input
Input (LR)
Output
The following conditions are taken as examples for calculating the I/O response times. Input ON delay: 8 ms Master cycle time: 10 ms Slave cycle time: 14 ms Output ON delay: 10 ms Direct output: Not used. Number of LR words: 64 Note The input ON delay for DC Input Units can be set in the PC Setup. Minimum I/O Response Time The CQM1 responds most quickly under the following circumstances: 1, 2, 3...
386
1. The CQM1 receives an input signal just prior to the input refresh phase of the cycle. 2. The master to slave transmission begins immediately.
Page 404
Section
CQM1 Cycle Time and I/O Response Time
7-1
3. The slave executes communications servicing immediately after completion of communications.
Input point
I/O refresh Overseeing, communications, etc.
Input ON delay
Master Input bit Cycle time CPU processing
Instruction execution
Instruction execution
One-to-one link communications
Master to Slave Instruction execution
CPU processing Slave
Instruction execution Output ON delay
Output point
The minimum I/O response time is as follows:
+
Input ON delay: 8 ms Master cycle time: 10 ms Transmission time: 39 ms Slave cycle time: 15 ms Output ON delay: 10 ms Minimum I/O response time: 82 ms
Maximum I/O Response Time The CQM1 takes the longest to respond under the following circumstances: 1, 2, 3...
1. The CQM1 receives an input signal just after the input refresh phase of the cycle. 2. The master to slave transmission does not begin on time. 3. Communications are completed just after the slave executes communications servicing.
Input point
I/O refresh Input ON delay
Overseeing, communications, etc.
Master Input bit
Cycle time CPU processing
Instruction execution
One-to-one link communications
Instruction execution
Master to Slave
CPU processing
Instruction execution
Slave to Master
Master to Slave
Instruction execution
Instruction execution
Slave
Instruction execution Output ON delay
Output point
387
Page 405
Section
CQM1 Cycle Time and I/O Response Time
7-1
The maximum I/O response time is as follows:
+
Input ON delay: 8 ms Master cycle time: 10 ms × 2 Transmission time: 39 ms × 3 Slave cycle time: 15 ms × 2 Output ON delay: 10 ms Maximum I/O response time: 185 ms
7-1-5 Interrupt Processing Time This section explains the processing times involved from the time an interrupt is executed until the interrupt processing routine is called, and from the time an interrupt processing routine is completed until returning to the original position. The explanation applies to the following three types of interrupts: input interrupts, interval timer interrupts, and high-speed counter interrupts. Processing Time
The table below shows the times involved from the generation of an interrupt signal until the interrupt processing routine is called, and from when the interrupt processing routine is completed until returning to the original position.
Item
Contents
Interrupt input ON delay
This is the delay time from the time the interrupt input bit turns ON until the time that the interrupt is executed. This is unrelated to other interrupts.
Standby until completion of interrupt-mask processing
This is the time during which interrupts are waiting until processing has been completed. This situation occurs when a mask processes is executed. It is explained below in more detail.
Time 50 µs
↓ (Interrupt condition realized.) (see note) See below.
↓ 40 µs
Change-to-interrupt processing
This is the time it takes to change processing to an interrupt.
Input refresh at time of interrupt
This is the time required for input refresh when input refresh is set 10 µs per word to be executed at the time the interrupt processing routine is called. (Set in PC Setup, DM 6630 to DM 6638.)
Return
This is the time it takes, from execution of RET(93), to return to the processing that was interrupted.
↓
↓ (Interrupt processing routine executed)
Note
40 µs
1. When high-speed counter 0 is used with a range comparison table, the timing of interrupt processing can be affected by the cycle time. 2. When high-speed counters 1 and 2 are used with range comparison tables (in CQM1-43/44-EV1 CPU Units), the timing of interrupt processing can be delayed up to 1 ms. Mask Processing Interrupts are masked during processing of the operations described below. Until the processing is completed, any interrupts will remain masked for the indicated times. High-speed timers: The time shown below is required, depending on (a) the number of timers used with TIMH(15) and (b) the number of high-speed timers active at that time. (The number of high-speed timers is set in the PC Setup, DM 6629. The default setting is 16.) 0 ≤ Standby time ≤ 50 + 3 × (a + b) µs Up to 50 µs can be required even when no high-speed timers are used.
388
Page 406
Section
CQM1 Cycle Time and I/O Response Time
7-1
Generation and clearing of non-fatal errors: When a non-fatal error is generated and the error contents are registered at the CQM1, or when an error is being cleared, interrupts will be masked for a maximum of 100 µs until the processing has been completed. Online editing: Interrupts will be masked for a maximum of 1 second when online editing is executed during operation. Pulse output based on SPED(64) may also be affected by interrupt processing, thus causing output timing to vary. Example Calculation
This example shows the interrupt response time (i.e., the time from when the interrupt input turns ON until the start of the interrupt processing routine) when input interrupts are used under the conditions shown below. Number high-speed timers: 0 (No high-speed timers started) Online edit: Not used Input refresh at interrupt: No Minimum Response Time
+
Interrupt input ON delay: Interrupt mask standby time: Change-to-interrupt processing: Minimum response time:
50 µs 0 µs 40 µs 90 µs
Maximum Response Time
+
Interrupt input ON delay: Interrupt mask standby time: Change-to-interrupt processing: Minimum response time:
50 µs 50 µs 40 µs 140 µs
In addition to the response time shown above, the time required for executing the interrupt processing routine itself and a return time of 40 µs must also be accounted for when returning to the process that was interrupted. Be sure to allow for interrupt processing time when using interrupts in the program. Outputs from interrupt routines can be output immediately if direct output is used. Direct output will be used for both the main program and the interrupt routines, and cannot be set separately.
7-1-6 CQM1 Instruction Execution Times The following table lists the execution times for CQM1 instructions. The maximum and minimum execution times and the conditions which cause them are given where relevant. When “word” is referred to in the Conditions column, it implies the content of any word except for indirectly addressed DM words. Indirectly addressed DM words, which create longer execution times when used, are indicated by “DM.” Execution times for most instructions depend on whether they are executed with an ON or an OFF execution condition. Exceptions are the ladder diagram instructions OUT and OUT NOT, which require the same time regardless of the execution condition. The OFF execution time for an instruction can also vary depending on the circumstances, i.e., whether it is in an interlocked program section and the execution condition for IL is OFF, whether it is between JMP(04) and JME(05) and the execution condition for JMP(04) is OFF, or whether it is reset by an OFF execution condition. “RSET,” “IL,” and “JMP” are used to indicate these three times.
389