Chapter 2. Program Organization
26
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C
2.3.1
Interrupt Handling
An I/O, Module, or Timed interrupt can be associated with any block except _MAIN, as long as the
block has no parameters other than an OK output. After an interrupt has been associated with a
block, that block executes each time the interrupt trigger occurs. A given block can have multiple
timed, I/O, and module interrupt triggers associated with it. It is executed each time any one of its
associated interrupts triggers. For details on how interrupt blocks are prioritized, refer to
If a parameterized block or external block is triggered by an interrupt, it inherits %P data as its %L
local data. For example, a %L00005 reference in the parameterized block or C block actually
references %P00005.
Note:
Timer function blocks do not accumulate time if used in a block that is executed as a result of
an interrupt.
Blocks that are triggered by interrupts can make calls to other blocks. The application stack used
during interrupt-driven execution is different from the stack used during normal block-structured
program execution. In particular, the nested call limit is different from the limit described for calls
from the _MAIN block. If a call results in insufficient stack space to complete the call, the CPU logs an
Application Stack Overflow
fault.
Note:
We strongly recommend that interrupt-driven blocks not be called from the _MAIN block or
other non-interrupt driven blocks because the interrupt and non-interrupt driven blocks
could be reading and writing the same global memories at indeterminate times relative to
each other. In the following example (Figure 13) INT1, INT2, BLOCK5, and PB1 should not be
called from _MAIN, BLOCK2, BLOCK3, or BLOCK4.
INT Block 1
_MAIN
Block
Block
2
Block
3
Block
4
Block
5
INT Block 2
PB
1
Figure 13: Conflict Avoidance when using Interrupt-Driven Blocks
Содержание PACSystems RX7i
Страница 357: ......
Страница 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451...