Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:09:47 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 Z for an ATC
Pages: 1 2 »   Go Down
Print
Author Topic: Auto Z for an ATC  (Read 486 times)
0 Members and 1 Guest are viewing this topic.
first off
Active Member

Offline Offline

Posts: 13


View Profile
« on: August 28, 2011, 05:40:07 PM »

Hey all.
How do I get my Auto-Z value input into the tool "Z 0ffset" DRO field complete with the touch plate thickness added?
As it is now, it enters into the Work Z offset field and does not adjust for the plate thickness. I am using an ATC and I want to key the tool number, Change the tool manually and then run the Auto-Z and have it enter for that tool.
This is what i am starting with:

PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
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 P5" ' this delay gives me time to get from computer to hold probe in place
Code "G31Z-1. F10" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
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 Z1." 'put the Z retract height you want here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If


Thanks for your help. Russ.
Logged
Hood
Active Member

Online Online

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #1 on: August 28, 2011, 06:21:42 PM »

Getting late here and I am crap at VB anyway so will tell you what I do. I have a toolsetter at the side of my machine where I set up tools off the machine and it has an encoder on it which feeds into Mach. So its a manual process and not really what you want but  here is how I get the info into the tooltable, this is the code in my button. You may be able to use parts of it in your macro, specifically the Code line and maybe look at your Z DRO instead of the encoder DRO that I look at..

If GetOemLED(800) Then
MsgBox ("Mach In Reset, Enable and start again")
End
End If

Offset = GetOemDRO(100) 'This is the Encoder DRO that height setter is connected to

SetOemDRO(1555,Question("Enter Offset Number"))

Tool = GetOemDRO(1555)

Code "G90" & "G10" & "L1" & "P" & Tool &"Z" & Offset
DoOemButton(121)   

Hope this helps a bit, sleep time for me Cheesy
Hood
Logged
first off
Active Member

Offline Offline

Posts: 13


View Profile
« Reply #2 on: August 29, 2011, 08:16:23 AM »

Hey Hood
What is DoOemButton (121) from you script?
Logged
Overloaded
Global Moderator
*
Offline Offline

Posts: 3,073



View Profile
« Reply #3 on: August 29, 2011, 08:35:26 AM »

.... till Hood gets back to ya

121 =  Tool Table Save
Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
Hood
Active Member

Online Online

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #4 on: August 29, 2011, 08:36:01 AM »

That opens the tool table, not really needed but I just like to see and make sure its added the entry correctly. It always has but probably wont the first time I dont look Grin

Hood

ah Russ got there first I see Cheesy
Logged
Overloaded
Global Moderator
*
Offline Offline

Posts: 3,073



View Profile
« Reply #5 on: August 29, 2011, 08:48:31 AM »

Hi Hood, knew you couldn't be too far away. 
Would your macro actually save the table entry if you didn't Do 121 ?
Maybe it IS necessary ?
Thanks,
Russ
Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
Hood
Active Member

Online Online

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #6 on: August 29, 2011, 08:56:37 AM »

Russ, it will enter it into the table and it should be fine, it probably wont actually save permanently unless you choose the save option when closing Mach but have never tried.
Hood
Logged
first off
Active Member

Offline Offline

Posts: 13


View Profile
« Reply #7 on: August 29, 2011, 10:31:17 AM »

Hey guys thanks for the help.
Do you know what the Oem Button code is for the "set tool offset" button? That should put the value into that offset DRO feild and the tool table as you do. Do you know if I need to toggle the "tool offset" led before the "set tool offset?

Russ
Logged
Hood
Active Member

Online Online

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #8 on: August 29, 2011, 01:05:06 PM »

That is a VB button so no OEM code for it.
You can look at the VB in it by going to Operator menu then Edit VB Button and then clicking on that button when its flashing.
Hood
Logged
first off
Active Member

Offline Offline

Posts: 13


View Profile
« Reply #9 on: August 29, 2011, 06:55:33 PM »

Hey hood
Being a VB, button how can I address the"set tool offset" button from the auto-z macro that I am working on? It would simplify this macro if I can do a " DoOemButton (*********)" or something like that for the "set tool offset" button.
Logged
Pages: 1 2 »   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!