Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 06:04:08 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  Auto Tool zero. Which Input etc. do I Use?
Pages: « 1 2   Go Down
Print
Author Topic: Auto Tool zero. Which Input etc. do I Use?  (Read 424 times)
0 Members and 1 Guest are viewing this topic.
MachBruce
Active Member

Offline Offline

Posts: 53


View Profile
« Reply #10 on: August 27, 2008, 10:20:27 PM »

Thanks Greg,

The digitise led does light
 


Bruce


Logged
Greolt
Global Moderator
*
Online Online

Posts: 353


View Profile
« Reply #11 on: August 27, 2008, 11:35:34 PM »

Bruce

I ran Brett's macro on my machine and it works fine. 

Don't think the pause after the probe move (Code "G4 P0.25") is needed but it does not stop it working.

So I guess your problem may lie elsewhere.  Are you using LPT?    My SmoothStepper likes the macro to be a little different.

Also I found a gotcha in  Brett's macro.

If, starting a job, I jog down close to material and call the tool zero, it is likely to move the Z in the wrong direction as the Z DRO is already a negative number.

I don't like my machine doing anything I am not expecting.  Smiley    So my macro zeros the Z DRO before the probe move.

You can try this one of you like but if Brett's won't work then this probably won't make any difference to that.


CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = 1.5 'Z-plate thickness

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get probe in place
Code "G31Z-20 F100" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Sleep 20
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z20" 'put the Z retract height you want here
Code "(Z axis is now zeroed)" ' this message goes in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
Exit Sub
End If
« Last Edit: August 27, 2008, 11:37:58 PM by Greolt » Logged
Chaoticone
South Carolina, US
Administrator
*
Online Online

Posts: 2,809


Precision Chaos



View Profile WWW
« Reply #12 on: August 28, 2008, 06:07:19 AM »

Bruce, What version of Mach are you running?  If it is 3.042.00* please go back to the previous version. 3.041 or earlier.

Brett
Logged

Grin If you could see the things I have in my head, you would be laughing too. Grin
www.precisionchaos1.com
My guard dog is not what you need to worry about!
MachBruce
Active Member

Offline Offline

Posts: 53


View Profile
« Reply #13 on: August 28, 2008, 06:45:41 AM »

Brett: I am running Version R2.63


Greg: Your Code worked for me as VB script in the button But I still cant run it as a macro.
To try to run as a Macro,I  stored the VB script as M975 in the Mach3 Macro folder. I then used MachScreen to code the ATZ button ie. checked the VB script button, typed in M695, saved changes.
I then restarted Mach3 and pressed the ATZ button and it returns a error in line 1.

Bruce
Logged
Hood
Active Member

Online Online

Posts: 4,894


Carnoustie, Scotland


View Profile
« Reply #14 on: August 28, 2008, 07:25:07 AM »

Brett: I am running Version R2.63


Greg: Your Code worked for me as VB script in the button But I still cant run it as a macro.
To try to run as a Macro,I  stored the VB script as M975 in the Mach3 Macro folder. I then used MachScreen to code the ATZ button ie. checked the VB script button, typed in M695, saved changes.
I then restarted Mach3 and pressed the ATZ button and it returns a error in line 1.

Bruce

If you are adding VB to a button to call a macro you will need to do it as follows
Code "M975"


Or whatever your macro number is , you have two different ones above Wink

Hood
Logged
MachBruce
Active Member

Offline Offline

Posts: 53


View Profile
« Reply #15 on: August 28, 2008, 03:51:25 PM »

Thankyou all for the assistance.
The use of VB script syntax is a little lacking at the moment. The Books i have looked at on VB all seemed to be aimed at the www of business application's.
Perhaps this could be a good topic for an "expert" to produce a small video tutorial on syntax and the common comands used for our purposes, for the Mach support site? It would certainly remove some of the mystery surrounding similar uses of VB for Mach.

Thanks,

Bruce
Logged
Hood
Active Member

Online Online

Posts: 4,894


Carnoustie, Scotland


View Profile
« Reply #16 on: August 28, 2008, 03:55:39 PM »

VB is a complete mystery to me as well, there are bits and pieces dotted around in the customising manual and the Wiki. I also find looking at the VB in the wizards helps a lot in the understanding.
Hood
Logged
Greolt
Global Moderator
*
Online Online

Posts: 353


View Profile
« Reply #17 on: August 29, 2008, 12:18:36 AM »



If you are adding VB to a button to call a macro you will need to do it as follows
Code "M975"


Ahh that was my fault.  Sorry about that Bruce.

I should check and not just go from the old memory.  Grin

Greg
Logged
Pages: « 1 2   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!