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

Start RoboDK existing station using API

#1
Hi,

I am using the RoboDK version 5.2.4

Is there a way to start an existing station using the python API ? when executing the line RDK = Robolink(), it starts a fresh new station. However, I need to open an existing one to read the tool, frames and targets in the tree. Please let know if there is a way to do it

Best regards
#2
For the Python API, using RDK = Robolink() should only open a new RoboDK window if its already not open. Can you tell me which Interpreter/Development Environment are you using?
#3
Hi,

I am using Spyder 4 that uses python version 3.8.5, is there another command that opens the station in order to extract the data ?

I saw in the help that we can open RoboDK without the user interface (-NOUI), my goal is to open the station without the user interface, extract the data and finally close it

Please let me know if this is possible

Best regards
#4
Hi,

Do you have any suggestion about opening an existing RoboDK station without the user interface (-NOUI), extracting the data using python and finally close it ?

Thank you
#5
You simply have to pass the argument "-NOUI" to start RoboDK behind the scenes.

You can then use the RoboDK API normally. For example, you can use AddFile to load an RDK file.
#6
Niceeee, thank you very much, that worked exactly as I expected

Thank you very much for your support and congratulations for your nice software ;-)
#7
I wrote a test.py as following:

from robodk.robolink import * # import the robolink library
RDK = Robolink(args='/NOUI')
#RDK = Robolink()
item = RDK.AddFile(r'C:\Car20231108.rdk')

robot = RDK.Item('Doosan Robotics M0617')
target = RDK.Item('Target112')
robot.MoveJ(target)
targetJoints= robot.Joints().list()

f = open("C:\RoboDK\Python37\demofile2.txt","w")
mystr= ""
for i in range(len(targetJoints) - 1):
mystr =mystr + str(targetJoints[i]) + ","

mystr =mystr + str(targetJoints[i])

f.write(mystr)
f.close()


And I opened test.py in IDLE 3.7.4 and tried to run test.py. There was a error as follows:

==================== RESTART: C:\RoboDK\Python37\test.py ====================
Starting C:/RoboDK/bin/RoboDK.exe

EXECUTING:"/NOUI":...
RoboDK is Running...
Traceback (most recent call last):
File "C:\RoboDK\Python37\test.py", line 4, in <module>
item = RDK.AddFile(r'C:\Car.rdk')
File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 1765, in AddFile
newitem = self._rec_item()
File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 829, in _rec_item
buffer = self.COM.recv(8)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
>>>

Would you please help me? Thanks.
#8
I just got back to you on the other thread here:
https://robodk.com/forum/Thread-About-AddFile-error

Let's discuss this issue on the other thread.
  




Users browsing this thread:
1 Guest(s)