Installation manual
Publication 1747-RM001G-EN-P - November 2008
Understanding Interrupt Routines 11-19
Example
The DII can be programmed to count items on a high-speed conveyer. Each
time 100 items pass a photo-switch, the DII subroutine is executed. The DII
subroutine then uses Immediate I/O instructions to package the products.
Operation
After you download your program and enter the REM Run mode, the DII
begins operation as follows.
Counter Mode
This mode is active when the Preset Value (S:50) contains a value greater
than 1.
1. The DII reads the first byte of input data of a selected discrete input
card at least once every 100µs.
(1)
Note that this “polling” of the input
data has no effect on processor scan time.
2. When the input data matches the programmed masked value, the
accumulator is incremented by one. The next count occurs when input
data transitions to non-matched and then back to matched.
3. When the accumulator reaches or exceeds the preset value, between 1
and 32,767, the interrupt is generated and the accumulator is reset to
zero.
4. The DII subroutine is executed.
5. The cycle repeats.
TIP
PLC users: The main difference between the DII and the
PLC 5/40 PII is that the DII requires all stated transitions
to occur prior to generating a count, while the PII requires
that only one of the stated transitions occur. Also, the PLC
term “count” is referred to as “preset” in the DII.
(1)
You must add interrupt latency time to the final transition or count that causes the interrupt subroutine to
execute.