Chapter 9 PLC Operation

9.1.2 Periodical Scan

(1)Definition and operation

This scan executes interrupt programs (periodical scan programs) while the CPU is operating with a fixed cycle time (10 ms, 20 ms, or 40 ms) specified by the users.

Enter the periodical scan program to be executed between instructions INT0 and RT1 if it should be started up with a 10 ms cycle time, and between INT1 and RT1 if it should be started up with a 20 ms cycle time.

The periodical system processing is executed every 10 ms regardless of whether or not there is a periodical scan program.

Normal scan

Periodical scan

Periodical system processing (including interrupt analysis processing)

Periodical scan

Program execution

Periodical system processing

Scan every 10 ms Periodical program

Scan every 20 ms Periodical program

Scan every 40 ms Periodical program

Normal scan

10 ms

20 ms

 

 

 

 

 

 

 

 

Interrupt

 

 

Interrupt

 

 

Interrupt

INT1

 

 

INT1

 

 

INT1

 

 

RTI

RTI

 

 

Figure 9.9 Operation of periodical scan (in case of INT1)

(2)Causes of congestion errors at periodical scan

If there are periodical scans at every 10 ms as well as scans at every 20 ms or 40 ms, a congestion error occurs and the scan is stopped if the periodical scan at 10 ms is started up again before all the periodical scans are completed (i.e., the periodical system processing at INT0 to INT2 does not end within 10 ms).

Periodical system processing

10 ms

10 ms

Scan every 10 ms

 

 

 

 

 

 

10 ms

 

 

Periodical program

 

Stop

 

 

 

 

Stop

Periodical scan

Scan every 20 ms

 

 

 

 

 

 

 

 

 

 

 

 

 

Periodical program

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Scan every 40 ms

 

 

 

 

 

 

 

 

 

 

Periodical program

 

 

 

 

 

 

 

 

Normal

END scan processing

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RTI

scan

Normal scan program

 

 

 

 

 

INT0

INT0

 

 

 

 

 

 

 

 

 

 

 

 

 

INT1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(Example 1)

 

 

 

(Example 2)

INT0

(Example 3)

Stop

RTI RTI

INT1 INT2

Before the periodical scan program at

Before the periodical scan program at

every 10 ms ends, the periodical

every 20 ms ends, the periodical

interrupt at 10 ms is started up again.

interrupt at 10 ms is started up again.

Before the periodical scan program at every 40 ms ends, the periodical interrupt at 10 ms is started up again.

Figure 9.10 Congestion error at periodical scan (10 ms)

Similarly, when executing with a periodical scan at every 20 ms or with a combination of periodical scans at every 20 ms and 40 ms, a congestion error occurs if the periodical scan at 20 ms is started up again before all the periodical scans are completed (i.e., the periodical system processing at INT1 to INT2 does not end within 20 ms). Finally, when using a periodical scan at every 40 ms, a congestion error occurs if the periodical scan at 40 ms is started up again before all the periodical scans are completed (i.e., the periodical system processing at INT2 does not end within 40 ms).

9-5

Page 238
Image 238
Hitachi NJI-350B manual Periodical Scan, Congestion error at periodical scan 10 ms