Installation manual
Publication 1747-RM001G-EN-P - November 2008
11-24 Understanding Interrupt Routines
• Bit Mask (Word S:48) - You enter the bit-mapped value that
corresponds to the bits you wish to monitor on the discrete I/O module
(0 to 255). Only bits 0 to 7 are used in the DII function. Setting a bit
indicates that you wish to include the bit in the comparison of the
discrete I/O card’s bit pattern to the DII compare value (S:49). This
value is applied on detection of the DII Reconfigure bit, each DII ISR
exit, and at each end of scan (END, TND, or REF).
• Compare Value (Word S:49) - You enter a bit-mapped value that
corresponds to the bit pattern that must occur on the discrete I/O card
for a count or interrupt to occur (0 to 255). Only bit 0 to 7 are used in
the DII function. The bit must be set (1) or cleared (0) in order to satisfy
the compare condition for that bit. An interrupt or count is generated
upon the last bit transition of the compare value. This value is applied
on detection of DII Reconfigure bit, each DII ISR exit, and at each end
of scan (END, TND, or REF).
To provide protection from inadvertent data monitor alteration of your
selection, program an unconditional MOV instruction containing the
compare value of the DII to S:49.
• Preset (Word S:50) - When this value is equal to 0 or 1, an interrupt is
generated each time the comparison specified in words S:48 and S:49 is
satisfied. When this value is between 2 and 32767, a count occurs each
time the bit comparison is satisfied. An interrupt is generated when the
accumulator value reaches 1 or exceeds the preset value. This value is
applied on detection of DII Reconfigure bit, each DII ISR exit, and at
each end of scan (END, TND, or REF).
To provide protection from inadvertent data monitor alteration of your
selection, program an unconditional MOV instruction containing the
preset value of the DII to S:50.
• Return Mask (Word S:51) - The Return Mask is updated immediately
preceding entry into the DII subroutine. This value contains the bit map
of the last bit transition that caused the interrupt. If more than one bit
transitions in the same 100µs DII sample period, it is included in the
return mask. This bit is cleared by the processor on exit from the DII
subroutine. Use this value to validate the last interrupt transition that
caused the input pattern to match the compare value. Or when
dynamically reconfiguring (sequencing) the DII, use this value inside of
your DII’s subroutine to help determine/validate its position of the
sequence.
• Accumulator (Word S:52) - The DII accumulator contains the number
of counts that have occurred. When a count occurs and the accumulator
is greater than or equal to the preset value, a DII interrupt is generated
and the accumulator is cleared.