Settings Spindle Speed in Constructor macro

If you have a question about the software please ask it here.

Settings Spindle Speed in Constructor macro

Postby ger21 » Tue Jan 24, 2017 1:15 am

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");
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Settings Spindle Speed in Constructor macro

Postby cncdrive » Tue Jan 24, 2017 2:14 am

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.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Settings Spindle Speed in Constructor macro

Postby cncdrive » Tue Jan 24, 2017 2:20 am

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. :(
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm


Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 9 guests

cron