Re: [Emc-users] callback from the python module

2018-05-18 Thread Maxime Lemonnier
Hi Kurt, The idea to use a GLib timer is nice, since it allows the main tread to do work between polls, you could also have used a second python thread with sleeps. Yet, in my case, 50ms is a lot. I'd need more like 100us, which would hog the main python thread. I really need a genuine callback

Re: [Emc-users] callback from the python module

2018-05-18 Thread Kurt Jacobson
Maxime, I don't know what you needed the callback for, but since you are using the python interface I assume you just want to monitor the LCNC status. As part of hazzy I wrote a wrapper for the python interface that permits registering on-change callbacks for any of the LCNC stat attributes. For

Re: [Emc-users] callback from the python module

2018-05-17 Thread Sebastian Kuzminsky
On 05/17/2018 03:31 PM, Maxime Lemonnier wrote: Just want to make sure I did not miss something in the doc. Suppose I wan't to register a python callback from the linuxcnc python module, e.g. once per servo thread, it is not possible, right? def my_function(): print("servo thread tick!")

[Emc-users] callback from the python module

2018-05-17 Thread Maxime Lemonnier
Just want to make sure I did not miss something in the doc. Suppose I wan't to register a python callback from the linuxcnc python module, e.g. once per servo thread, it is not possible, right? def my_function(): print("servo thread tick!") linuxcnc.something.set_callback(my_function);