Galil DMC-13X8 Home Theater Server User Manual


 
USER MANUAL Chapter 7 Application Programming 109
Using Labels in Programs
All DMC-13X8 programs must begin with a label and end with an End (EN) statement. Labels start
with the pound (#) sign followed by a maximum of seven characters. The first character must be a
letter; after that, numbers are permitted. Spaces are not permitted.
The maximum number of labels which may be defined is 254.
Valid labels
#BEGIN
#SQUARE
#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-13X8 has some special labels, which are used to define input interrupt subroutines, limit
switch subroutines, error handling subroutines, and command error subroutines.
The following is a list of the automatic subroutines available on the DMC-13X8 controller. Specific
information on each subroutine may be found in the section “Automatic Subroutines for Monitoring
Conditions” on page
121.
#ININT Label for Input Interrupt subroutine
#LIMSWI Label for Limit Switch subroutine
#POSERR Label for excess Position Error subroutine
#MCTIME Label for timeout on Motion Complete trip point
#CMDERR Label for incorrect command subroutine
The DMC-13X8 also has a special label for automatic program execution. A program which has been
saved into the controllers non-volatile memory can be automatically executed upon power up or reset
by beginning the program with the label #AUTO. The program must be saved into non-volatile
memory using the command, BP.