Restart from the any position of the trajectory

Post anything you want to discuss with others about the software.

Re: Restart from the any position of the trajectory

Postby cncdrive » Thu Feb 16, 2017 3:19 pm

Hi Andrew,

OK, please let me know how it goes. :)
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Restart from the any position of the trajectory

Postby shad » Fri Feb 17, 2017 7:53 am

Hello Balazs!
Yes, it's working. But it was interesting to understand how it's worked for me.
First, I am try to call button #169 from plugin without UC.RemoveRunfromhere();
Code: Select all
UC.Setfield(true, (double)ArcLostCodeLine, 866);//set line nimber
UC.Validatefield(true, 866);//validate new value
UC.Callbutton(169);//call RFH button                           
UC.Codesync("M3");//execute M3
UC.Callbutton(128); //Start program

When program start, RFH window opens and if I am click on the OK button, UCCNC freeze and crash. https://www.dropbox.com/s/uj4n0wwmejl85be/%D0%92%D0%B8%D0%B4%D0%B5%D0%BE_2017-02-17_102003.wmv?dl=0

Then I am add UC.RemoveRunfromhere() function.
Code: Select all
UC.Setfield(true, (double)ArcLostCodeLine, 866);//set line nimber
UC.Validatefield(true, 866);//validate new value
UC.Callbutton(169);//call RFH button
UC.Codesync("M3");//execute M3
UC.RemoveRunfromhere(); 
UC.Callbutton(128); //Start program


In this case RFH window is not appear, but UCCNC code line number returned on the last value, where motion was stopped. I can't to set line number stored when arc lost issue.

Then I am add 100 msec delay between call #169 button and M3. It's worked correctly :)
UCCNC requaired minimum 100 msec delay.
Code: Select all
UC.Setfield(true, (double)ArcLostCodeLine, 866);//set line nimber
UC.Validatefield(true, 866);//validate new value
UC.Callbutton(169);//call RFH button
UC.Wait(100);
UC.Codesync("M3");//execute M3
UC.RemoveRunfromhere(); 
UC.Callbutton(128); //Start program
-- Andrew
UC400ETH
UC300ETH-5LPT
NEURON Lite THC
http://neuroncnc.com/
shad
 
Posts: 331
Joined: Thu Sep 15, 2016 5:23 pm

Re: Restart from the any position of the trajectory

Postby cncdrive » Fri Feb 17, 2017 1:16 pm

Hi Andrew,

I will have to check why these issues, but I have an idea why the freezing happens.
The RFH is probably not invoked on the UI thread when using the Callbutton,
so it is probably seated into the loop thread if you calling it from the loop.
I will check the exact code and will try to change it with invoking it...
Or you could invoke it in your loop and if I'm right about the problem then it will then not freeze. :)

Like this:

Code: Select all
this.Invoke(new MethodInvoker(() => UC.Callbutton(128)));


Also I will check why is the 100msec Wait is required and will try to elliminate it.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Restart from the any position of the trajectory

Postby shad » Fri Feb 17, 2017 1:57 pm

Thank you Balazs for explain about using the callbutton for #169.
Now with UC.RemoveRunfromhere() function all works perfect.
I don't know why 100 msec. The problem issue again if I am set for example 50 msec. May be need time for planner to change line and etc.. before M3 command execution.
-- Andrew
UC400ETH
UC300ETH-5LPT
NEURON Lite THC
http://neuroncnc.com/
shad
 
Posts: 331
Joined: Thu Sep 15, 2016 5:23 pm

Re: Restart from the any position of the trajectory

Postby cncdrive » Fri Feb 17, 2017 2:16 pm

Andrew,

OK, great.
I will look after that 100msec issue soon and will let you know what I will find.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Previous

Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 16 guests