Universal Robots Forum

Can I close the error message using a script command?

Can I close the error message using a script command?

If is it possible, teach me please

:cold_sweat: :mask:

Yeah, you can close error message using close popup and close safety popup through 29999 port in e-series

Hi @mohamed.aakibali

Thanks for reply

I can’t find “close popup” , “close safety popup” in the URScript API pdf file

I want to know that the c# script closes the error message of the teaching pendant using command.

We can able to close popup that shows error through 29999 port by sending command close popup and close safetypopup. you can check that command in that link

Hi @mohamed.aakibali

Thanks for reply

I’m sorry, I don’t know how to use the command. Please give me an example …

:sob: please help :sob:

Are you trying to close the popup/safety popup from within the pendant or externally?

**edit ** The way I understand this question/thread of messages is, can you use URscript to close SAFETY POPUPS / PROTECTIVE STOPS / FAULTS / VIOLATIONS internally on the teach pendant? Answer is NO, UR does not allow you to do this. However, you can use Dashboard Server Interface to have an external controller perform actions through the GUI as a human would, such as “boot, power on, close safetypopup, load program, play, pause, stop… among others”. Not a software guy but you might be able to go in and run something in the Linux side of the controller but this is far beyond me and might not even be possible. At this point you are bypassing safety systems and notifications (probably be a massive rabbit hole) which protect both the operator and robot.


You can close a POPUP not SAFETY POPUP internally while RUNNING a program by creating a thread with URscript and button, see below:

   if digital_input_1 = True:
      wait == digital_input_1 = False // wait until button is released, so it can only close one popup at a time
      socket_open(“”,29999) // open internal socket
      socket_send_line(“close popup”)
      // or socket_send_string(“close popup”) // one of these commands has depreciated depending on version of Polyscope
      socket_close() // free up controller resource
      sync() // use up remaining physical time of thread
   sync() // redundant sync command

Again this has to be done within a PLAYING program, however safety popups/faults/protective stops/violations STOP/PAUSE programs, basically rendering the code above useless. It requires the operator to “manually” address the issue and close the popup. This is important because protective stops can damage your robot if triggered “regularly” and lead to potentially voiding your warranty. (At least this is how I understand it, I may be wrong so take this with a grain of salt)

EXTERNALLY (Dashboard Server)

IF you are planning to use Dashboard Server (Port 29999) to close a POPUP or SAFETY POPUP, you will need an external device (PC or PLC) to handle communication with UR.

A. Robot needs to be in “Remote Mode” this can be ENABLED in settings of the UR (just need to switch from “local/manual/automatic mode” to “remote mode”)
B. Tcpclient program (if you haven’t created one already look up how to do online, the port is obviously 29999) on your PC + tethered LAN to the robot
C. IP address on the robot needs to be static + identical to the PC (minus the last 3 digits, these just need to be different #’s from one another) and subnet mask needs to be the SAME on both robot and PC

I recommend pinging the robot’s IP using the command prompt, should be 0% lose for the packets if you have everything right. This is probably the best way to make sure communication is properly established.

Be aware using dashboard server you are querying the controller. Basically it will send an “acknowledgment” back, if you take a look at the different commands in the table you can see the various possible responses the command might return. These are useful but generic so if you want more details on the error you will need to look at the teach pendant.

Sorry for the information overload, but hope that helps and best of luck!!

we can close safety popup/faults/protective stops/violations using sending close safetypopup through 29999.

@michael.r.mercer Thanks for reply

The environment I’m using is not a universal robots graphical programming environment script and I’m not using dashboard, I’m programming an internal script in visual studio and C# and using ur_data_processing.cs file.

I don’t know much about universal robots and I’m inexperienced. Sorry…

I use

GlobalVariables_TCP_IP_client.aux_command_str = “movej([” + 0 + “,” + -1.57 + “,” + 0 + “,” + -1.57 + “,” + 4.9 + “,” + 1.2 + “], a =” + 1.4 + ", v = " + 1.05 + ", t = " + 0 + “, r =” + 0 + “)” + “\n”;
GlobalVariables_TCP_IP_client.command = utf8.GetBytes(GlobalVariables_TCP_IP_client.aux_command_str);

when using commands

Really Can I use socket_send_line(“close popup”) ?

@p.jinhyeok no problem. And ah I see now, this is an interesting problem and might be out of my field of knowledge. Is the .cs then transferred to robot and ran like a program?

Normally I would say use TCPclient and Port 29999 to send string:

“close popup\n”

(closes regular program popups) and/or

“close safetypopup\n”

(closes safety related popups)

But your situation is different, so you would trigger a popup in the program using URscript:

popup(“Popup String”, “Popup Title”)

then close it using the code I wrote above (of course it doesn’t have to be a button press it could be something else to control that if-statement.

THE MAIN ISSUE: if this .cs file is running on robot, and if for instance you collide with something and trigger a protective stop the robot will halt/pause your script file and throw up a SAFETY POPUP, basically making any execution of lines of code in the file useless. Like I said I’m almost certain UR won’t let you do this for safety reasons. Might have to A) operator/programmer PHYSICALLY address error on teach pendant B) use dashboard server to remotely control limited functionality of the UR GUI

Sorry but I hope that makes sense. Best of luck!

Thanks for reply :smiley:
I haven’t tried it with a real robot. We are currently testing in a virtual environment(URSim_VIRTUAL).

All the commands I know of can be used and working in a virtual environment.
example) movej() , stopj(), servoj(), etc.
But I can’t find “close popup” in URscript API reference pdf file.

URscript API reference pdf file link

I tried this command “socket_send_string(“close safetypopup”)” + “\n”;
The virtual teaching pendant recognizes commands but does not respond.

does not close popup

++add edit++
When an error message occurs, the teaching pendant stops operating, but the command is recognized.
I believe that if I close the popup window it will work again. So i am trying this.

You are most likely right. I am not familiar with this program.

@p.jinhyeok trying to think of how to better explain this, the URscript language is different from the dashboard server API.

URscript - coding language for certain program creation and control functions in UR Polyscope environment (wow realizing that sounds very generic and doesn’t help, moving on…)
Dashboard Server - API is used basically for controlling the teach pendant remotely (as if a PC or PLC was acting as the human) touching the screen interface. Commands here are limited to specific important features.

Not sure which port you are running your other C# code probably 30001 or 30002, but port 29999 is specific for dashboard server commands ONLY will not take URscript code and vice versa you can’t send dashboard server commands to other ports

No worries, I started off getting these mixed up too but once you get it working it’s super handy and very powerful.


I’ve never used a dashboard before. I used only URscript

I use port 30003. Can I use multiple ports in one script?
If possible. Please example with C#

As explained by others already, the dashboard server is meant for external devices to connect and send commands to the robot controller.
If you are planning not to have the TP connected, then you will need a PLC or PC connected to the robot to display and reset errors. This is what the dashboard server is intended for. :slight_smile:
You will not be able to close a safety popup through URScript.

The PLC/PC will make a socket connection to the robot controller, and then you can send the “close safety popup” through port 29999 in the controller to reset the safety popup. :slight_smile:

1 Like