'***************************************************************************
'Galil Motion Control Sample DMC Code
'***************************************************************************
'Description:
'Using arrays to specify position absolute moves
'***************************************************************************
#run                            ;'label
  JS #store                     ;'initialize arrays
  AC 200000, 200000             ;'accelerations
  DC 200000, 200000             ;'decelerations
  SP 50000, 50000               ;'speeds

  n = 0                         ;'initialize counter
  #loop
    PA xpos[n], ypos[n]         ;'final positions
    BG AB                        ;'begin motion
    AM AB                        ;'wait for motion complete
    WT wait[n]                  ;'wait specified time interval
    n = n + 1                   ;'increment index
  JP #loop, n < 4               ;'repeat 4 times
EN                              ;'end program


#store
  DM xpos[4], ypos[4], wait[4]  ;'define arrays

  xpos[0] = 100                 ;'set values
  xpos[1] = 320
  xpos[2] = 450
  xpos[3] = 500

  ypos[0] = -100
  ypos[1] = 20
  ypos[2] = 153
  ypos[3] = 200

  wait[0] = 50
  wait[1] = 100
  wait[2] = 60
  wait[3] = 120
EN