Hello Guest it is November 04, 2024, 06:45:05 PM

Author Topic: Tool zeroing macro help  (Read 34191 times)

0 Members and 1 Guest are viewing this topic.

Re: Tool zeroing macro help
« Reply #20 on: November 26, 2013, 09:49:32 AM »
I thought you might be East Coast.  I'm near Cambridge, UK.
Re: Tool zeroing macro help
« Reply #21 on: November 26, 2013, 03:41:13 PM »
uhhhhhhhf
Re: Tool zeroing macro help
« Reply #22 on: December 24, 2013, 07:53:57 PM »
nope. it  did not work  bro.   any other solution?
Re: Tool zeroing macro help
« Reply #23 on: December 25, 2013, 10:12:02 AM »
Hard to say not knowing what you mean by "it did not work".  I suspect you have a software config problem.
Re: Tool zeroing macro help
« Reply #24 on: December 25, 2013, 10:55:16 AM »
well,  I copy the script to the autozero tool button and saved but when tried to use it nothing happened other than a line appearing in the status bar with "script line error "  message.
by the way      MERRY CHRISTMAS!!!!!!!
Re: Tool zeroing macro help
« Reply #25 on: December 25, 2013, 05:13:27 PM »
Try reading and executing the instructions in my previous post.  You save the macro with a changed extension Iin e macros folder and just have a short "M*********" instruction in the button script.
Re: Tool zeroing macro help
« Reply #26 on: September 22, 2014, 12:22:31 PM »
not my work !
just to update this macro. there were some depreciated statements.
and i changed the z dro to 802. and set inches instead of mm.
have yet to try(waiting on electric for machine)so go slow.

'Tool Height Setting Macro - JLH v1.1 - 4 March 2013
'This version has a 2-phase approach, fast for speed & slow for precision.
CurrentAbsInc = GetOemLED (48) 'Copy current G90/G91 state
CurrentGMode = GetOemDRO (819) 'Copy current G0/G1 state
CurrentFeed = GetOemDRO (818) 'Copy current feedrate
Contact = 0 'Clear the contact flag
PlateThickness =2.178 'Touch Plate thickness is set here
ProbeFeed1 = 12 'Fast probing feedrate is set here
ProbeFeed2 = 3 'Slow probing feedrate is set here
SetVar (1, -2) 'Maximum probing distance is set here
SetVar (2, .75) 'Retract height is set here
Code "M5" 'Ensures spindle is not running
Code "G20" 'Ensure metric units are used
Zs = GetOemDRO (802) 'Copy current Z-Scale DRO
SetOEMDRO (802,1) 'Set Z-Scale DRO to 1
Sleep 2000
DoOemButton (1010) 'Zero Z-Axis DRO
Message "Setting Tool Zero" 'Message for status bar
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = 0 Then 'Check to see if touch plate is not already grounded
Code "G90 G31 Z #1 F" & ProbeFeed1 'Fast probing move
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = True Then 'Check to see if probe has touched plate
Contact = 1 'Set the contact flag
End If
DoOemButton (1003) 'Clear a possible feed-hold condition
ProbePos = GetVar (2002) 'Exact point probe touched
ProbePos = ProbePos + .25 'Displace probe position upwards by .25mm
Code "G0 Z" & ProbePos 'Lifts probe .25mm above fast feed endpoint
While IsMoving () 'Wait until task has been completed
Wend
Code "G90 G31 Z #1 F" & ProbeFeed2 'Slow probing move
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = True Then 'Check to see if probe has touched plate
Contact = 1 'Set the contact flag
End If
ProbePos = GetVar (2002) 'Exact point probe touched
Code "G0 Z" & ProbePos 'Lifts probe to exact touch position
While IsMoving () 'Wait until task has been completed
Wend
SetOEMDRO (802,PlateThickness) 'Set Z-Axis DRO to Touch Plate thickness
Code "G0 Z #2" 'Retract off Touch Plate to the set height
While IsMoving () 'Wait until task has been completed
Wend
Message "Z-Axis is now Zeroed." 'Message for status bar
Code "F" & CurrentFeed 'Restore feedrate to original setting
If Contact = 0 Then 'Probe reached max travel without touching
Message "ERROR - Probe did not touch." 'Message for status bar
Response = MsgBox ("ERROR - Probe did not touch.",37,"Auto Tool Zero")
End If
Else
Message "ERROR - Touch Plate is grounded." 'Message for status bar
Response = MsgBox ("ERROR - Touch Plate is grounded - Check connection.",16,"Auto Tool Zero")
End If
SetOemDRO (802,Zs) 'Restore Z-Scale DRO to original setting
If CurrentAbsInc = 0 Then 'If G91 was in effect before then return to it
Code "G90"
End If
If CurrentGMode = 0 Then 'If G0 was in effect before then return to it
Code "G00"
End If  
      
Kenneth
Re: Tool zeroing macro help
« Reply #27 on: September 22, 2014, 03:36:20 PM »
Kenneth,  thanks for this - the first time someone has picked up my code and modified it further!  I hope it works for you. 

John.
Re: Tool zeroing macro help
« Reply #28 on: September 23, 2014, 05:34:31 AM »
Thank YOU John for sharing this macro. should have used your name for credit.
right now i can only use it in sim.
you've put a lot of work into it. Thanks again !
« Last Edit: September 23, 2014, 05:41:00 AM by Kenneth »
Kenneth

Offline dude1

*
  •  1,253 1,253
Re: Tool zeroing macro help
« Reply #29 on: September 23, 2014, 05:49:59 AM »
you need to add retract to it