UnderAutomation
Une question ?

[email protected]

Contactez-nous
UnderAutomation
⌘Q
This page is only available in English.

Alarms & task status

Read active alarms, alarm history, clear alarms, monitor running tasks, and read/write comments via SNPX.

  • Alarms
  • Task status and comments
  • Complete example
  • API reference

SNPX lets you read active alarms, browse alarm history, clear alarms, monitor running tasks, and read/write register and I/O comments.

Alarms

parameters.Snpx.Enable = true;
robot.Connect(parameters);
// Active alarm
RobotAlarm activeAlarm = robot.Snpx.ActiveAlarm.Read(1);
Console.WriteLine($"Alarm: {activeAlarm.Message}");
Console.WriteLine($"Severity: {activeAlarm.Severity}");
Console.WriteLine($"Time: {activeAlarm.Time}");
// Alarm history
RobotAlarm histAlarm = robot.Snpx.AlarmHistory.Read(10);
// Clear alarms
robot.Snpx.ClearAlarms();
}
}
Click to see the full code

Task status and comments

Monitor running program tasks by index (1-based). Comments are short descriptions associated with registers or I/O ports.

Available comment types: Register, PositionRegister, StringRegister, DI, DO, RI, RO, UI, UO, SI, SO, WI, WO, WSI, WSO, GI, GO, AI, AO, Flag.

parameters.Snpx.Enable = true;
robot.Connect(parameters);
// Task status
RobotTaskStatus task = robot.Snpx.CurrentTaskStatus.Read(1);
Console.WriteLine($"Program: {task.ProgramName}");
Console.WriteLine($"Line: {task.LineNumber}");
Console.WriteLine($"State: {task.State}"); // Stopped, Paused, Running
Console.WriteLine($"Caller: {task.Caller}");
// Read and write comments
string comment = robot.Snpx.Comments.Read(CommentType.Register, 5);
string longComment = robot.Snpx.Comments.Read(CommentType.Register, 5, 24);
robot.Snpx.Comments.Write(CommentType.PositionRegister, 1, "Home Position", 16);
}
}
Click to see the full code

Complete example

using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Snpx.Internal;
using UnderAutomation.Fanuc.Snpx;
public class SnpxAlarmsTasks
{
public static void Main()
{
FanucRobot robot = new FanucRobot();
ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");
parameters.Snpx.Enable = true;
robot.Connect(parameters);
// --- Active alarm ---
RobotAlarm activeAlarm = robot.Snpx.ActiveAlarm.Read(1);
Console.WriteLine($"Alarm: {activeAlarm.Message}");
Console.WriteLine($"Severity: {activeAlarm.Severity}");
Console.WriteLine($"Time: {activeAlarm.Time}");
// --- Alarm history ---
RobotAlarm histAlarm = robot.Snpx.AlarmHistory.Read(10);
Console.WriteLine($"History #{10}: {histAlarm.Message}");
// --- Clear alarms ---
robot.Snpx.ClearAlarms();
// --- Task status ---
RobotTaskStatus task = robot.Snpx.CurrentTaskStatus.Read(1);
Console.WriteLine($"Program: {task.ProgramName}");
Console.WriteLine($"Line: {task.LineNumber}");
Console.WriteLine($"State: {task.State}");
Console.WriteLine($"Caller: {task.Caller}");
// --- Read and write comments ---
string comment = robot.Snpx.Comments.Read(CommentType.Register, 5);
robot.Snpx.Comments.Write(CommentType.PositionRegister, 1, "Home Position", 16);
}
}

API reference

Class
RobotAlarm
C#Python

Represents a robot alarm with its category, severity, time, and message.

MemberTypeDescription
RobotAlarm()
Constructor
CauseId
Property
AlarmId
Cause Category
CauseMessage
Property
string
Cause message
CauseNumber
Property
short
Cause Number
Id
Property
AlarmId
Alarm Category
Message
Property
string
Error Message
Number
Property
short
Alarm Number
Severity
Property
AlarmSeverity
Alarm Severity
SeverityMessage
Property
string
Severity message
Time
Property
DateTime
Occurrence Time
Equals(object)
Method
bool
Equals(RobotAlarm)
Method
bool
Determines whether the specified RobotAlarm is equal to this instance.
  • other : The alarm to compare with.
FromBytes(byte[], Languages, int)
Method
static
RobotAlarm
Creates a RobotAlarm from a byte array.
  • bytes : The byte array containing alarm data.
  • language : The controller language for string decoding.
  • start : The starting offset in the byte array.
GetHashCode()
Method
int
ToString()
Method
string
Enum
AlarmSeverity
C#Python

Represents the severity level of a robot alarm.

NameValueDescription
ABORT_G
45
Global abort level alarm.
ABORT_L
11
Local abort level alarm.
NONE
128
No severity.
PAUSE_G
34
Global pause level alarm.
PAUSE_L
2
Local pause level alarm.
SERVO
54
Servo error alarm.
SERVO2
58
Servo error level 2 alarm.
STOP_G
38
Global stop level alarm.
STOP_L
6
Local stop level alarm.
SYSTEM
122
System level alarm.
WARN
0
Warning level alarm.
Class
RobotTaskStatus
C#Python

Represents the status of a running task on the robot controller.

MemberTypeDescription
RobotTaskStatus()
Constructor
Caller
Property
string
Gets or sets the name of the calling program.
LineNumber
Property
short
Gets or sets the current line number in the program.
ProgramName
Property
string
Gets or sets the name of the program being executed.
State
Property
RobotTaskState
Gets or sets the current execution state of the task.
Equals(object)
Method
bool
Equals(RobotTaskStatus)
Method
bool
Determines whether the specified RobotTaskStatus is equal to this instance.
  • other : The task status to compare with.
FromBytes(byte[], Languages, int)
Method
static
RobotTaskStatus
Creates a RobotTaskStatus from a byte array.
  • bytes : The byte array containing task status data.
  • language : The controller language for string decoding.
  • start : The starting offset in the byte array.
GetHashCode()
Method
int
ToString()
Method
string
Enum
RobotTaskState
C#Python

Represents the execution state of a robot task.

NameValueDescription
Paused
1
Task is paused.
Running
2
Task is running.
Stopped
0
Task is stopped.
Enum
CommentType
C#Python

Identifies the type of data for which a comment can be read or written.

NameValueDescription
AI
17
Analog Input.
AO
18
Analog Output.
DI
3
Digital Input.
DO
4
Digital Output.
Flag
19
Flag
GI
15
Group Input.
GO
16
Group Output.
PositionRegister
1
Position register PR[].
RI
5
Remote Input.
RO
6
Remote Output.
Register
0
Numeric register R[].
SI
9
System Input.
SO
10
System Output.
StringRegister
2
String register SR[].
UI
7
User Input.
UO
8
User Output.
WI
11
Weld Input.
WO
12
Weld Output.
WSI
13
Wire Stick Input.
WSO
14
Wire Stick Output.

Intégrez facilement les robots Universal Robots, Fanuc, Yaskawa, ABB ou Staubli dans vos applications .NET, Python, LabVIEW ou Matlab

UnderAutomation
Contactez-nousLegal

© All rights reserved.