Danny,
Open up Mach3, goto operator>Edit button script
Some of the buttons on your screen will start blinking, that means that button has VB Script in it
Click on your "Ref All" or "Home All" what ever it is called on your screen
a VB window will pop up, in that window copy and paste the code below into it.
here is the code:
'*************************start of button script*******************
DoButton( 24 ) 'home z
DoButton( 23 ) 'home y
DoButton( 22 ) 'home x
'Shortest path Home A Axis
'Put this inside your Home ALL button, or a seperate button or both your choice
'it will move the axis in Absolute mode, in the coordinate system you where last in.
'Below: is the position where the rotary table rapids to in degrees.
'via shortest path,from that point it will move toward your home
'switch at your homing speed you will need to set your homing direction
'as negative if you move to point, is positive in relation to your home switch
'relative to this point. I put it at 5 degrees but you edit it for what you want.
'SETUP AND USE NOTES:
'Under Config>General you will have to tick "Rot 360 rollover"
'for this to work right.
'You A axis DRO will only read 0 to +360, it will not show negatives.
'In your Gcode all A movements will need to be in the above + range
'so basically only absolute A+ moves for your G code, you can put
'(NEGATIVE -A) moves ONLY if when it moves bacwards it does NOT cross
'the 0/360 line.....!!!!!!!!!!
'You can issue negative A axid moves but it will move that many,
'negative degrees from its positive position, and the show you positive.
'i.e. if your at A0, and push A-90, when it quits moving it will show
'A90 Positive.
HomeRapidPoint = 5.0 'this is the degree location to stop above move.
CurrentPos = GetOEMDRO(86) 'current location of A axis prior to homing move
MoveDist = HomeRapidPoint - CurrentPos 'Calc the move distance
If Abs(MoveDist) >180 Then 'Find the shortest path
If MoveDist < 0 Then
MoveDist = 360 + MoveDist
Else
MoveDist = MoveDist - 360
End If
End If
Code "G00 G91 A" & MoveDist 'Move the A axis in Incermental the move distance
While IsMoving ()
Wend
Code "G90" 'Put back to absolute mode
DoButton( 25 ) 'home a from the 5 degree point it will move back
'at homing speed to find your home 0 switch.
'DoButton( 26 ) 'home b
'DoButton( 27 ) 'home c
'enjoy, scott
'*******************end of button script********************************
now once the above script is pasted into your VB script window, (BTW I commented out the home B, and home C axis figured you didnt have them).
got to file>Save in the VB window, (it will call it "Hidden script" DO NOT CHANGE or fool with that in any way!!!!!!)
Then close the VB window once you have saved the button code.
Then go to View>save current layout and click current layout. It will tell you "Layout saved" or something like that
NOW!!!! Listen!!!!!!!!!
Sometimes even if you do that, Mach sometimes DOES NOT save your button changes, it is just one of them things.......
So goto Operator>Edit Button, your buttons will start blinking again, Click on your: Ref all or Home all button, it will open up the VB window again that should show
that code you just pasted into it last time and saved. If you do NOT see the code you just put in there, then Redo the copy/paste/save, and save layout operations again, and RECHECK again!!!!!!!!!!
NOTE: It is CRITICAL for you to follow the set up instructions under config>general that is commented in the Button file above!! It WILL NOT work right with out those conditions
being met.
Once that code is in your button, jog your A axis to some random point, then hit the home All button, your Z, then Y, then X will home, then Your A will move the shortest route to the 5 degree mark then move at homing percent speed to your home switch on your A axis. (note 20% homing speed is a good ref speed).
NOTE2: You can use this code to also do the SAME with your X, Y, and Z axis as well, so when you hit "Home All" each Axis will Haul-Ass to some predifined point (in machine coordinates), that is just short of your Home switches, it will then switch to "Homing Mode" and sneek the rest of the way in. Kinda like when you get to Drill the Ol' Lady, you haul ass to the bed room, then come sneekin in under the covers saying that it's ok, your "Waun the Pool Boy"..........hehehehe
BTW: What do you mean we (the mach support group), saved your job, what kind of company, or situation or you in?



Scott