Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started 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
-
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
-
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.
-
Still does not set G54 Z to zero.
Any ideas?
-
Maybe I am not understanding but instead of SetVar why not just DoOEMButton (1008), (1009) etc?
Hood
-
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.
-
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
-
In the wiki it states that DoOEMButton 1010 zeros the Z.
I'm going to go try that now.
Thanks
-
Yes, 1008 is X, 1009 is Y etc
Hood
-
Worked!
Thanks, much appreciated!
Dan
-
No probs :)
Hood