Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:37:00 AM

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

Offline Offline

Posts: 443


Houston, TX



View Profile
« on: September 10, 2011, 06:18:09 PM »

I would like to have my homing routine (RefAllHome) go either all simultaneously or the Z first and then X & Y at the same time. From what I understand I needed to clone my screen and then edit the RefAllHome buttons script. I have cloned the screen successfully on a new experimental xml. All of the prior features work. I believe from here I would select "Operator/EditButton Script/press the RefAllHome button at which point the VB editor window pops up, which in my case due to using the tutorials displays "Msgbox"This is the new RefAllHome button script". From here  I would think I would delete the wording, replace it with the correct script for all of the homing, click save and close the editor, click "view"and then "Save Current Layout. Close Mach and reopen and see if it all works. I need to know 2 things so far.
1. The correct script to acheive the homing sequence I would like (either all simultaneous or Z first then both)

2. If there are any steps explained above that were missed and or misunderstood.

Again as always, thanks for any and all of your help!
Logged

I want to die in my sleep like my grandfather, not like the passengers in the car! :-)
Hood
Active Member

Online Online

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #1 on: September 10, 2011, 06:45:57 PM »

You wont need to exit Mach after editing the button.
From memory the code is RefCombination(0+1+2) where 0 is X axis and 1 is Y etc

Hood
Logged
Hood
Active Member

Online Online

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #2 on: September 10, 2011, 06:47:54 PM »

Just tried it out and looks like maybe you can only home two axis at a time with that.
Hood
Logged
Hood
Active Member

Online Online

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #3 on: September 10, 2011, 06:54:03 PM »

Ok you can, where I went wrong is X = 1, Y=2, Z=4, A=8 etc
So
RefCombination(1 + 2 + 4)

should do all three axis (X Y and Z )at the same time
Hood
Logged
Hood
Active Member

Online Online

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #4 on: September 10, 2011, 07:02:57 PM »

Just looked at Rays VB manual and it seems you can actually do it with even less code as all you would need is
RefCombination(7)

Reason is, X=1 Y=2  Z=4 so 1+2+4 =7

Hood
Logged
Ya-Nvr-No
Active Member

Offline Offline

Posts: 268


Scuptris 3D


View Profile
« Reply #5 on: September 10, 2011, 08:36:28 PM »

so this would work for Z first, then X & Y?
RefCombination(4)
RefCombination(3)
Logged
Fastest1
Active Member

Offline Offline

Posts: 443


Houston, TX



View Profile
« Reply #6 on: September 10, 2011, 08:54:04 PM »

Thanks all of you! I used Ya-Nvr-No's approach and it worked great. I would have tried the 3 axis simultaneous homing but I dont really understand what to copy of Hood's response, just type in RefCombination (7) or does the statement or reasoning have to be in there also. I guess it is easy enough to change. I will try it right now. Thanks again, I am dangerous now.
Logged

I want to die in my sleep like my grandfather, not like the passengers in the car! :-)
ger21
Global Moderator
*
Offline Offline

Posts: 2,619



View Profile WWW
« Reply #7 on: September 10, 2011, 08:58:15 PM »

RefCombination(7) is all you need.
Logged

Fastest1
Active Member

Offline Offline

Posts: 443


Houston, TX



View Profile
« Reply #8 on: September 10, 2011, 09:02:28 PM »

OK I am back, both ways worked just like described. I ended up going back to the 1 Ya-Nvr-No wrote. Most likely because it seems safer to raise the Z first, then X & Y simultaneously. This does prevent crashing into the vise or workpiece. I do notice that this works on the "Load" screen but not on the "Run" screen. Do I have to modify the same button on different pages? Maybe I will go look there too.
Logged

I want to die in my sleep like my grandfather, not like the passengers in the car! :-)
Fastest1
Active Member

Offline Offline

Posts: 443


Houston, TX



View Profile
« Reply #9 on: September 10, 2011, 09:05:00 PM »

I did the same editing process on the "Run" screen and it worked beautifully. Thanks all.
Logged

I want to die in my sleep like my grandfather, not like the passengers in the car! :-)
Pages: 1 2 3 »   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!