How to read the popup-text in UR system through a tcp connection

There seems no solution in client interface.
The only way I can find is to use remote desktop.

Have you solve the problem? I am very curious about how to detect the message. : )

What is the purpose for reading the text, is it for a fault or other SAFETY RELATED popup or an error code? Or is it for popup that’s created in the program?

Hi Mike,

I am running into the same issue. I need to access the popup error message through python using ROS, but it seems like there are no existing solution for that. Could you advise me on how to approach that problem please? Thanks!

Actually there is no way direct to read the popup text but you can read out why the popup comes up by reading the Safetystatus with Dashboard server.

ds = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # configure Connection
ds.settimeout(1) # set timeout
robot_ip = '192.168.1.2' # replace with your robot IP
port = 29999 # Dashboard server Port
ds.connect((self.robot_ip, self.port)) # Connect robot

ds.send(ds.sendall('safetystatus\n'.encode()) # Ask for the safetystatus
print(ds.recv(4096).decode()) # print the response 

Possible responses will be:
“Safetystatus: ”, where status is
• NORMAL
• REDUCED
• PROTECTIVE_STOP
• RECOVERY
• SAFEGUARD_STOP
• SYSTEM_ EMERGENCY_STOP
• ROBOT_ EMERGENCY_STOP
• VIOLATION
• FAULT
• AUTOMATIC_MODE_ SAFEGUARD_STOP
• SYSTEM_THREE_ POSITION_ ENABLING_STOP

Through Dashboard server you can also unlock protective stops and close the popup.
If you really need to read the popup text, then i would recommend to do this with ssh connection and read the log which contains same messages as the popups.

Primary Interface allows you to retrieve the content of a popup, whether it’s an operator popup or a safety message popup.
This popup can then be closed with DashboardServer.

For example, this library implements this feature and allows you to be notified with an event when a popup is displayed:

using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.PrimaryInterface;

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

robot.PrimaryInterface.PopupMessageReceived += Robot_PopupMessageReceived;
robot.PrimaryInterface.RuntimeExceptionMessageReceived += Robot_RuntimeExceptionMessageReceived;

private void Robot_RuntimeExceptionMessageReceived(object sender, RuntimeExceptionMessageEventArgs e)
{
    ShowPopup("Runtime exception", $"Script error line {e.ScriptLineNumber} column {e.ScriptColumnNumber}\r\n{e.RuntimeExceptionTextMessage.Replace("_", " ")}", false, true, RequestedTypes.None, 0);
}

private void Robot_PopupMessageReceived(object sender, PopupMessageEventArgs e)
{
    ShowPopup(e.PopupMessageTitle, $"{e.PopupTextMessage ?? $"Enter {e.RequestedType}"}", e.Warning, e.Error, e.RequestedType, e.RequestId);
}

ur popup