'***************************************************************************
'Description:
'Use the axis designator (~a-~h) to have the axis letter as a variable in
'most commands.  Each routine shows different uses for it.
'To execute routine, type in XQ and then the label (ie: XQ#LIMIT)
'***************************************************************************
#move;      'Program that moves each axis one after the other
total= 4;    'Set Total # of axes to move
~a= 0
SH
#loop
PR~a= 10000;SP~a= 5000;BG ~a;AM ~a
~a= ~a+1
JP #loop,~a<total
'Finished moving all axes
EN
'*******************************************************************
#run;  'Call to subroutine in User Defined Units
axis= 0;dist= 2;vel= 10
JS #movesub
EN
'Subroutine to move an axis in user units (4000cts/inch)
#movesub;'(AXIS,DIST,VEL)
~a= axis
SP~a= vel*4000
PR~a= dist*4000;BG ~a;AM ~a
EN
'*******************************************************************
#limit;     'Program to display the status of the limit switches
axis= 0
total= 8
MG "LIMITS   FWD  RVS"
#a
~a= axis
lfstat= _LF~a
lrstat= _LR~a
axis= axis+1
MG "AXIS",axis{F1.0},"    ",lfstat,"   ",lrstat
JP #a,axis<total
EN