Universal Robots Forum

Set script to run in background always

TL;DR - Select a script from inside the locked safety settings that will always run when a program is running.

I got a script that makes adjustments on the robot for different conditions, and currently I am just running it in a second thread in the program.

However, the customer is afraid someone will just disable it in the program, and wants a way to not be able to just disable it with a few touches on the screen. My new approach is to have something external connect to the robot and send the settings in over the server running on the robot, but if it was possible to inside the locked safety settings to select a script, which would always run when a program is startet, I could skip the extra hardware and the extra OS running, and have fewer things that could go wrong.

Have you thought about making a URcap? Cause what you describe sounds like something that a URCap will solve. You could setup a background script in the URCap that is always running and doing what you need.

Yep, the Thread should be started from the Installation script contribution.
Then it would not be a normal “Thread” function, that the user could simply remove from the robot program - but would be started in the preamble of the program.

1 Like

But wont they just be able to then go into “Setup Robot > URCaps” and then remove it from there? It isn’t protected by anything.

They must be able to program the robot, so I can’t just put a password on that either.

For solutions where you’re setting up the system yourselves (and not intending for publication to UR+) I’d recommend handling it through a python script which is run automatically at boot using crontab from the command line, completely outside of Polyscope.

This would work, however it wouldn’t really be inline with the plug and play guidelines for URCaps and products to be published to the showroom.

1 Like

This is for a one off installation, is it possible to read IO status through such a script too?

Yes, use one of the available client interfaces, e.g. RTDE.