Mathematical And Functional Expressions; Mathematical Operators - Galil Motion Control DMC-18 2 Series User Manual

Table of Contents

Advertisement

The above program prompts the operator to enter a jog speed. If the operator enters a number out of
range (greater than 8 million), the #CMDERR routine will be executed prompting the operator to enter
a new number.
In multitasking applications, there is an alternate method for handling command errors from different
threads. Using the XQ command along with the special operands described below allows the
controller to either skip or retry invalid commands.
OPERAND
_ED1
_ED2
_ED3
The operands are used with the XQ command in the following format:
XQ _ED2 (or _ED3),_ED1,1
Where the ",1" at the end of the command line indicates a restart; therefore, the existing program stack
will not be removed when the above format executes.
The following example shows an error correction routine which uses the operands.
Example - Command Error w/Multitasking
#A
JP#A
EN
#B
N=-1
KP N
TY
EN
#CMDERR
IF _TC=6
N=1
XQ _ED2,_ED1,1
ENDIF
IF _TC=1
XQ _ED3,_ED1,1
ENDIF
EN

Mathematical and Functional Expressions

Mathematical Operators

For manipulation of data, the DMC-18x2 provides the use of the following mathematical operators:
DMC-18x2
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
FUNCTION
Returns the number of the thread that generated an error
Retry failed command (operand contains the location of the failed command)
Skip failed command (operand contains the location of the command after the
failed command)
Begin thread 0 (continuous loop)
End of thread 0
Begin thread 1
Create new variable
Set KP to value of N, an invalid value
Issue invalid command
End of thread 1
Begin command error subroutine
If error is out of range (KP -1)
Set N to a valid number
Retry KP N command
If error is invalid command (TY)
Skip invalid command
End of command error routine
Chapter 7 Application Programming • 127

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dmc-1812Dmc-1822Dmc-1832Dmc-1842

Table of Contents