UnderAutomation
有问题吗?

[email protected]

联系我们
UnderAutomation
⌘Q
本页面仅提供英文版本。

Read and reset alarms

Read the error messages, the program errors and the safety status of a UR cobot in C# or Python, and reset a protective stop or a safety fault.

  • What to read
  • How to reset
  • Prerequisites
  • Example
  • Safety
  • What to read next

This article shows how to read the errors of a Universal Robots cobot from a PC, in C# or Python, and how to reset a protective stop or a safety fault. On a UR controller, an alarm is a message of the controller, an error of the robot program, or a stop of the safety system.

What to read

InformationInterfaceSDK
Messages of the controller, with a codePrimary InterfaceKeyMessageReceived: RobotMessageCode, RobotMessageArgument, RobotMessageTitle, KeyTextMessage
Errors of the URScript programPrimary InterfaceRuntimeExceptionMessageReceived: line, column, text
Popups of the teach pendantPrimary InterfacePopupMessageReceived: title, text, Error, Warning
Protective stop, emergency stopPrimary InterfaceRobotModeData.ProtectiveStopped, EmergencyStopped
State of the safety systemDashboard ServerGetSafetyStatus(): Normal, ProtectiveStop, Fault...
Text messages of the program (textmsg)Primary InterfaceTextMessageReceived

The code of a message, for example C153A1, is RobotMessageCode (153) and RobotMessageArgument (1). The meaning of each code is in the documentation of Universal Robots for your robot.

How to reset

StateReset
ProtectiveStopWait 5 s, then CloseSafetyPopup() and UnlockProtectiveStop()
Fault, ViolationRemove the cause, then CloseSafetyPopup() and RestartSafety(). The arm is powered off
SystemEmergencyStop, RobotEmergencyStopRelease the emergency stop button, on the robot. No remote reset
A popup of the programClosePopup()

On PolyScope X, the REST API has UnlockProtectiveStop() and RestartSafety().

Prerequisites

  • The Primary Interface and the Dashboard Server are enabled on the robot: see Prepare the robot.
  • To reset, the robot is in remote control.

Example

The program prints the messages of the controller and of the program, reads the safety status, and resets a protective stop or a fault.

using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.Common;
class HowToReadResetAlarms
{
static void Main(string[] args)
{
var robot = new UR();
// Primary Interface and Dashboard Server
robot.Connect("192.168.0.1");
// Messages of the controller: errors with their code (C153A1...), program events
robot.PrimaryInterface.KeyMessageReceived += (sender, e) =>
{
Console.WriteLine($"C{e.RobotMessageCode}A{e.RobotMessageArgument} {e.RobotMessageTitle}: {e.KeyTextMessage}");
};
// Errors of the running URScript program
robot.PrimaryInterface.RuntimeExceptionMessageReceived += (sender, e) =>
{
Console.WriteLine($"Line {e.ScriptLineNumber}: {e.RuntimeExceptionTextMessage}");
};
// Popups shown on the teach pendant
robot.PrimaryInterface.PopupMessageReceived += (sender, e) =>
{
Console.WriteLine($"Popup {e.PopupMessageTitle}: {e.PopupTextMessage} (error: {e.Error})");
};
Thread.Sleep(500);
// State of the safety system
SafetyStatus status = robot.Dashboard.GetSafetyStatus().Value;
Console.WriteLine("Safety status: " + status);
switch (status)
{
case SafetyStatus.ProtectiveStop:
// Wait 5 s after the stop, as on the teach pendant
Thread.Sleep(5000);
robot.Dashboard.CloseSafetyPopup();
robot.Dashboard.UnlockProtectiveStop();
break;
case SafetyStatus.Fault:
case SafetyStatus.Violation:
// Restarts the safety system: the arm is powered off
robot.Dashboard.CloseSafetyPopup();
robot.Dashboard.RestartSafety();
break;
}
// Close the other popups of the teach pendant
robot.Dashboard.ClosePopup();
}
}

The messages are sent when they occur: start listening before the error. A message sent before the connection is not received.

Safety

A protective stop or a fault has a cause: a collision, a limit, a wrong payload. Reset it from a PC only when the cause is known and removed, and when nobody is in the cell. The SDK does not replace the risk assessment of the cell.

What to read next

  • Monitor the state of the robot: follow the modes and the safety status.
  • Dashboard Server: the safety commands.

轻松将 Universal Robots、Fanuc、Yaskawa、ABB 或 Staubli 机器人集成到您的 .NET、Python、LabVIEW 或 Matlab 应用程序中

UnderAutomation
联系我们Legal

© All rights reserved.