Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Use API to link multiple program

#1
I’m currently trying to replicate the “Link selected programs” functionality using the RoboDK API.
From my understanding, I can already achieve a similar result by creating a main program and using
Code:
RunInstruction(..., INSTRUCTION_CALL_PROGRAM)
to call multiple sub-programs. However, I noticed that your built-in Link selected programs feature seems to do more than just calling programs sequentially.
In particular, it appears to automatically generate safe transition motions (e.g., collision-free or obstacle-avoiding paths) between programs. This is extremely useful for ensuring safe execution, especially in machining workflows.
I would like to ask:
  1. Is there any API that directly replicates the full behavior of “Link selected programs”, including the automatic generation of safe transition paths?
  2. If not, is there a recommended way to programmatically generate these safe linking motions between programs (e.g., via motion planning, collision checking, or predefined safe targets)?
My goal is to fully automate the generation of a main program that not only links sub-programs, but also ensures safe transitions between them, similar to what the GUI provides.
Thank you for your help!


Attached Files Image(s)
   
#2
You can replicate the "Link selected programs" feature using the RoboDK API by using the CollisionFreePlanner plugin. This plugin allows you to automatically generate safe, collision-free transition motions between programs or targets. For example, you can use this command:
Code:
RDK.PluginCommand("CollisionFreePlanner", "Join=ProgJoined", "T1toT2|T2toT1")
to link programs with safe transitions, similar to what the GUI provides. This approach automates the creation of a main program that calls sub-programs with safe linking motions.

You can find more examples using the collision free motion planner addin through the API:
https://robodk.com/forum/Thread-Collisio...nce?page=2

For more details, you can check our documentation on collision avoidance and program linking here:
https://robodk.com/doc/en/Collision-Avoi...rogramsPRM
#3
Hi Albert, 

Thanks for your help. I figured out how to use this command. I leave a note here if someone need it.

Code:
RDK.PluginCommand("CollisionFreePlanner", "Join=ProgJoined", "T1toT2|T2toT1")

The "ProgJoined" is the name of the Main Program contained the linked programs.
The "T1toT2" and the "T2toT1" are the name of the programs you want to link.

For example, if there are three programs (P0, P1, P2) you want to link. The order of the program is P0, P1, P2.
Then the command would be 
Code:
RDK.PluginCommand("CollisionFreePlanner", "Join=ProgNameAsYouWant", "P0|P1|P2")
It will generate the safe path between the program.
#4
Great, thank you for letting us know.
  




Users browsing this thread:
1 Guest(s)