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

Automatically run a startup script when RoboDK starts

#1
I have created an RDK station with a Staubli TX60 robot, a Python script, and a connection to a physical robot. I want this station and connection to automatically run when I start the application, but I am not quite sure how to set that up, if it is possible. I read some resources about a startup.py script, I have created that but I still need to figure out how to get RoboDK to run the script automatically once I open the application.
#2
You can trigger a program call automatically using the command line by using the RUNPROG command. For example:
Code:
robodk.exe "path to your file.rdk" -RUNPROG=MainProgram

If you create a Startup-Commands.txt file in the bin directory (right where the RoboDK executable is) RoboDK will automatically run those commands when starting (one command per line).
#3
I am on a Linux system. How much of the above would change based on that?
#4
I am on a Linux system. How much of the above would change based on that? Let me explain what I want to use it for a little better. I have set up a station in RoboDK that runs the importCSV_XYZWPR to control a physical robot that it connects to. The whole setup takes a bit of time and I want to set up 2 additional robots using this method. I set up a Python script that runs through all this process to connect to the physical robot. What I want to now know is can RoboDK Linux be configured in such a way that once I open the application, the startup python script is run automatically? This would be ideal because I would like to set this up without a HUD/only remote connections. Thank you
#5
The command line I provided also works on Linux.

You could also use the API and connect to your running instance of RoboDK from a remote computer. Once you have an connection through the API you can have full control and run programs for example.
#6
Hi Albert, I believe the issue I am having comes from running an instance of RoboDK through the Python API. I am using ubuntu 24.04 and I installed python before installing RoboDK. I have however changed the python path on RoboDK to match that of my system but when i try to run a python script i get this error:
Code:
/home/RoboDK/bin/RoboDK: symbol lookup error: /home/RoboDK/bin/RoboDK: undefined symbol: _ZdlPvm, version Qt_5
RoboDK Application not properly started. Command:
['/home/wcl-staubli-i/RoboDK/bin/RoboDK', '-NOUI']
Code:
Traceback (most recent call last):
  File "/home/RoboDK/Library/Scripts/startup.py", line 7, in <module>
    RDK.ShowMessage("startup.py ran successfully!")
  File "/home/local/lib/python3.12/site-packages/robodk/robolink.py", line 1805, in ShowMessage
    self._send_line(command)
  File "/home/.local/lib/python3.12/site-packages/robodk/robolink.py", line 884, in _send_line
    self.COM.send(bytes(string + '\n', 'utf-8'))  # Python 3.x only
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe
Something about a mismatch in Qt5 versions. It suggests I have newer versions than RoboDK is expecting but I'm not sure how to remedy this. For reference, here is a the cide from the python script i am trying to run from robodk import robolink
Code:
import os
import time

# Start RoboDK API
RDK = robolink.Robolink(args='-NOUI')
RDK.ShowMessage("startup.py ran successfully!")
# Define names as they appear in your RoboDK station
STATION_PATH = '/home/Desktop/staubtx60.rdk'
ROBOT_NAME = 'Staubli TX60'
FRAME_NAME = 'Staubli TX60 Base'
TOOL_NAME = 'Tool 1'        # Update to match your tool name
SCRIPT_NAME = 'ImportCSV_XYZWPR copy'  # Update to match your script name
#7
Are you using the latest version of RoboDK? ShowMessage is supposed to display a blocking message in the user interface. Since there is no user interface this could create issues. We fixed this issue by ignoring blocking messages when the NOUI option is used. Let us know if you reproduced this issue with the latest version so we can try to reproduce it and fix it.

As a workaround you can simply not use the ShowMessage function, or set it as non-blocking.
  




Users browsing this thread:
1 Guest(s)