Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: dfurlano on June 30, 2011, 09:46:17 PM

Title: Zeroing Z
Post by: dfurlano on June 30, 2011, 09:46:17 PM
I want to go to the Z limit switch and then set G54 Z to zero.

It does not consistently work.  If I run the macro twice it sets zero, just once it will not set zero.

I added the dwells figuring it needed time. Still does not work.

In desperation I post. ???


DoButton( 24 )
Code "G04 P2"
SetVar(5223,0)
Code "G04 P2"
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )


TIA,

Dan

Title: Re: Zeroing Z
Post by: BR549 on June 30, 2011, 10:43:31 PM
The code"G4P2" dwell is NOT for a vb macro it is for a gcode file.

Use the While Ismoving() wend to separtate the functions AND keep them in time order.

DoButton( 24 )
WhileIsmoving()
Sleep(20)
Wend
SetVar(5223,0)
WhileIsmoving()
Sleep(20)
Wend
DoButton( 23 )
WhileIsmoving()
Sleep(20)
Wend
DoButton( 22 )
WhileIsmoving()
Sleep(20)
Wend
DoButton( 25 )
WhileIsmoving()
Sleep(20)
Wend


(;-) TP
Title: Re: Zeroing Z
Post by: dfurlano on June 30, 2011, 10:57:04 PM
I thank you sir, I will try this in the morning.

I need to turn it off... sometimes you just need to turn it off.
Title: Re: Zeroing Z
Post by: dfurlano on July 01, 2011, 08:58:32 AM
Still does not set G54 Z to zero.

Any ideas?
Title: Re: Zeroing Z
Post by: Hood on July 01, 2011, 09:34:42 AM
Maybe I am not understanding but instead of SetVar why not just DoOEMButton (1008), (1009) etc?

Hood
Title: Re: Zeroing Z
Post by: dfurlano on July 01, 2011, 09:39:34 AM
I am sure I am the one that is confused.  What does DoOEMButton actually do?

Again, I am only interested in setting the G54 Z to zero.
Title: Re: Zeroing Z
Post by: Hood on July 01, 2011, 09:41:48 AM
It will zero the work offset that you are currently in. If you will not be in G54 then you will need to call that before you do that OEM button.
Hood
Title: Re: Zeroing Z
Post by: dfurlano on July 01, 2011, 09:42:26 AM
In the wiki it states that DoOEMButton 1010 zeros the Z.

I'm going to go try that now.

Thanks
Title: Re: Zeroing Z
Post by: Hood on July 01, 2011, 09:43:37 AM
Yes, 1008 is X, 1009 is Y etc
Hood
Title: Re: Zeroing Z
Post by: dfurlano on July 01, 2011, 09:57:47 AM
Worked!

Thanks, much appreciated!

Dan
Title: Re: Zeroing Z
Post by: Hood on July 01, 2011, 09:59:20 AM
No probs :)
Hood