![Galil Motion Control DMC-18 2 Series Скачать руководство пользователя страница 138](http://html1.mh-extra.com/html/galil-motion-control/dmc-18-2-series/dmc-18-2-series_user-manual_3263754138.webp)
DMC-18x2
Chapter 7 Application Programming • 127
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 FUNCTION
_ED1
Returns the number of the thread that generated an error
_ED2
Retry failed command (operand contains the location of the failed command)
_ED3
Skip failed command (operand contains the location of the command after the
failed command)
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
Begin thread 0 (continuous loop)
JP#A
EN
End
of
thread
0
#B
Begin
thread
1
N=-1
Create
new
variable
KP N
Set KP to value of N, an invalid value
TY
Issue
invalid
command
EN
End
of
thread
1
#CMDERR
Begin command error subroutine
IF _TC=6
If error is out of range (KP -1)
N=1
Set N to a valid number
XQ _ED2,_ED1,1
Retry KP N command
ENDIF
IF _TC=1
If error is invalid command (TY)
XQ _ED3,_ED1,1
Skip invalid command
ENDIF
EN
End of command error routine
Mathematical and Functional Expressions
Mathematical Operators
For manipulation of data, the DMC-18x2 provides the use of the following mathematical operators:
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Содержание DMC-18 2 Series
Страница 3: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 5: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 11: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...