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

The Synchronization Problem of Robot movement and program pointer

#1
I am trying to run the main program for several times using For Loop, as shown below:
Code:
Main = RDK.Item('Main')
 for i in range(5):
     Main.RunProgram()
While Robot executed the movement for just one time unexpectedly. 

Is there any instruction for this kind of Synchronization Problem of Robot movement and program pointer in the process of robot simulation?

   
#2
Calling run program should return immediately. You should not trigger it multiple times in a row like you are doing.

Instead, you can check if the program is still running by calling IsBusy.
#3
(04-22-2024, 01:12 PM)Albert Wrote: Calling run program should return immediately. You should not trigger it multiple times in a row like you are doing.

Instead, you can check if the program is still running by calling IsBusy.

Many thanks for your reply, Could you please show me some example of instruction “IsBusy"。I can't google it on internet or in robodk help.
#4
Sorry I meant to say Busy instead of Busy, you can find more information here:
https://robodk.com/doc/en/PythonAPI/robo....Item.Busy

And this is an example:
Code:
from robodk.robolink import *      # import the robolink library
from robodk.robomath import *
RDK = Robolink()                   # Connect to the RoboDK API
prog = RDK.Item('MainProgram', ITEM_TYPE_PROGRAM)
prog.RunProgram()
while prog.Busy():
    pause(0.1)

print("Program done")
  




Users browsing this thread:
1 Guest(s)