Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: kregan on July 18, 2012, 09:52:50 PM

Title: button to set tool change to current location??
Post by: kregan on July 18, 2012, 09:52:50 PM
I run a semi manual tool change macro and need to set the tool change location often.

The way I currently do this is to read machine coordinance from the DRO and then switch
to the setup screen and manually type in the numbers.

What would be fantastic is a simple button on the setup screen that will put the current
machine coordinance into the tool change location. 

Any idea's?

Thank you
Title: Re: button to set tool change to current location??
Post by: Hood on July 19, 2012, 03:04:33 AM
Easy enough to do, just have a VB button that looks at the machine coords and then writes them to the toolchange DROs
Hood
Title: Re: button to set tool change to current location??
Post by: kregan on July 19, 2012, 08:46:36 PM

[/quote]
Easy enough to do, just have a VB button that looks at the machine coords and then writes them to the toolchange DROs
Hood
[/

Thank you Hood,
Could you point me in the right direction on how to start?

I assume I need to try out the screen editor to add a button and then write a script?

Any help with the script would be appreciated since I am not a programmer.


Title: Re: button to set tool change to current location??
Post by: Hood on July 20, 2012, 02:53:37 AM
Yes use one of the screen editors to put a button on screen and then make sure it is set as a VB cutton. Save it then exit the editor and open it from Mach then go to the Operator menu then Edit Button Scripts. You should see the new button flashing, click it and the editor will open.
Paste the following into the editor and then File and Save and it should do what you are wanting.

XTool= GetOemDRO(83)
YTool= GetOemDRO(84)
ZTool= GetOemDRO(85)

SetOemDRO (1200,XTool)
SetOemDRO (1201,YTool)
SetOemDRO (1202,ZTool)


Hood
Title: Re: button to set tool change to current location??
Post by: kregan on July 20, 2012, 05:22:35 PM
Very cool, thank you!

I edited the Mach 1024 screen and changed the Auto Tool Zero button to "Set Tool Change Pos."

Then added the script... works great on my test version of mach
Title: Re: button to set tool change to current location??
Post by: Hood on July 21, 2012, 02:15:11 AM
No problem, glad its working how you want :)
Hood