Timer and Counter Instructions
Chapter 5
518
one millisecond, whichever is greater, when a data highway interface
module is connected to the processor.
The instruction execution times given in Section 5.6 enable the
programmer to estimate scan time for a planned program. The program
shown in Figure 5.13 will determine and display the average scan time
during program operation:
Rung 1 and 2 count the number of scans. At the 1000th scan bit 14
(overflow bit) comes on.
Rung 3 times the first 1000 scans. When the counter overflows, the
timer stops.
Rung 4 gets the value of the timer after 1000 scans and displays it in
milliseconds as the result of the divide instruction.
Rung 5 and 6 reset the counter and timer.
WARNING: The lower limit of input device cycle time should
not be less than the scan time of the processor. If so, incorrect
input data could be used during program execution. Critical
inputs can be monitored and critical outputs can be controlled in
an accelerated manner using the I/O update instructions
described in Section 7.2.
5.5.2
Program for Determining
Scan Time
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com