I wrote this little procedure to home off limit switches for a Galil card. Use it if you need.

Karl






'****************** HOME OFF LIMIT SWITCH PROGRAM****
'Karl Townsend, Dassel, MN, USA
'This program jogs to the limit switch on each axis,
'moves a small distance, then finds the index mark

'set beginning parameters
'the dist variables should be set for each machine
'so that it stops half turn from index mark
#HOMEALL ; CN 1,1 ; JG 0,0,0,0,0 ; SH
creep=500 ; slow=5000
ydist=3400 ; xdist=3000 ; zdist=2200

'Three routines below, one for each axis
'line1 starts jog to limit switch
'line2 loops until a switch is hit
'line3 stops
'line4 moves a relative distance from switch
'line5 finds the index mark

'Home the X axis off the minus switch
JGX=-slow ; BGX
#HMLOOPX ; WT100 ; JP#HMLOOPX,_LRX=1
JGX=0 ; AMX ; WT100
SPX=slow ; PR xdist,0,0 ; BGX ; AMX ; WT1000
JGX=creep ; FIX ; BGX ; AMX

'Home the Y axis off the forward switch
JGY=slow ; BGY
#HMLOOPY ; WT100 ; JP#HMLOOPY,_LFY=1
JGY=0 ; AMY ; WT100
SPY=slow ; PR 0,-ydist,0 ; BGY ; AMY ; WT1000
JG ,-creep ; FIY ; BGY ; AMY

'Home the Z axis off the top switch
JGZ=slow ; BGZ
#HMLOOPZ ; WT100 ; JP#HMLOOPZ,_LFZ=1
JGZ=0 ; AMZ ; WT100
SPZ=slow ; PR 0,0,-zdist ; BGZ ; AMZ ; WT1000
JGZ=-creep ; FIZ ; BGZ ; AMZ ; EN