'***************************************************************************
'Galil Motion Control Sample DMC Code
'***************************************************************************
'Description:
'Use Analog input 1 to set feedrate of vector motion
'***************************************************************************
#move               ;'label
  VM AB             ;'specify XY plane
  VP 6000, 0        ;'move to point b
  CR 1000, 270, 180 ;'move to point c
  VP -6000, 2000    ;'move to point d
  CR 1000, 90, 180  ;'move to point e
  VP 0, 0           ;'return to point a
  VE                ;'end of path
  VA 100000         ;'vector acceleration
  VD 100000         ;'vector deceleration
  BG S               ;'start motion
  XQ #speed, 1      ;'run SPEED routine in thread 1
  AM S               ;'wait for motion complete
  HX 1               ;'kill thread 1
EN                  ;'end program


#speed              ;'label
  a = @AN[1]        ;'read analog voltage
  v = a * 2000      ;'set feedrate
  VS v              ;'update feedrate
  JP #speed         ;'repeat the process
EN                  ;'end program