70 • Chapter 6 Programming Motion DMC-1000
D=C+1
DIF[C]=POS[D]-POS[C] Compute the difference and store
C=C+1
JP #C,C<15
EN End first program
#RUN Program to run motor
CMX Contour Mode
DT3 4 millisecond intervals
C=0
#E
CD DIF[C] Contour Distance is in DIF
WC Wait for completion
C=C+1
JP #E,C<15
DT0
CD0 Stop Contour
EN End the program
Teach (Record and Play-Back)
Several applications require teaching the machine a motion trajectory. Teaching can be accomplished
using the DMC-1000 automatic array capture feature to capture position data. The captured data may
then be played back in the contour mode. The following array commands are used:
DM C[n] Dimension array
RA C[] Specify array for automatic record (up to 4 for DMC-1040; 8 for DMC-1080)
RD _TPX Specify data for capturing (such as _TPX or _TPZ)
RC n,m Specify capture time interval where n is 2n msec, m is number of records to be
captured
RC? or _RC Returns a 1 if recording
Record and Playback Example:
Instruction Interpretation
#RECORD Begin Program
DP0 Define position for X axis to be 0
DA*[ ] De-allocate all arrays
DM XPOS [501] Dimension 501 element array called XPOS
RA XPOS [ ] Record Elements into XPOS array
RD_TPX Element to be recorded is encoder position of X axis
MOX Motor off for X axis
RC2 Begin Recording with a sample rate of 2 msec
#LOOP1;JP#LOOP1,_RC=1 Loop until all elements have been recorded
#COMPUTE Routine to determine the difference between consecutive points
DM DX [500] Dimension a 500 element array to hold contour points
I = 0 Set loop counter
#LOOP2 Loop to calculate the difference
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com