Sync vs async

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

Sync vs async

Postby girogiri » Mon Dec 12, 2022 3:00 pm

Hi all,

can someone kindly explain the difference between M10.x/M11.x and Setoutpin()/Clroutpin() I know that the first are Syncronous commands while the latter are Asyncronous, but what does this mean? We tried to use M10/M11 to turn on some outputs but weird things happened.

Beside this, it is still not very clear the difference between Exec.code() and exec.codesync() is there a post or some documentation I'm unaware that can help?

thanks all

Giorgio
girogiri
 
Posts: 36
Joined: Fri Jun 19, 2020 2:50 pm

Re: Sync vs async

Postby fsli » Mon Dec 12, 2022 10:25 pm

girogiri wrote:Beside this, it is still not very clear the difference between Exec.code() and exec.codesync() is there a post or some documentation I'm unaware that can help?

viewtopic.php?f=4&t=3954&p=27919&hilit=codesync#p27919
Frank
fsli
 
Posts: 97
Joined: Mon Jul 11, 2022 12:36 am

Re: Sync vs async

Postby cncdrive » Tue Dec 13, 2022 1:16 am

The M10.X and M11.X are syncronous outputs which means that if you run motion code then the M10.X and M11.X are inserted between the motion commands and are executed in syncron with the motion without the motion being paused or stopped.
So, you put in for example a G1 X0 and then G1 X10 and then M10.1 and then G1 X20 then the output will turn on the exact same time when the X axis reached position 10.
With Setoutpin and Clroutpin the output is set asyncrounously, so as soon as you executing these commands then the output is set/reset.
cncdrive
Site Admin
 
Posts: 5197
Joined: Tue Aug 12, 2014 11:17 pm

Re: Sync vs async

Postby girogiri » Fri Dec 16, 2022 9:59 am

Hi Balazs,

thanks for your replay, what you say is clear.
We have the following issue with M10: we use M10/M11 in a macro to turn on and off a laser pointer and it's working ok.
The issue is that sometimes, while executing other macros with no M10 but only plain movements ( G53 / G90) the laser pointer turns on misteriously.
Are we doing something wrong or it'a a bug?

thanks Giorgio
girogiri
 
Posts: 36
Joined: Fri Jun 19, 2020 2:50 pm

Re: Sync vs async

Postby AutomaticInvest_4 » Mon Nov 25, 2024 7:30 am

girogiri wrote:Hi all,

can someone kindly explain the difference between M10.x/M11.x and Setoutpin()/Clroutpin() I know that the first are Syncronous commands while the latter are Asyncronous, but what does this mean? We tried to use M10/M11 to turn on some outputs but weird things happened.

Beside this, it is still not very clear the difference between Exec.code() and exec.codesync() is there a post or some documentation I'm unaware that can help?

thanks all

Giorgio


There is no documentation Giorgio, they wrote the UCCNC but no documentation..things are quite complicated without documentation explaining how things are implemented in UCCNC

Stop can be called by pressing the button on the UCCNC main screen, Stop can be called inside a macro that is running either at the command line or from a Gcode that is running, Stop can also be called from a plugin using UC.Stop()

Depending on where the Stop is called from, it has a different way of working.

Also if the 3 locations where Stop can be called are all in different threads in UCCNC or in the same thread, or maybe 2 of the 3 are in the same thread and the third one is in another thread is also unknown and there is no documentation about how things work..

It is basically like a mystery which we can discover..
AutomaticInvest_4
 
Posts: 8
Joined: Fri Dec 23, 2022 8:43 pm
Location: Romania

Re: Sync vs async

Postby cncdrive » Mon Nov 25, 2024 11:46 pm

That is not true, all of the g and m codes are documented.
Ofcourse we can't document all the macro functions and can't explain everything.

M10/M11 are motion syncronous commands as described in the UCCNC users manual, this means that if there are motion commands in the motion buffer and the M10/M11 is sent to the motion buffer then the execution will only happen when this line of code is reached by the g-code interpreter while Set/Clr outputpin are asyncronous commands which means that they are executed when the command is sent independently from the running motion commands in the motion buffer.
cncdrive
Site Admin
 
Posts: 5197
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 6 guests