Hello Guest it is December 07, 2019, 07:10:55 PM

Author Topic: Custom Homing code  (Read 1639 times)

0 Members and 1 Guest are viewing this topic.

Custom Homing code
« on: April 05, 2013, 07:36:56 AM »
Hi all
I did this piece of code that is attached to the "Ref All Home" button. I have a tangential knife on the rotary (A) axis that has to be locked by a pin and then zeroed.
This code does not work on first startup of Mach. If I traversed the a axis once, then it will work. It seems to sit and wait for the first turn to complete but it does not turn at all. I think it hase something to do with feed rates.
Can someone help please?

DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
While ismoving()

Code "G1 A0 F2000"
While ismoving()

ActivateSignal(Output2) 'set the pin

Code "G1 A-180 F2000"  ' turn the knife anti-clockwise for a half turn
While ismoving()

DoButton(11)  ' clear the DRO

Code "G1 A-180 F2000"  'turn the knife again to make sure of one full turn and lock-up
While ismoving()

DoButton( 11 )  ' do the mach referencing

SetDro(3,270) ' to head the knife in th eright direction
DeActivateSignal(Output2) ' unlock the pin
Code "G0 A0"
Code "G0 X-12"
Code "G0 Y102"
While ismoving()
DoButton( 8 )
DoButton( 9 )