Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: shorton on August 08, 2015, 09:26:03 PM

Title: reference all home - probblem adding to stock button code
Post by: shorton 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
Title: Re: reference all home - probblem adding to stock button code
Post by: shorton 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"
Title: Re: reference all home - probblem adding to stock button code
Post by: ger21 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
Title: Re: reference all home - probblem adding to stock button code
Post by: shorton on August 09, 2015, 06:47:49 PM
Thanks Gerry.  I'll correct it.  Much appreciated.

Title: Re: reference all home - probblem adding to stock button code
Post by: shorton 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)

Title: Re: reference all home - probblem adding to stock button code
Post by: ger21 on August 09, 2015, 08:03:42 PM
They zero encoder DRO's I think.
Most people don't need them.