Originally Posted by
oddodd
Can you post the VB macro please? Thank you very much!
Code:
CurrentFeed = GetOemDRO(818)
ZMove = 20.00 'Total lenght of Probe to move before Stop or no Contact Made.
ZOffset = 1.47 ' Plate Hight
ZSal = ZOffset + 2.00 '+ Free Hight, Will position the probe 2 mm over the material.
StopZmove = 0
If GetOemLed (825)=0 Then
DoOEMButton (1010)
Code "G31 Z-"& ZMove & "F40"
While IsMoving()
Sleep(200)
Wend
Probepos = GetVar(2002)
' Improve accuracy
Code "G0 Z" & Probepos + 0.5 ' Move back a bit to get a new reading
While IsMoving()
Sleep(200)
Wend
Code "G31 Z-" & ZMove & "F4" ' Move very slow for greater accuracy
While IsMoving()
Sleep(200)
Wend
Probepos = GetVar(2002) ' Z var for probe
If Probepos = - ZMove Then
responce = MsgBox ("**ERROR** " , 4 , "Probe **ERROR**" )
Code "G0 Z10"
StopZmove = 1
Code "F" &CurrentFeed
End If
If StopZmove = 0 Then
Code "G0 Z" & Probepos
While IsMoving ()
Sleep (200)
Wend
Call SetDro (2, ZOffset)
Code "G0 Z" & ZSal
While IsMoving()
Sleep(200)
Wend
Code "(Z zeroed)"
Code "F" &CurrentFeed
End If
Else
Code "(Check Ground Probe)"
End If
Exit Sub
'-------------------
Take the code above, copy everything and paste it into the "Auto Tool Zero" button macro. Before you close the file and save changes you need to enter the probe height, i.e. replace 1.47 with your probe (tool setter) height. Make sure you test BEFORE you run it, because if something went wrong during your copy/paste/change than the machine might crash your tool setter. Remember that the tool you are using must be connected to one end of the toll setter and the top of the tool setter must be the ground. Check before the first run that your Digitize LED gets lit when the probe (your tested end mill or drill bit) touches the tool setter. Note that the macro is for mm units.
The way to use it:
- Position the end mill near the top of the tool setter, about 2mm above.
- Make sure the tool setter and the end mill is connected to the BoB GND and the input pin you defined as probe.
- Click on the Auto Tool Zero button in Program Run screen. The end mill will slowly descend towards the top of the tool setter and will stop as soon as it touches, move up again a tiny bit (0.5mm above the stop) and descend the second time. Once it touches the top of the tool setter surface a second time it will retract 2mm above the top of the tool setter and stop. At the same time your Z DRO will be set to the tool setter height plus 2 mm, so at the command "G0 Z0" Z will be lowered to the surface, the bottom of the tool setter. If the tool (end mill) is not touching the the top of the tool setter the movement will stop if the Z reaches the 20mm depth. Change that value if you want something else there, but make sure the value is right.
Note: Be careful. If you change anything else in my macro or enter the wrong values somewhere then something can seriously go wrong or the macro stops working.
Good luck.