Hello Guest it is March 28, 2024, 08:19:19 PM

Author Topic: Homing Macro?  (Read 16169 times)

0 Members and 1 Guest are viewing this topic.

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Homing Macro?
« on: September 10, 2011, 07: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!
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Homing Macro?
« Reply #1 on: September 10, 2011, 07: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

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Homing Macro?
« Reply #2 on: September 10, 2011, 07:47:54 PM »
Just tried it out and looks like maybe you can only home two axis at a time with that.
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Homing Macro?
« Reply #3 on: September 10, 2011, 07: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

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Homing Macro?
« Reply #4 on: September 10, 2011, 08: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
Re: Homing Macro?
« Reply #5 on: September 10, 2011, 09:36:28 PM »
so this would work for Z first, then X & Y?
RefCombination(4)
RefCombination(3)

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Homing Macro?
« Reply #6 on: September 10, 2011, 09: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.
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Homing Macro?
« Reply #7 on: September 10, 2011, 09:58:15 PM »
RefCombination(7) is all you need.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Homing Macro?
« Reply #8 on: September 10, 2011, 10: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.
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Homing Macro?
« Reply #9 on: September 10, 2011, 10:05:00 PM »
I did the same editing process on the "Run" screen and it worked beautifully. Thanks all.
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)