Effects of using interrupts on logic scan time – Rockwell Automation 1785-Lxxx Enhanced and Ethernet PLC-5 Programmable Controllers User Manual
Page 289

Publication 1785-UM012D-EN-P - July 2005
Maximizing System Performance C-3
If you use subroutines, program scan times can vary by the scan time of entire
logic files.
Effects of Different Instructions on Logic Scan Time
Some instructions have a much greater effect on logic scan time than others
based on the time that it takes to execute each instruction.
Program scan time is also affected by the construction of your ladder rungs.
The size of the rung and the number of branches can cause the scan time to
fluctuate greatly.
Effects of Using Interrupts on Logic Scan Time
Program scan time is also affected by interrupt programs. An interrupt is a
special situation that causes a separate program to run independently from the
normal program scan. You define the special event and the type of interrupt
that is to occur. For more information on interrupt programs, see chapters 18
and 19.
For example, a selectable timed interrupt (STI) is a program file that you
define to execute once every time period. The example shown below has these
parameters:
•
you configure an STI to execute every 20 ms
•
the STI program takes 3 ms to execute
•
the logic scan is 21.8 ms
•
housekeeping takes 3.2 ms
The first program scan in this example lasts a total of 28 ms. The program
scans look like:
Logic Scan
STI
Time = 0
Time = 40 ms
Program Scan 2
Housekeeping
STI
Time = 0
Time = 20 ms
3.2 + 21.8 + 3 = 28 ms
House-
keeping
Logic
Scan
STI
Scan
Program Scan 1
The STI occurred 20 ms
into the first program scan.
Time = 40 ms (20 ms + 20 ms)
but program scan 1 = 28 ms,
meaning that the STI interrupts
12 ms into the second
program scan.
Housekeeping
Logic Scan