Manual
Using the Digital Outputs and Inputs 8-7
Interrupts are useful for starting or changing the course of a move sequence as the result of
external inputs which may occur at unpredictable times. These inputs might result from a
person pushing a button or from the activation of some switch or sensor in your system.
You may wish to disable interrupts during certain critical sections of your move sequence;
for example, while fluids are flowing or heaters are turned on. You should not use
personality parameter 36 for this purpose; instead, use the FP ("Front Panel Lockout")
command.
If an interrupt occurs while locked out by FP the interrupt is not forgotten; it is merely
postponed until a subsequent FP re-enables interrupts. Only one interrupt from each Digital
Input or front panel button can be remembered in this way. If a second one occurs before the
first one is serviced the second one is lost.
Remember that the maximum nesting depth of Download Sequences is 12, including
interrupts. See Interrupting an Interrupt, below.
Interrupts have a one-command latency. If the System is sitting idle when a False-to-True
transition occurs, the Download Sequence begins executing after only a few milliseconds of
delay. But suppose the Automove System is performing a series of vectors. It performs
vector A, then vector B. Sometime during vector A an Input changes from False to True.
The interrupt will not occur until after vector B is complete!
Also, remember that the System only looks at the Digital Inputs and front panel between
vectors. Therefore a short pulse might be missed.
Because of these limitations, there are several cases when interrupts should NOT be used. If
the exact order of command execution is critical, you should use the XI command at
appropriate places in your move sequence, instead of an interrupt. If an Input transition
requires an extremely prompt response (say, less than a few milliseconds) or if the signal
will be of brief duration, you should arrange for your move sequence to be waiting in a WN
command for the transition to occur.
Don't overlook the technique of putting an "idle loop" into your move sequence. This can be
an infinitely-repeating Download Sequence which periodically checks and responds to the
Digital Inputs via an XI command. Meanwhile the idle loop can be performing some other
action which is not allowed to be interrupted, except at one well-defined point in the loop;
i.e., the XI command.
A non-interrupt technique for getting one and only one response per switch closure is as
follows. Start the response as the result of a WN command or an XI command. Then, at the
tail end of the response, use a WN to wait for the switch to open again. If using XI, be sure
to put the final WN within the response Sequence itself. If you put the WN after the
invoking XI and if the switch closes just after the XI but before the WN, an entire pulse will
be missed.
If you decide to use WN or XI instead of interrupts, be sure to disable the interrupts via
personality parameter 36, or you will get unexpected responses.