# Is there a way to remotely change IO while the robot is running?

**URL:** <https://forum.universal-robots.com/t/is-there-a-way-to-remotely-change-io-while-the-robot-is-running/32477>\
**Category:** Robot Communication\
**Created:** [February 1, 2024, 3:08pm UTC](https://forum.universal-robots.com/t/is-there-a-way-to-remotely-change-io-while-the-robot-is-running/32477 "2024-02-01T15:08:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![esseriana86](https://avatars.discourse-cdn.com/v4/letter/e/e9a140/32.png) [@esseriana86](https://forum.universal-robots.com/u/esseriana86)\
**Post date:** [February 1, 2024, 3:08pm UTC](https://forum.universal-robots.com/t/is-there-a-way-to-remotely-change-io-while-the-robot-is-running/32477/1 "2024-02-01T15:08:56Z")

</div>

hi.  
I’m trying to change the robot’s control box IO in a C# program.  
This should be possible even while the robot is running.

I tried using the urscript execution function of the client interface.  
ex) set\_digital\_out(1,True)

This changed the IO, but the robot stopped.

Are there any other functions that can change IO while the robot is running?

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [February 1, 2024, 3:23pm UTC](https://forum.universal-robots.com/t/is-there-a-way-to-remotely-change-io-while-the-robot-is-running/32477/2 "2024-02-01T15:23:30Z")

</div>

You can set the URScript command to run as Secondary instead of primary, which will prevent the program execution from stopping. I haven’t worked in C#, I’ve only done CAP development via Java, but there is an API provided by UR for accessing the digital/configurable outputs from there.

---

<div class="post-metadata">

**Author:** ![androidflorent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/androidflorent/32/3314_2.png) [@androidflorent](https://forum.universal-robots.com/u/androidflorent)\
**Post date:** [January 22, 2025, 9:28am UTC](https://forum.universal-robots.com/t/is-there-a-way-to-remotely-change-io-while-the-robot-is-running/32477/3 "2025-01-22T09:28:10Z")

</div>

Yes, you can set an output while a program is running. The trick is to use a secondary program.  
You can have a look at the documentation of this library that provides this feature in C# :

[https://underautomation.com/universal-robots/documentation/remote-send-script](https://underautomation.com/universal-robots/documentation/remote-send-script)

```auto
using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.PrimaryInterface;

var robot = new UR();
robot.Connect("192.168.0.1");

robot.PrimaryInterface.Script.Send(@"
sec secondaryProgram():
  set_digital_out(1, True)
end
");

```
