![Galil Motion Control DMC-1600 Series User Manual Download Page 141](http://html1.mh-extra.com/html/galil-motion-control/dmc-1600-series/dmc-1600-series_user-manual_3256992141.webp)
#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 Edit
Mode
000 #LOOP
Dummy Program
001 JP #LOOP;EN
Jump to Loop
002 #LIMSWI
Limit Switch Label
003 MG "LIMIT OCCURRED"
Print Message
004 RE
Return to main program
<control> Q
Quit Edit Mode
:XQ #LOOP
Execute Dummy Program
:JG 5000
Jog
:BGX Begin
Motion
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 Edit
Mode
000 #LOOP
Dummy Program
001 JP #LOOP;EN
Loop
002 #POSERR
Position Error Routine
003 V1=_TEX
Read Position Error
004 MG "EXCESS POSITION ERROR"
Print Message
005 MG "ERROR=",V1=
Print Error
006 RE
Return from Error
<control> Q
Quit Edit Mode
:XQ #LOOP
Execute Dummy Program
:JG 100000
Jog at High Speed
:BGX Begin
Motion
Now, if the position error on the X axis exceeds that specified by the ER command, the #POSERR
routine will execute.
NOTE: The RE command is used to return from the #POSERR subroutine
NOTE: The #POSERR routine will continue to be executed until the position error is cleared (is
less than the ER limit).
Example - Input Interrupt:
#A Label
II1
Input Interrupt on 1
JG 30000,,,60000
Jog
BGXW Begin
Motion
#LOOP;JP#LOOP;EN Loop
DMC-1600
Chapter 7 Application Programming
•
133