Universal Robots Forum

Program stops as soon sending "set_digital_out(2,False)"


I have a program written in Polyscope, there the idea is, that several if cases should react on the different states of the Digital Outputs.

What I have done until now is, I am able to open the Dashboard connection via python, there I can load the program, release the robot and start (play) the program in Polyscope.

But as soon as I try to send the command example; “set_digital_out(2,False)”
the program in Polyscope will stop.

The same when I connect with SocketTest and send there the same command.

Any Idea what I have to change? what i am doing wrong?


Hi @martin.huetter,

Polyscope will receive your code line as a new program that needs to be executed. Therefor it will it the running one and execute the newest one.
You can take a look here to gain knowledge about the secondary program option. That will allow you to execute a small program while the primary program is still running.


This is not the idea.
What I want to do is:
To be able to send in python a “signal” to the robot.

What I had done was, I had hardware switches on the Digital Inputs connected for a first try,
and now I want to exchange the switches with “signals” from python.

Is this possible?


Hi @martin.huetter,

The signals can be generated by your python sending secondary programs with write_output_boolean_register(…) and your primary program reading the signal with the function read_output_boolean_register(…)


Thanks, but this rings the next question…

sec secondaryProgram():
set_digital_out(1, True)

I can set the digital out 1 to status true without any problem.

On the same way I tried to read the status of an other Digital out:
sec secondaryProgram():

But at the moment I am not able to convert the answere, to have an idea if the status is True or False.
Do you have an example for this?


Hi @martin.huetter,

It seems like your overall target is to exchange data from a python process and URControl. And not the specific issue mentioned in the title of this topic Program stops as soon sending “set_digital_out(2,False)” if that is correct. I will suggest you to take a look at this topic:

And many of the other samples. for example: