Galil Motion Control DMC-21 5 Series User Manual page 84

Table of Contents

Advertisement

#begin1
Invalid labels
#1Square
#123
A Simple Example Program:
#start;
SH
AB;
#loop;
PR
10000,20000;
BG
AB;
AM
AB;
WT
2000;
JP
#loop;
EN;
The above program moves A and B by 10000 and 20000 units respectively. 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-21x5 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 Automatic Subroutines
for Monitoring Conditions.
Commenting Programs
REM vs. NO or ' comments
There are 2 ways to add comments to a .dmc program.
difference between the 2 is that
and
or
comments are left in the program. In most instances the reason for using
NO
'
or
is to save program memory. The other benefit to using
NO
'
of a loop, thread or any section of code is critical. Although they do not take much time,
take time to process. So when command execution time is critical,
The GDK software will treat an apostrophe (') comment different from an
activated upon a program download (line > 80 characters or program memory > 4000 lines). In this case the
software will remove all (') comments as part of the compression and it will download all
controller.
Chapter 7 Application Programming ▫ 79
'beginning of the program
'enable A and B axes
'label for loop
'specify relative distances on A and B axes
'begin motion
'wait for motion complete
'wait 2 sec
'jump to loop label
'end program
LABEL
#AMPERR
Amplifier error routine
#AUTO
Automatically run upon controller power up or reset
#AUTOERR
Automatically run if there is an EEPROM error out of reset
#CMDERR
Incorrect command subroutine
#COMINT
Communications Interrupt (See
#ININT
Input Interrupt subroutine (See
#LIMSWI
Limit Switch subroutine
#MCTIME
Timeout on Motion Complete trippoint
#POSERR
Position Error subroutine
Table 7.1: List of labels of automatic subroutines
statements are stripped from the program upon download to the controller
REM
DESCRIPTION
CC
Command)
II
Command)
statements or
and
REM
NO
commands comes when command execution
REM
REM
statements should be used.
NO
when the compression algorithm is
comments. The main
'
statements instead of
REM
NO
and
'
comments still
NO
comments to the
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents