'***************************************************************************
'Description:
'#LIMSWI limit switch automatic subroutine triggers when a limit is hit
'***************************************************************************
#l
  good = 0;  'define variable to zero
  JGA= 1000;  'jog x axis
  BG A
#loop
WT 100
JP #loop; 'A continuous loop must be running for Automatic Subroutines to run

'Trigger forward limit switch on X axis and the code below will run
#LIMSWI
  good = 1
  MG "Limit Hit"
  WT 1000
RE 1