Galil Motion Control CDS-3310 User Manual page 95

Table of Contents

Advertisement

OPERAND
_ED1
_ED2
_ED3
The operands are used with the XQ command in the following format:
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 with Multitasking
Example – Ethernet Communication Error
This simple program executes in the CDS-3310 and indicates (via the serial port) when a
communication handle fails. By monitoring the serial port, the user can re-establish communication if
needed.
34 • Chapter 7 Application Programming
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)
XQ _ED2 (or _ED3),_ED1,1
Instruction
#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
Instruction
#LOOP
JP#LOOP
EN
#TCPERR
MG {P1}_IA4
RE
Interpretation
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
Interpretation
Simple program loop
Ethernet communication error auto routine
Send message to serial port indicating which handle
did not receive proper acknowledgment.
CDS-3310

Advertisement

Table of Contents
loading

Related Products for Galil Motion Control CDS-3310

Table of Contents