Oi - on input, Command details, Parameter details – Applied Motion RS-232 User Manual
Page 147: Examples

147
920-0002 Rev. I
2/2013
Host Command Reference
OI - On Input
Compatibility: Q drives only
Affects:
Interrupt function and stored program flow
See also:
MT, OF command
When the given input condition is met the OI command causes program segment 10 to immediately load from
non-volatile memory into the queue. The OI command operates as a kind of software switch. Executing the
command turns the interrupt function on. Responding to the interrupt input (by loading segment 10) turns the
interrupt function off. Therefore after an interrupt condition is cleared in the system the OI command must be
executed again to reset the interrupt function. One way to do this is place a copy of the OI command near the end
of segment 10, before loading and executing another segment (QX command). Only one interrupt input can be
defined at a time within a program. Executing the OI command with no parameter disables the interrupt function.
If Multi-Tasking is disabled (MT0, default) when the input condition is met, any move in progress will be aborted
and Segment 10 will be loaded immediately. If Multi-Tasking is enabled (MT1) when the input condition is met, the
program will branch to Segment 10 without interrupting a move in progress. In this scenario a Stop Move (SM)
command may be used to abort the move.
Command Details:
Structure
OI{Parameter #1}
Type
BUFFERED
Usage
WRITE ONLY
Non-Volatile
No
Register Access
None
Parameter Details:
(See Appendix F: Working With Inputs and Outputs)
Examples:
Command
Drive sends
Notes
MT0
-
Turn Multi-Tasking off
OIX5F
-
Load and execute program segment 10 when input X5 goes from
high to low. If a move is in progress, abort it.
MT1
-
Turn Multi-Tasking on
OIX5F
-
Load and execute program segment 10 when input X5 goes from high to
low. Has no effect on a move already in progress.
OI
-
Disable interrupt function