Settings Spindle Speed in Constructor macro
Posted:
Tue Jan 24, 2017 1:15 am
by ger21
I'm trying to set a default spindle speed and feedrate using the constructor macro, but it doesn't seem to work?
Using this code:
exec.Code("S10000");
exec.Code("F150");
Re: Settings Spindle Speed in Constructor macro
Posted:
Tue Jan 24, 2017 2:14 am
by cncdrive
The issue is that motion code (F and S codes are also motion codes) can't run if the controller is in Reset.
And on startup the controller is set to reset.
So, you have to remove the reset condition first to execute and F and S commands.
Also to make sure the constructor motion command will run when the software started up you should first wait for the reset or idle LED to come on.
Like this:
while(!AS3.GetLED(25)) //Wait for the reset LED to come on
{
Thread.Sleep(50);
}
exec.Callbutton(513); //Remove the reset
exec.Code("S10000");
while(exec.IsMoving()){}
exec.Code("F150");
while(exec.IsMoving()){}
exec.Callbutton(512); //Set the reset
The only issue I see with this is that the reset will be pulled out for a moment, so if there is a charge pump then that will be activated for a short time,
but I see no solution, because you just can't set an S or F command while the controller is in reset.
Re: Settings Spindle Speed in Constructor macro
Posted:
Tue Jan 24, 2017 2:20 am
by cncdrive
And thinking a bit more I see a worse issue is that if there is an external e-stop or limit switch activated then you can't pull the reset out, so then the commands will not execute.