Was wondering if anyone had any good design patterns or experience for communicating with motion controllers in a GUI?
I’m controlling my stage using TCP or Serial but I want a live position read back and motor status which makes me sort of need to poll the controller in a thread, but that complicates all the application level logic and I don’t really want to stick all my commands in a queue when I need to make sure some like stop will get received instantly.
Is using a thread and queueing commands to the controller just the only way of doing this? I need to read the responses from the controller to validate it received the command so I can’t mix thread and non thread. It doesn’t seem like there’s an easy way to do a callback so my code in other threads can get a value if they want to wait on the motion thread.
I can’t find any examples or literature of people doing serious GUI programming online and controlling stages. Using pyside6 but this is sort
submitted by /u/King-Days
[link] [comments]
r/learnpython Was wondering if anyone had any good design patterns or experience for communicating with motion controllers in a GUI? I’m controlling my stage using TCP or Serial but I want a live position read back and motor status which makes me sort of need to poll the controller in a thread, but that complicates all the application level logic and I don’t really want to stick all my commands in a queue when I need to make sure some like stop will get received instantly. Is using a thread and queueing commands to the controller just the only way of doing this? I need to read the responses from the controller to validate it received the command so I can’t mix thread and non thread. It doesn’t seem like there’s an easy way to do a callback so my code in other threads can get a value if they want to wait on the motion thread. I can’t find any examples or literature of people doing serious GUI programming online and controlling stages. Using pyside6 but this is sort submitted by /u/King-Days [link] [comments]
Was wondering if anyone had any good design patterns or experience for communicating with motion controllers in a GUI?
I’m controlling my stage using TCP or Serial but I want a live position read back and motor status which makes me sort of need to poll the controller in a thread, but that complicates all the application level logic and I don’t really want to stick all my commands in a queue when I need to make sure some like stop will get received instantly.
Is using a thread and queueing commands to the controller just the only way of doing this? I need to read the responses from the controller to validate it received the command so I can’t mix thread and non thread. It doesn’t seem like there’s an easy way to do a callback so my code in other threads can get a value if they want to wait on the motion thread.
I can’t find any examples or literature of people doing serious GUI programming online and controlling stages. Using pyside6 but this is sort
submitted by /u/King-Days
[link] [comments]