Hello Guest it is March 28, 2024, 03:56:18 PM

Author Topic: reference all home - probblem adding to stock button code  (Read 2421 times)

0 Members and 1 Guest are viewing this topic.

reference all home - probblem adding to stock button code
« on: August 08, 2015, 09:26:03 PM »
 I'm a Mach3 beginner.  I have a small CNC router I built a year or so ago.  My machine is a fixed gantry and my home switches are located in such a way that my table homes to the rear of the machine (min Y) when I execute reference all home.  After that, I almost always move the table back to the front of the machine (max Y) to deal with work pieces.  That works fine but I wanted to automate that move back to the front after I reference home.

I went to Operator, Edit Button Script and changed the "reference all home" code as follows:

Code: [Select]
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )

DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)

Code"G0 Y14.7"

It sort of works.  But it executes the move to 14.7 first, then does the reference all home.  Is there a way I can get that command to happen after the reference all home?

Thanks,
Scott
« Last Edit: August 08, 2015, 09:28:09 PM by shorton »
Re: reference all home - probblem adding to stock button code
« Reply #1 on: August 09, 2015, 03:48:02 PM »
I figured it out.  This seems to work:

Code: [Select]
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )

While (IsMoving())
Wend

code "g53 x1 y14.7"

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: reference all home - probblem adding to stock button code
« Reply #2 on: August 09, 2015, 06:23:14 PM »
It should be:

While IsMoving()
Wend

You should also have one after

code "g53 x1 y14.7"

Like this:


Code: [Select]
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )

While IsMoving()
Wend

code "g53 x1 y14.7"

While IsMoving()
Wend
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: reference all home - probblem adding to stock button code
« Reply #3 on: August 09, 2015, 06:47:49 PM »
Thanks Gerry.  I'll correct it.  Much appreciated.

Re: reference all home - probblem adding to stock button code
« Reply #4 on: August 09, 2015, 06:48:45 PM »
While I'm at it, what do these do?  They have no apparent effect, although I expect they are there for a reason and doing something :)

DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: reference all home - probblem adding to stock button code
« Reply #5 on: August 09, 2015, 08:03:42 PM »
They zero encoder DRO's I think.
Most people don't need them.
Gerry

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

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