UnderAutomation
Eine Frage?

[email protected]

Kontakt
UnderAutomation
⌘Q
Diese Seite ist nur auf Englisch verfügbar.

Read and reset robot alarms from a PC

Read the active alarms of Fanuc, Yaskawa, Universal Robots and ABB controllers with one code, and the history and the reset where the brand has them: what each brand reads and resets, C# and Python examples.

  • Prerequisites
  • Brand support
  • Example
  • Read and reset the alarms of each controller of a cell
  • Read the history
  • What changes from one brand to another
  • Errors
  • What to read next

This article shows how to read the active alarms of Fanuc, Yaskawa, Universal Robots and ABB controllers from a PC and reset them, with one code in C# or Python. What an alarm and a reset are depends on the controller: the table at the end gives the details of each brand.

The alarms of a Stäubli controller are not in the common API, and some brands have no reset or no history: the support table below shows it.

Prerequisites

  • UnderAutomation.Robotics in your project. See Get started with .NET or Get started with Python.
  • The connection settings of each controller. See Connect to your robot.
  • The license of each brand you connect, or the 30 day trial. See Licensing.
  • A reset from a PC acknowledges alarms that an operator would acknowledge at the pendant. Find the cause of the alarm before you reset it. On some controllers, the reset also brings back the servo power.

Brand support

Each cell gives the protocol that the method uses on this brand, in the default order. The table is generated from the route data of the library. "Not available" means that the brand has no route for the method: the call throws FeatureNotSupportedException, and IsAvailable returns false before the call.

Alarms
MethodFanucYaskawaUniversal RobotsABBStäubli
Alarm.ReadActiveSNPX, FTPHigh Speed Ethernet Server, Ethernet ServerPrimary Interface (Primary), Dashboard ServerRobot Web ServicesNot available
Alarm.ReadHistorySNPX, FTPNot availableNot availableRobot Web ServicesNot available
Alarm.ResetSNPX, CGTP (CgtpKcl), TelnetHigh Speed Ethernet Server, Ethernet ServerDashboard ServerNot availableNot available
Alarm3 of 32 of 32 of 32 of 30 of 3

Example

Read and reset the alarms of each controller of a cell

The example connects to the controllers of a cell one after the other. It prints the active alarms, then resets them on the brands that have a reset and reads what is left. ReadActive returns a ControllerAlarm per alarm, with its code, its severity and its message.

IsAvailable(AlarmFeature.Reset) is false on a brand without a reset route: the example then only reads the alarms.

static void Main()
{
// One line per controller: only the brand and the address change
var cell = new[]
{
(Brand: "fanuc", Address: "192.168.0.1"),
(Brand: "yaskawa", Address: "192.168.0.2"),
(Brand: "universalrobots", Address: "192.168.0.3"),
(Brand: "abb", Address: "192.168.125.1"),
};
foreach (var controller in cell)
{
// The same code for each controller of this cell
RobotController robot = new RobotController();
robot.Connect(RobotConnectionParameters.Create(controller.Brand, controller.Address));
foreach (ControllerAlarm alarm in robot.Alarm.ReadActive())
Console.WriteLine($"{robot.Brand} {alarm.Code} {alarm.Severity}: {alarm.Message}");
// False on a brand that has no reset route
if (robot.Alarm.IsAvailable(AlarmFeature.Reset))
{
robot.Alarm.Reset();
Console.WriteLine($"{robot.Brand}: {robot.Alarm.ReadActive().Length} alarm(s) left");
}
robot.Disconnect();
}
}
}
Click to see the full code

In Python, the names are in snake_case: robot.alarm.read_active(), robot.alarm.reset(), robot.alarm.is_available(...).

Read the history

ReadHistory(count) returns the last alarms of the history, the most recent first, on the brands that have a history. Check HasDate before you use Date: some controllers do not give it.

RobotController robot = new RobotController();
robot.Connect(RobotConnectionParameters.Create("fanuc", "192.168.0.1"));
foreach (ControllerAlarm alarm in robot.Alarm.ReadActive())
Console.WriteLine($"{alarm.Code} {alarm.Severity}: {alarm.Message}");
// The last 10 alarms
foreach (ControllerAlarm alarm in robot.Alarm.ReadHistory(10))
Console.WriteLine(alarm.HasDate ? $"{alarm.Date}: {alarm.Message}" : alarm.Message);
robot.Disconnect();
}
Click to see the full code

What changes from one brand to another

The code does not change. The content of an alarm and the effect of a reset depend on the controller.

BrandActive alarmsHistoryResetBrand article
FanucThe active alarms of the alarm log.The alarm log.Resets the controller: it clears the alarms that can be cleared and brings back the servo power when the safety chain is closed.Reset an alarm remotely
YaskawaThe active alarms.Not availableResets the alarms.Read and reset alarms
Universal RobotsThe protective stop, the emergency stop and the safety status.Not availableCloses the popups, then unlocks the protective stop when the robot is in protective stop.Read and reset alarms
ABBThe guard stop, the emergency stop and the system failure of the controller state.The event log of the controller.Not availableEvent log
StäubliNot availableNot availableNot available

AlarmPresent of the state tells that an alarm is active without reading the list. See Monitor the state of a robot controller.

Errors

  • FeatureNotSupportedException: the brand has no route for the method, for example Reset on ABB.
  • RouteUnavailableException: the method has routes, but none can be used, for example because the protocol did not answer at the connection.
  • ControllerRefusedException: the controller received the reset and refused it.
  • RobotControllerException: the route failed. Its inner exception is the exception of the brand SDK.

The page Errors explains each exception.

What to read next

  • Alarm: every method of the Alarm service and the ControllerAlarm type.
  • Start, stop and select a robot program: start the program again after the reset.
  • Monitor the state of a robot controller: follow the controllers of a cell.