Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 11:56:06 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  Zeroing Z
Pages: 1 2 »   Go Down
Print
Author Topic: Zeroing Z  (Read 392 times)
0 Members and 1 Guest are viewing this topic.
dfurlano
Active Member

Offline Offline

Posts: 246


View Profile
« on: June 30, 2011, 08: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. Huh


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


TIA,

Dan

Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #1 on: June 30, 2011, 09: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
Logged
dfurlano
Active Member

Offline Offline

Posts: 246


View Profile
« Reply #2 on: June 30, 2011, 09: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.
Logged
dfurlano
Active Member

Offline Offline

Posts: 246


View Profile
« Reply #3 on: July 01, 2011, 07:58:32 AM »

Still does not set G54 Z to zero.

Any ideas?
Logged
Hood
Active Member

Offline Offline

Posts: 17,366


Carnoustie, Scotland


View Profile
« Reply #4 on: July 01, 2011, 08:34:42 AM »

Maybe I am not understanding but instead of SetVar why not just DoOEMButton (1008), (1009) etc?

Hood
Logged
dfurlano
Active Member

Offline Offline

Posts: 246


View Profile
« Reply #5 on: July 01, 2011, 08: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.
Logged
Hood
Active Member

Offline Offline

Posts: 17,366


Carnoustie, Scotland


View Profile
« Reply #6 on: July 01, 2011, 08: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
Logged
dfurlano
Active Member

Offline Offline

Posts: 246


View Profile
« Reply #7 on: July 01, 2011, 08:42:26 AM »

In the wiki it states that DoOEMButton 1010 zeros the Z.

I'm going to go try that now.

Thanks
Logged
Hood
Active Member

Offline Offline

Posts: 17,366


Carnoustie, Scotland


View Profile
« Reply #8 on: July 01, 2011, 08:43:37 AM »

Yes, 1008 is X, 1009 is Y etc
Hood
Logged
dfurlano
Active Member

Offline Offline

Posts: 246


View Profile
« Reply #9 on: July 01, 2011, 08:57:47 AM »

Worked!

Thanks, much appreciated!

Dan
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!