# Checking for error status of robot system with URScript

**URL:** <https://forum.universal-robots.com/t/checking-for-error-status-of-robot-system-with-urscript/21907>\
**Category:** URScript\
**Created:** [June 10, 2022, 12:15pm UTC](https://forum.universal-robots.com/t/checking-for-error-status-of-robot-system-with-urscript/21907 "2022-06-10T12:15:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kernachim](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kernachim](https://forum.universal-robots.com/u/kernachim)\
**Post date:** [June 10, 2022, 12:15pm UTC](https://forum.universal-robots.com/t/checking-for-error-status-of-robot-system-with-urscript/21907/1 "2022-06-10T12:15:16Z")

</div>

Hello,

I would like to set a standard digital output when the robot programm is stopped due to an error.  
A lamp that is connected to this output should inform the operator in case things are not running  
correctly e.g. the robor was stopped because of a collision.  
Is there way, that a URScript thread can check for the status of the robot controller?

Best regards  
Achim

---

<div class="post-metadata">

**Author:** ![anon32693620](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@anon32693620](https://forum.universal-robots.com/u/anon32693620)\
**Post date:** [June 10, 2022, 2:07pm UTC](https://forum.universal-robots.com/t/checking-for-error-status-of-robot-system-with-urscript/21907/2 "2022-06-10T14:07:06Z")

</div>

You can setup a digital output to go low on an unscheduled stop through the “IO Setup” in the Installation node. Would something like this be what you are looking to do?

---

<div class="post-metadata">

**Author:** ![kernachim](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kernachim](https://forum.universal-robots.com/u/kernachim)\
**Post date:** [June 10, 2022, 2:51pm UTC](https://forum.universal-robots.com/t/checking-for-error-status-of-robot-system-with-urscript/21907/3 "2022-06-10T14:51:27Z")

</div>

Hello nrivas  
thanks for your reply. basicly your advice will work, but i should have been more specific in my  
question. I need this information about an unscheduled stop in my URScript programm, because  
I would like to send this information via modbus to a signal lamp with multiple segments  
and flashing modes (selfmade with arduino nano).  
Your advice is still valuable, because I can check the status of an output in URScript. But it is some  
kind of workaround.  
Other robot controllers have a system variable, where you can read the current error code. I’m  
looking for something like that.

---

<div class="post-metadata">

**Author:** ![anon32693620](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@anon32693620](https://forum.universal-robots.com/u/anon32693620)\
**Post date:** [June 10, 2022, 2:56pm UTC](https://forum.universal-robots.com/t/checking-for-error-status-of-robot-system-with-urscript/21907/4 "2022-06-10T14:56:52Z")

</div>

If you are doing modbus communication, there is a script command “modbus\_set\_runstate\_dependent\_choice” which may be what you are looking for then. It will set a modbus signal to certain states similar to the function I described for the Digital Output above. You can find this in the script manual for more information on setting it up.
