Automatic G28 after, initial Reset and homing:
If you want this to be an automatic function you can make a Macro pump, and a custom Macro as well see below.
Instructions for use:
1). Goto Home/limits and set where you want your G28 position to be (note, this will also activate your "Safe Z" if you have it ticked and set.
2). In Mach goto: Operator>VB scripter and click on it.
3). Copy and past the code below for "MacroPump.m1s" into the window, goto: File>SaveAs in that window, and name it: "MacroPump.m1s", NOTE: make sure the directory you are saving it to IS the Profile you are running under the Macros folder. I.e. if you are running standard MachMill then the path would be Mach3/Macros/Mach3Mill.
4). Then delete the code from the window, then copy and paste in the: "M900.m1s" do a "saveas" like you did above but call it M900.
5). then close the VB scripter window.
6). goto: Config>General and tick the button called "Run Macropump".
7). Close Mach3, and then reopen it.
. when it comes back up, hit Reset, then your Ref-All button, your machine will home itself, then it will move to your G28 offset.
NOTE: if for any reason you hit a Reset after the intital G28, Mach will not "UnRef" the homes. Thus when you come back out of a reset it will not automatically re-G28 since the Refed axis LED are still referenced. If you wanted it to redo the G28 again without closing Mach3, you would have to put a "DeRef axis" in the Reset button, OR, the Macropump.
Here is the Macropump code:
'**********MacroPump.m1s
'Function: "Home Offset after Ref".
'the below makes sure that all three axis x, y, z are refed.
'the counter makes sure this code only runs once per reset.
RefOnce = GetUSERDRO(2000) 'counter DRO
If NOT(GetOEMLED(807)) and Not(GetOEMLED(808)) and Not(GetOEMLED(809)) and RefOnce = 0 Then
Code "m900" 'sends machine to your offsets macro
SetUserDRO(2000,1) 'sets counter to 1 so this code drops out.
End If
If GetOEMLED(800) Then
SetUserDRO(2000,0) 'sets counter to 0 when reset.
End If
'*******here is the M900.m1s code:
'm900.m1s
Code "G4 P1"
While IsMoving()
WEnd
Code "G28"
While IsMoving()
WEnd
'Enjoy,
'Scott