Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: mariusl on April 05, 2013, 12:27:53 PM
-
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()
Wend
Code "G1 A0 F2000"
While ismoving()
Wend
ActivateSignal(Output2) 'set the pin
Sleep(500)
Code "G1 A-180 F2000" ' turn the knife anti-clockwise for a half turn
While ismoving()
Wend
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()
Wend
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()
Wend
DoButton( 8 )
DoButton( 9 )
-
Seems to be working fine here, what version of Mach are you using? also if you attach your xml I will test and see if it works fine with it.
Hood
-
Hi Hood,
I am using the latest downloadable version. Not sure of the numbers now as I am not with the machine.
I attached the xml.
I was wondering if I should not use functions like SetFeedRate() instead of trying to set the feedrate with the Gcode.
-
It may be the version of Mach you are using as I know it has issues and issues with homing is one. I would suggest you try an older version, 056/057 work well for me but some people say 062 is also ok.
Hood
-
Ok I have just loaded 067 (Dev version) and it will not even work with your xml so definitely an issue there. 066 as I mentioned also has problems and in my opinion should not be on the site for download as the lockdown.
Hood
-
Do you know where the button script is stored?
-
answered in your other post.
Hood