#X1
#BEGIN1
Invalid labels
#1Square
#123
A Simple Example Program:
#START
Beginning of the Program
PR 10000,20000
Specify relative distances on X and Y axes
BG XY
Begin Motion
AM
Wait for motion complete
WT 2000
Wait 2 sec
JP #START
Jump to label START
EN
End of Program
The above program moves X and Y 10000 and 20000 units. After the motion is complete, the motors rest for 2
seconds. The cycle repeats indefinitely until the stop command is issued.
Special Labels
The DMC-40x0 have some special labels, which are used to define input interrupt subroutines, limit switch
subroutines, error handling subroutines, and command error subroutines. See section on 705HAuto-S tart Routine
#AMPERR
Label for Amplifier error routine
#AUTO
Label that will automatically run upon the controller exiting a reset (power-on)
#AUTOERR
Label that will automatically run if there is an EEPROM error out of reset
#CMDERR
Label for incorrect command subroutine
#COMINT
Label for Communications Interrupt (See CC Command)
#ININT
Label for Input Interrupt subroutine (See II Command)
#LIMSWI
Label for Limit Switch subroutine
#MCTIME
Label for timeout on Motion Complete trippoint
#POSERR
Label for excess Position Error subroutine
#TCPERR
Label for errors over a TCP connection (error code 123)
Commenting Programs
Using the command, NO or Apostrophe (‘)
The DMC-40x0 provides a command, NO, for commenting programs or single apostrophe. This command allows
the user to include up to 78 characters on a single line after the NO command and can be used to include
comments from the programmer as in the following example:
#PATH
‘ 2-D CIRCULAR PATH
VMXY
‘ VECTOR MOTION ON X AND Y
VS 10000
‘ VECTOR SPEED IS 10000
VP -4000,0
‘ BOTTOM LINE
CR 1500,270,-180
‘ HALF CIRCLE MOTION
VP 0,3000
‘ TOP LINE
CR 1500,90,-180
‘ HALF CIRCLE MOTION
VE
‘ END VECTOR SEQUENCE
BGS
‘ BEGIN SEQUENCE MOTION
EN
‘ END OF PROGRAM
Chapter 7 Application Programming ▫ 118 DMC-40x0 User Manual