DMC-18x2
Chapter 7 Application Programming • 111
program line where the maximum number of characters on a line is 80 (including semicolons). A
carriage return enters the final command on a program line.
Using Labels in Programs
All DMC-18x2 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 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-18x2 has special labels, which are used to define input interrupt subroutines, limit switch
subroutines, error handling subroutines, and command error subroutines. The following labels listed
below are the automatic subroutines supported by the controller. Sample programs for these
subroutines can be found in “Automatic Subroutines for Monitoring Conditions” on page 124.
#AUTO
Starts program on power-up or reset
#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
#AUTOERR
Label for checksum error
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Содержание DMC-18 2 Series
Страница 3: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 5: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 11: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...