Galil Motion Control DMC-18 2 Series User Manual page 136

Table of Contents

Advertisement

#POSERR
#MCTIME
#CMDERR
For example, the #POSERR subroutine will automatically be executed when any axis exceeds its
position error limit. The commands in the #POSERR subroutine could decode which axis is in error
and take the appropriate action. In another example, the #ININT label could be used to designate an
input interrupt subroutine. When the specified input occurs, the program will be executed
automatically.
NOTE: An application program must be running for automatic monitoring to function.
Example - Limit Switch:
This program prints a message upon the occurrence of a limit switch. Note, for the #LIMSWI routine
to function, the DMC-18x2 must be executing an applications program from memory. This can be a
very simple program that does nothing but loop on a statement, such as #LOOP;JP #LOOP;EN.
Motion commands, such as JG 5000 can still be sent from the PC even while the "dummy"
applications program is being executed.
:ED
000 #LOOP
001 JP #LOOP;EN
002 #LIMSWI
003 MG "LIMIT OCCURRED"
004 RE
<control> Q
:XQ #LOOP
:JG 5000
:BGX
Now, when a forward limit switch occurs on the X axis, the #LIMSWI subroutine will be executed.
Notes regarding the #LIMSWI Routine:
1) The RE command is used to return from the #LIMSWI subroutine.
2) The #LIMSWI subroutine will be re-executed if the limit switch remains active.
The #LIMSWI routine is only executed when the motor is being commanded to move.
Example - Position Error
:ED
000 #LOOP
001 JP #LOOP;EN
002 #POSERR
003 V1=_TEX
004 MG "EXCESS POSITION ERROR"
005 MG "ERROR=",V1=
006 RE
<control> Q
:XQ #LOOP
:JG 100000
:BGX
DMC-18x2
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Position error exceeds limit specified by ER
Motion Complete timeout occurred. Timeout period set by TW command
Bad command given
Edit Mode
Dummy Program
Jump to Loop
Limit Switch Label
Print Message
Return to main program
Quit Edit Mode
Execute Dummy Program
Jog
Begin Motion
Edit Mode
Dummy Program
Loop
Position Error Routine
Read Position Error
Print Message
Print Error
Return from Error
Quit Edit Mode
Execute Dummy Program
Jog at High Speed
Begin Motion
Chapter 7 Application Programming • 125

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

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

Table of Contents