Galil Motion Control optcom Page 230
Optima DMC-1xxx and DMC-18x2 Command Reference
ZS
i
219
ZS
FUNCTION: Zero Subroutine Stack
DESCRIPTION:
The ZS command is only valid in an application program and is used to avoid returning from
an interrupt (either input or error). ZS alone returns the stack to its original condition.
ZS1 adjusts the stack to eliminate one return. This turns the jump to subroutine into a
jump. Do not use RI (Return from Interrupt) when using ZS. To re-enable interrupts, you
must use II command again.
The status of the stack can be interrogated with the operand _ZSn - see operand usage below.
ARGUMENTS: ZS n
where
n = 0 Returns stack to original condition
n = 1 Eliminates one return on stack
USAGE: DEFAULTS:
While Moving
Yes
Default Value
0
In a Program
Yes
Default Format
3.0
Command Line
No
Controller Usage
ALL CONTROLLERS
OPERAND USAGE:
_ZSn contains the stack level for the specified thread where n = 0,1,2 or 3. Note: n can also
be specified using A (thread 0), B(thread1), C(thread2) or D(thread3) .
EXAMPLES:
II1
Input Interrupt on 1
#A;JP #A;EN
Main program
#ININT Input
Interrupt
MG "INTERRUPT"
Print message
S=_ZS Interrogate
stack
S= Print
stack
ZS Zero
stack
S=_ZS Interrogate
stack
S= Print
stack
EN End