Online Program Multithreading- Printable Version +- RoboDK Forum (//m.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//m.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//m.sinclairbody.com/forum/Forum-RoboDK-API) +--- Thread: Online Program Multithreading (/Thread-Online-Program-Multithreading) |
Online Program Multithreading-Jeremy.West-05-02-2023 Reposting as I realize this should be in the API section. I have 2 meca 500s that I am attempting to run movements on at the same time. To do this I have written a synced multithreading function with movements being called to each robot on each thread. When I run in online mode the robots only move one at a time. Is it possible to have synced movements with multithreading and online programming or do I need to do post processing? I have attached my code below. Robot.SafeJM is a custom function uses MoveJ_test to check a joint move is safe before running.
Code:
class MyThreads:
RE: Online Program Multithreading-Albert-05-03-2023 Do you use a different Robolink instance for each thread? To be able to properly use the API on different threads you should use a new Robolink instance for each thread. A quick workaround is to call this once inside your thread:
Code:
robot.link = Robolink()
Code:
RDK_t1 = Robolink()
|