Hello Guest it is March 28, 2024, 02:56:40 PM

Author Topic: Zeroing Z  (Read 4842 times)

0 Members and 1 Guest are viewing this topic.

Zeroing Z
« 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

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Zeroing Z
« Reply #1 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
Re: Zeroing Z
« Reply #2 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.
Re: Zeroing Z
« Reply #3 on: July 01, 2011, 08:58:32 AM »
Still does not set G54 Z to zero.

Any ideas?

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Zeroing Z
« Reply #4 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
Re: Zeroing Z
« Reply #5 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.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Zeroing Z
« Reply #6 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
Re: Zeroing Z
« Reply #7 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

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Zeroing Z
« Reply #8 on: July 01, 2011, 09:43:37 AM »
Yes, 1008 is X, 1009 is Y etc
Hood
Re: Zeroing Z
« Reply #9 on: July 01, 2011, 09:57:47 AM »
Worked!

Thanks, much appreciated!

Dan