Hello Guest it is November 20, 2019, 04:06:35 AM

Author Topic: Tool Zero Code w/ Wait for Probe Confirmation  (Read 2345 times)

0 Members and 1 Guest are viewing this topic.

Tool Zero Code w/ Wait for Probe Confirmation
« on: August 14, 2017, 12:02:54 PM »
I was wondering if someone could help with some code that I could add to my tool zero script which waits for you to touch the plate to the bit to confirm that your ground clip is connected. I ran my script yesterday and forgot to attach the ground clip and I ended up driving into the block before I could hit the stop. That made me start thinking that rather than rely on my memory it would be good to add that into the script.

I'm thinking it might be something like this:

Code: [Select]
Code "(Touch Z-Plate to bit)" 'this goes in the status bar
Code "G4 P1" 'Pause
If GetOemLed (825) <> 0 Then
    Code "(I didn't see the Z-Plate)"
    Exit Sub
End If

Instead of a pause it would be better to wait until it sees the probe touch and then ask the operator to continue by clicking on a button or something.

Any suggestions?

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #1 on: August 14, 2017, 03:21:56 PM »
You need to use a Message box to have Mach3 wait, then continue when you click OK.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #2 on: August 14, 2017, 03:59:39 PM »
Thanks, I'm familiar with programming but almost no experience with Mach's VBScripts.

I see the MsgBox command. Now to get a little fancy can you point me to some examples of how I could combine that with the display of the probe touch? I'm thinking now that I could have this MsgBox pop up asking to touch the probe. The box could have a circle or something that lights up with the probe is touched (like on the diagnostic screen). Once Mach detects the touch the MsgBox changes to saying something like "Saw probe, clink continue when touch plate is ready". Then of course there would be a cancel button if for some reason you change your mind or the touch plate isn't seen.
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #3 on: August 14, 2017, 05:57:36 PM »
Take a look at the attached script.  It has more than you asked for in that it is script for locating and setting X, Y and Z zero.  But it does have the pause script you are asking for. 

Hope this helps.
Tom
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #4 on: August 14, 2017, 06:12:47 PM »
Awesome, thank for sharing. I'll print it out and study it tonight

Offline Tweakie.CNC

*
  • *
  •  8,005 8,005
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #5 on: August 15, 2017, 02:01:55 AM »
I think you will find that the above script only zero's the Z axis but it does show adding a message box.

If it's of any interest the full article for X - Y - Z zero position setting is here http://www.cooperman.talktalk.net/files/17.htm

Tweakie.
« Last Edit: August 15, 2017, 02:09:28 AM by Tweakie.CNC »
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #6 on: August 15, 2017, 09:35:28 AM »
Tweakie - you are correct.  I attached the wrong script.  I'll get the correct script off my machine dedicated laptop and post it..  Sorry for the mistake.
Tom
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #7 on: August 15, 2017, 11:22:18 AM »
Here is the X, Y, Z zero script with the pause message.  Sorry for the inconvenience.
Tom
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #8 on: August 15, 2017, 11:54:18 AM »
Thanks, this looks interesting. Is there a way to give a visual indication in a message box like to see on the diagnostics tab when you touch the probe to the plate? I would also like to "improve" the script so that it doesn't proceed until it does confirm that the probe is detected.

My goal here is to try and eliminate the situation where the ground clip is not attached or it was but came free.

Thanks for your help so far, if nothing else I see some things to improve on what I have now.

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Tool Zero Code w/ Wait for Probe Confirmation
« Reply #9 on: August 15, 2017, 12:27:56 PM »
Quote
Is there a way to give a visual indication in a message box like to see on the diagnostics tab when you touch the probe to the plate? I would also like to "improve" the script so that it doesn't proceed until it does confirm that the probe is detected.

No, I don't believe you can do either of those things.
But what you can do, is add a probe active LED on the screen, so that when you check the probe, the LED should be visible behind the message box. I think that would work.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html