Universal Robots Forum

Monitor constant information feedback using MyDaemon, python via serial com


I like to monitor constant information feedback from my application using MyDaemon, python using serial communication. However, in order to ensure swift reaction from the moment the button is pressed, multi-threading is needed. Where do I implement such process? within java or python?

Thank you!


Depend on what you want, but you’ll need it at least in Java, to prevent UI to freeze while waiting response.

But you may need it in python too, if you want to do other thing than just reading the serial (especially if you you have some long processing to do, to avoid having a “late”).

I think you should make your python program loop reading the serial, and for each received info, launch a new Thread to handle it ( if execution is long, if it’s very short, you can just execute it, but it would be cleaner if your pipeline follow the same handlers rule )

1 Like

Do you have a special need in using a serial communication ?
The easiest way to communicate between python and java is to xmlrpc, as it’s implemented in mydeamon example

Hi mdi,

Thank you for the prompt reply!! Yes, i am required to use serial communication for my current application. I am currently deploying using mydaemon multi-threading by invoking another event runnable under UItimer,

Also, as expected from you, multi-threading in Java only is not up to satisfactory for real time application update. I will be implementing multi-thread in python to further improve the data exchange handling.

thank you!