Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: mythal on September 19, 2011, 11:45:19 AM

Title: VB DoButton + Referance All Axis
Post by: mythal on September 19, 2011, 11:45:19 AM
Hi

I'm trying to make a button works as:

1.reference 4 AXIS (X/Y/A/B).
2.go to position X200, y100, A200, B100.


so I make a button and code it as :
DoButton(22)
DoButton(23)
DoButton(25)
DoButton(26)
code("G00 X200")
code("G00 Y100")
code("G00 A200")
code("G00 B100")

However, it's working as go to that position first, then reference axis later.

(but if I run the code line by line, It works all good)

Is there any help can correct my code?

thx!
Title: Re: VB DoButton + Referance All Axis
Post by: Hood on September 19, 2011, 11:50:02 AM
You will need
While IsMoving()
Wend

You will need it after each move if you want them to go there individually which would seem to be as you have each on seperate lines. You will also need it after the DoButton() probably just after the last one, so ths should work


DoButton(22)
DoButton(23)
DoButton(25)
DoButton(26)
While IsMoving()
Wend
code("G00 X200")
While IsMoving()
Wend
code("G00 Y100")
While IsMoving()
Wend
code("G00 A200")
While IsMoving()
Wend
code("G00 B100")

Hood
Title: Re: VB DoButton + Referance All Axis
Post by: mythal on September 19, 2011, 12:42:15 PM
SUPER!

Thank you! Hood.