UnderAutomation
有问题吗?

[email protected]

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

Dashboard Server: remote commands

Power, brakes, programs, popups, robot mode and safety status of a UR cobot with the Dashboard Server of PolyScope 5. All the commands of the SDK.

The Dashboard Server of a Universal Robots cobot accepts remote commands on TCP port 29999: power on and off, release the brakes, load and play programs, show popups, read the robot mode and the safety status. This page lists the commands of the SDK for CB-Series and e-Series robots with PolyScope.

PolyScope X has no Dashboard Server: use the REST API.

Prerequisites

  • The service Dashboard Server is enabled on the robot: see Prepare the robot.
  • On e-Series, the commands that change the state of the robot (power, brakes, load, play) need the remote control: see Remote control. The commands that read a value work in local control.

Example

The Dashboard Server is enabled by default: Connect("192.168.0.1") opens it.

static void Main(string[] args)
{
var robot = new UR();
var parameters = new ConnectParameters("192.168.0.1");
// The Dashboard Server is enabled by default
parameters.Dashboard.Enable = true;
robot.Connect(parameters);
// Every command returns a CommandResponse
var powerOn = robot.Dashboard.PowerOn();
if (!powerOn.Succeed) Console.WriteLine(powerOn.Message);
robot.Dashboard.ReleaseBrake();
robot.Dashboard.LoadProgram("pick_and_place.urp");
robot.Dashboard.Play();
// Commands that read a value return a CommandResponse<T>
var running = robot.Dashboard.IsProgramRunning();
Console.WriteLine($"Running: {running.Value}");
// Close the Dashboard Server only
robot.Dashboard.Disable();
}
}
Click to see the full code

The same client works without UR:

static void Main(string[] args)
{
// A Dashboard Server client, without a UR instance
var client = new DashboardClient();
// Address of the robot. Optional: port, receive and send timeouts
client.Enable("192.168.0.1");
client.PowerOn();
client.ReleaseBrake();
client.Play();
client.Disable();
}
}
Click to see the full code

Responses

Every command returns a CommandResponse: Succeed says if the robot accepted the command, Message gives its answer. The commands that read a value return a CommandResponse<T>, with the value in Value.

Class
CommandResponse
C#Python

Generic answer returned by a command

MemberTypeDescription
CommandResponse()
Constructor
Message
Field
string
A message that described the error or the action done
Succeed
Field
bool
The command as succeeded
Equals(object)
Method
bool
Determines whether the specified object is equal to this response.
GetHashCode()
Method
int
Returns a hash code for this response.
ToString()
Method
string
A human readable answer

Same code for PolyScope and PolyScope X

The Dashboard Server client and the REST API client of PolyScope X implement the interface IRobotDashboard. It contains the commands that exist on the 2 families: power, brakes, protective stop, safety restart, programs, robot mode, safety mode, operational mode, remote control, popups and PolyScope version.

Use the interface

The interface is implemented explicitly: use a variable of type IRobotDashboard. The methods of robot.Dashboard and robot.Rest with the same names keep their own answer types.

static void Main(string[] args)
{
// true for PolyScope X (REST API), false for PolyScope 5 (Dashboard Server)
bool isPolyScopeX = true;
var robot = new UR();
var param = new ConnectParameters("192.168.0.1");
param.Dashboard.Enable = !isPolyScopeX;
param.Rest.Enable = isPolyScopeX;
robot.Connect(param);
// The two clients implement IRobotDashboard
IRobotDashboard dashboard = isPolyScopeX ? (IRobotDashboard)robot.Rest : robot.Dashboard;
// The same code for the two families
dashboard.PowerOn();
dashboard.ReleaseBrake();
dashboard.LoadProgram("my_program");
dashboard.Play();
RobotDashboardResponse<SafetyModes> safety = dashboard.GetSafetyMode();
if (safety.Succeed)
Console.WriteLine($"Safety mode: {safety.Value}");
else
Console.WriteLine($"Error: {safety.Message}");
robot.Disconnect();
}
}
Click to see the full code

In Python, robot.dashboard and robot.rest have the same method names. Only the brakes differ: release_brake() on the Dashboard Server, brake_release() on the REST API.

Answers of the interface

Every method blocks until the robot answers. A failure is in the answer, not in an exception.

Interface
IRobotDashboard
C#Python

Commands that exist on both the Dashboard Server client (PolyScope 5, CB3 and e-Series) and the REST API client (PolyScope X). Write your code against this interface to control a robot of any of the two families. Both clients implement it explicitly: to call the members, use a variable of type IRobotDashboard. The methods of the clients with the same names keep their own answer types. Every method blocks until the robot answers. A failure is reported in the answer, not by an exception.

MemberTypeDescription
ClosePopup()
Method
RobotDashboardResponse
Closes the popup of the screen of the robot.
CloseSafetyPopup()
Method
RobotDashboardResponse
Closes a safety popup of the screen of the robot.
GetLoadedProgram()
Method
RobotDashboardResponse<string>
Gets the loaded program.
GetOperationalMode()
Method
RobotDashboardResponse<OperationalModes>
Gets the operational mode of the robot.
GetPolyscopeVersion()
Method
RobotDashboardResponse<PolyscopeVersion>
Gets the version of PolyScope.
GetProgramState()
Method
RobotDashboardResponse<ProgramState>
Gets the state of the program.
GetRobotMode()
Method
RobotDashboardResponse<RobotModes>
Gets the mode of the robot.
GetSafetyMode()
Method
RobotDashboardResponse<SafetyModes>
Gets the safety mode of the robot.
IsInRemoteControl()
Method
RobotDashboardResponse<bool>
Indicates whether the robot is in remote control.
LoadProgram(string)
Method
RobotDashboardResponse
Loads a program of the robot.
  • programName : Name of the program. The extension is optional.
Pause()
Method
RobotDashboardResponse
Pauses the running program.
Play()
Method
RobotDashboardResponse
Starts the loaded program.
PowerOff()
Method
RobotDashboardResponse
Powers off the robot arm.
PowerOn()
Method
RobotDashboardResponse
Powers on the robot arm.
ReleaseBrake()
Method
RobotDashboardResponse
Releases the brakes of the robot.
RestartSafety()
Method
RobotDashboardResponse
Restarts the safety system. After the restart the robot is in power off mode.
Resume()
Method
RobotDashboardResponse
Resumes the paused program.
ShowPopup(string)
Method
RobotDashboardResponse
Shows a popup on the screen of the robot.
  • message : Text of the popup.
Stop()
Method
RobotDashboardResponse
Stops the running program.
UnlockProtectiveStop()
Method
RobotDashboardResponse
Unlocks a protective stop.
Class
RobotDashboardResponse
C#Python

Answer of a command of IRobotDashboard. The same type is returned by the Dashboard Server client (PolyScope 5) and by the REST API client (PolyScope X), so that one code works with both. The other methods of the two clients keep their own answer types (CommandResponse and RestApiResponse).

MemberTypeDescription
RobotDashboardResponse()
Constructor
Message
Property
string
Message of the robot, or description of the error.
Succeed
Property
bool
Indicates that the robot accepted and executed the command.
Equals(object)
Method
bool
GetHashCode()
Method
int
ToString()
Method
string

Power and brakes

GetRobotMode

Get the current robot mode.

C#
// Returns the current robot state. (From FW 1.6)
public CommandResponse<RobotModes> GetRobotMode()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetRobotMode();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
RobotModes robotMode = response.Value;
}
Enum
RobotModes
C#Python

Robot running modes

NameValueDescription
BackDrive
6
The robot is hand guided by pushing teached button
Booting
2
The robot controller is booting
ConfirmSafety
1
Robot has stopped due to a Safety Stop
Disconnected
0
Robot is not connected to its controller
Idle
5
Power is on but breaks are not released
Other
-1
The robot has no controller (value -1), or it is in an obsolete CB2 mode
PowerOff
3
The robot is powered off
PowerOn
4
The robot is powered on
Running
7
Robot is in normal mode
Unknown
-128
The mode is not known. Returned by RobotModeFromValue(int) for a value this SDK does not recognize.
UpdatingFirmware
8
Firmware is upgrading

PowerOn

Power on the robot.

C#
// Powers on the robot arm. (From FW 3.0)
public CommandResponse PowerOn()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.PowerOn();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

PowerOff

Power off the robot.

C#
// Powers off the robot arm. (From FW 3.0)
public CommandResponse PowerOff()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.PowerOff();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

ReleaseBrake

Release the brakes after powering on.

C#
// Releases the brakes. (From FW 3.0)
public CommandResponse ReleaseBrake()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.ReleaseBrake();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

UnlockProtectiveStop

Unlock the robot from protective stop state.

C#
// Closes the current popup and unlocks protective stop. (From FW 3.1)
public CommandResponse UnlockProtectiveStop()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.UnlockProtectiveStop();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Shutdown

Completely shut down the robot.

C#
// Shuts down and turns off robot and controller. Closes the connection. (From FW 1.4)
public CommandResponse Shutdown()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.Shutdown();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Programs

LoadProgram

Load a program from the robot's file system.

C#
// Start loading the specified program. (From FW 1.4)
Returns when both program and associated installation has loaded (or failed).
The load command fails if the associated installation requires confirmation of safety.The return value in this case will be 'Error while loading program'.
public CommandResponse LoadProgram(string programName)
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.LoadProgram("prg1.urp");
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

GetLoadedProgram

Get the name of the currently loaded program.

C#
// Returns the path of the loaded program. If not program is loaded, Value member is null. (From FW 1.6)
public CommandResponse<string> GetLoadedProgram()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetLoadedProgram();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
string loadedProgram = response.Value;
}

Play

Start executing the loaded program.

C#
// Starts program, if any program is loaded and robot is ready. (From FW 1.4)
Returns failure if the program fails to start.
public CommandResponse Play()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.Play();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Stop

Stop program execution.

C#
// Stops running program. (From FW 1.4)
Returns failure if the program fails to stop
public CommandResponse Stop()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.Stop();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Pause

Pause the running program.

C#
// Pauses the running program . (From FW 1.4)
Returns failure if the program fails to pause
public CommandResponse Pause()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.Pause();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Resume

Resume the paused program. Succeed is false if the robot cannot resume the program. A robot that does not know this command resumes a paused program with Play.

var robot = new UR();
robot.Connect("192.168.0.1");
robot.Dashboard.Pause();
// PolyScope X only. On PolyScope 5, call Play() to resume a paused program.
var response = robot.Dashboard.Resume();
if (!response.Succeed)
Console.WriteLine($"Cannot resume: {response.Message}");
robot.Disconnect();
}
Click to see the full code

IsProgramRunning

Check if a program is currently running.

C#
// Returns a True value is a program is running. (From FW 1.6)
public CommandResponse<bool> IsProgramRunning()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.IsProgramRunning();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
bool isProgramRunning = response.Value;
}

GetProgramState

Get the current program state.

C#
// Returns the state of the active program and path to loaded program file, or STOPPED if no program is loaded
public CommandResponse<ProgramState> GetProgramState()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetProgramState();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
ProgramState state = response.Value;
}
Class
ProgramState
C#Python

Describes a program state (its running state and its name)

MemberTypeDescription
ProgramState()
Constructor
Name
Field
string
Name of the loaded program
State
Field
ProgramStates
Running state of the loaded program
Equals(object)
Method
bool
Determines whether the specified object is equal to this program state.
GetHashCode()
Method
int
Returns a hash code for this program state.
ToString()
Method
string

IsProgramSaved

Check if the current program has unsaved changes.

C#
// Returns the save state of the active program and path to loaded program file. (From FW 1.8.11997)
public CommandResponse<ProgramSaveState> IsProgramSaved()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.IsProgramSaved();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
ProgramSaveState state = response.Value;
}
Class
ProgramSaveState
C#Python

Represents the save state of the currently loaded program on the Universal Robots controller.

MemberTypeDescription
ProgramSaveState()
Constructor
IsSaved
Field
bool
Is the program saved
Name
Field
string
Name of the loaded program
Equals(object)
Method
bool
Determines whether the specified object is equal to this program save state.
GetHashCode()
Method
int
Returns a hash code for this program save state.
ToString()
Method
string

Teach pendant

ShowPopup

Display a popup message on the teach pendant.

C#
// Shows a popup on Polyscope with the specified message. The popup-text will be translated to the selected language, if the text exists in the language file. (From FW 1.6)
public CommandResponse ShowPopup(string message)
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.ShowPopup("This is a popup message !");
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

ClosePopup

Close any open popup message.

C#
// Closes the popup (From FW 1.6)
public CommandResponse ClosePopup()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.ClosePopup();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

AddToLog

Add a message to the robot's log.

C#
// Adds log-message to the Log history. (From FW 1.8.11657)
public CommandResponse AddToLog(string message)
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.AddToLog("This is a log message !");
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Robot information

GetPolyscopeVersion

Get the Polyscope software version.

C#
// Returns the version of the Polyscope software (From FW 1.8.14035)
public CommandResponse<PolyscopeVersion> GetPolyscopeVersion()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetPolyscopeVersion();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

GetSerialNumber

Get the robot's serial number.

C#
// Returns serial number of the robot (FW 3.12 and from FW 5.6)
public CommandResponse GetSerialNumber()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetSerialNumber();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

GetRobotModel

Get the robot model (UR3, UR5, UR10, etc.). The UR15 is recognized. Unknown is returned for a model that the SDK does not know.

C#
// Returns the robot model (UR3, UR5, UR10, UR16, ...). (FW 3.12 and from FW 5.6)
public CommandResponse<RobotModels> GetRobotModel()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetRobotModel();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
RobotModels model = response.Value;
}
Enum
RobotModels
C#Python

Model of a UR robot

NameValueDescription
UR10
2
UR10 robot model.
UR10G1750
12
UR10 G 1750 robot model (G Series).
UR15
9
UR15 robot model.
UR16
4
UR16 robot model.
UR17G1300
13
UR17 G 1300 robot model (G Series).
UR18
5
UR18 robot model.
UR18G950
14
UR18 G 950 robot model (G Series).
UR20
7
UR20 robot model.
UR3
3
UR3 robot model.
UR30
8
UR30 robot model.
UR5
1
UR5 robot model.
UR8L
6
UR8 Long robot model.
Unknown
-128
The model is not known. Returned by RobotModelFromValue(int) for a value this SDK does not recognize.

LoadInstallation

Load an installation file.

C#
// Loads the specified installation file (From FW 3.2.18654)
public CommandResponse LoadInstallation(string installation)
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.LoadInstallation("default.installation");
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Operational mode

GetOperationalMode

Get the current operational mode.

C#
// Returns the operational mode. (From FW 5.6)
public CommandResponse<OperationalModes> GetOperationalMode()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetOperationalMode();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
OperationalModes mode = response.Value;
}
Enum
OperationalModes
C#Python

Enumerates all robot operational modes

NameValueDescription
Automatic
1
Loading and editing programs and installations is not allowed, only playing programs
Manual
0
Loading and editing programs is allowed
None
2
The password has not been set.

SetOperationalMode

Set the operational mode.

C#
// Controls the operational mode. See User manual for details. If this function is called the operational mode cannot be changed from PolyScope, and the user password is disabled. OperationalModes.None is not a valid operational mode. (From FW 5.0.0)
public CommandResponse SetOperationalMode(OperationalModes mode)
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.SetOperationalMode(OperationalModes.Manual);
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

ClearOperationalMode

Clear the current operational mode.

C#
// The operational mode can again be changed from PolyScope, and the user password is enabled. (From FW 5.0.0)
public CommandResponse ClearOperationalMode()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.ClearOperationalMode();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

IsInRemoteControl

Check if the robot is in remote control mode.

C#
// Returns the remote control status of the robot. If the robot Is In remote control it returns False And If remote control Is disabled Or robot Is in local control it returns false. (From FW 5.6)
public CommandResponse<bool> IsInRemoteControl()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.IsInRemoteControl();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
bool isRemoteControl = response.Value;
}

GetUserRole

Get the user role set with SetUserRole. Succeed is false if the robot answers a role that the SDK does not know.

var robot = new UR();
robot.Connect("192.168.0.1");
robot.Dashboard.SetUserRole(UserRoles.Operator);
// Succeed is false if the answer is not a known role
CommandResponse<UserRoles> role = robot.Dashboard.GetUserRole();
if (role.Succeed)
Console.WriteLine($"User role: {role.Value}");
robot.Disconnect();
}
Click to see the full code
Enum
UserRoles
C#Python

Enumerates all user roles

NameValueDescription
Locked
3
All buttons disabled and "Expert Mode" cannot be activated
None
2
All buttons enabled, "Expert Mode" is available (if correct password is supplied)
Operator
1
Only "RUN Program" And "SHUTDOWN Robot" buttons are enabled, "Expert Mode" cannot be activated
Programmer
0
In Setup Robot, buttons "Update", "Set Password", "Network", "Time" and "URCaps" are disabled, "Expert Mode" is available (if correct password is supplied)
restricted
4
Works like "operator" but does not give access to the move tab. (From FW 3.1.17136)

Safety

GetSafetyStatus

Get the current safety status.

C#
// Returns the current safety status. (From FW 3.11 to 3.12 and from FW 5.5)
public CommandResponse<SafetyStatus> GetSafetyStatus()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetSafetyStatus();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
SafetyStatus status = response.Value;
}
Enum
SafetyStatus
C#Python

Safety modes

NameValueDescription
AutomaticModeSafeguardStop
10
Automatic mode safeguard stop is active.
Fault
9
Safety is in fault mode
Normal
1
Safety is in normal operating conditions
ProtectiveStop
3
Protective safeguard Stop. This safety function is triggeredby an external protective device using safety inputs which will trigger a Cat 2 stop3per IEC 60204-1.
Recovery
4
When a safety limit is violated, the safety system must be restarted.
Reduced
2
Speed is reduced
RobotEmergencyStop
7
(EA + EB + SBUS->Screen) Physical e-stop interface input activated
SafeguardStop
5
(SI0 + SI1 + SBUS) Physical s-stop interface input
SystemEmergencyStop
6
(EA + EB + SBUS->Euromap67) Physical e-stop interface input activated
SystemThreePositionEnablingStop
11
System three-position enabling device stop is active.
Violation
8
Safety is in violation mode (for example, violation of the allowed delay between redundant signals)

GetSafetyMode

Get the current safety mode as a SafetyModes value. A mode that the SDK does not know gives SafetyModes.Unknown. The static class UrEnumHelper tells if the mode is a protective stop (IsProtectiveStopped) and if the robot can move (SafetyModeAllowsExecution: Normal or Reduced).

var robot = new UR();
robot.Connect("192.168.0.1");
CommandResponse<SafetyModes> response = robot.Dashboard.GetSafetyMode();
// Unknown if the robot answers a mode that the SDK does not know
SafetyModes mode = response.Value;
if (UrEnumHelper.IsProtectiveStopped(mode))
robot.Dashboard.UnlockProtectiveStop();
if (UrEnumHelper.SafetyModeAllowsExecution(mode))
robot.Dashboard.Play();
robot.Disconnect();
}
Click to see the full code
Enum
SafetyModes
C#Python

Safety modes of a UR robot.

NameValueDescription
AutomaticModeSafeguardStop
12
Safeguard stop in automatic mode.
Fault
9
Safety fault.
ImmiEmergencyStop
15
Emergency stop from the IMMI interface.
ImmiSafeguardStop
16
Safeguard stop from the IMMI interface.
Normal
1
Normal operation.
ProfisafeAutomaticModeSafeguardStop
18
PROFIsafe safeguard stop in automatic mode.
ProfisafeEmergencyStop
20
PROFIsafe emergency stop.
ProfisafeSafeguardStop
19
PROFIsafe safeguard stop.
ProfisafeWaitingForParameters
17
PROFIsafe is waiting for its parameters.
ProtectiveStop
3
Protective stop.
Recovery
4
Recovery mode after a safety limit violation.
Reduced
2
Reduced mode: speed and force limits are lower.
RobotEmergencyStop
7
Robot emergency stop.
SafeguardStop
5
Safeguard stop.
SafetyApiSafeguardStop
22
Safeguard stop requested through the safety API.
SystemEmergencyStop
6
System emergency stop.
SystemThreePositionEnablingStop
13
System three-position enabling device stop.
TpThreePositionEnablingStop
14
Teach pendant three-position enabling device stop.
UndefinedSafetyMode
11
Undefined safety mode.
Unknown
-128
The safety mode is not known. Returned for a value this SDK does not recognize.
ValidateJointId
10
The safety system validates the joint identification.
Violation
8
Safety violation.
Class
UrEnumHelper
C#Python

Conversions from the raw numbers sent by a robot to the enums of the SDK. An unknown number never throws: the result is the Unknown value of the enum.

MemberTypeDescription
ControlBoxTypeFromValue(int)
Method
static
ControlBoxType
Converts a raw control box number to ControlBoxType. Both numberings sent by the robots are accepted: 1 and 5 mean CB5, 2 and 7 mean CB7.
  • value : Raw control box number.
IsProtectiveStopped(SafetyModes)
Method
static
bool
Tells if the safety mode is a protective, safeguard or enabling device stop. Emergency stops, faults and violations are not included.
  • mode : Safety mode.
RobotModeFromValue(int)
Method
static
RobotModes
Converts a raw robot mode number to RobotModes.
  • value : Raw robot mode number.
RobotModelFromValue(int)
Method
static
RobotModels
Converts a raw robot model number to RobotModels.
  • value : Raw robot model number.
RobotSeriesFromModel(RobotModels, int, int)
Method
static
RobotSeries
Finds the series of a robot from its model and its software version.
  • model : Robot model.
  • softwareMajor : Major version of the software (3 or 5 for PolyScope, 10 for PolyScope X).
  • softwareMinor : Minor version of the software.
RobotSeriesFromValue(int)
Method
static
RobotSeries
Converts a raw robot series number to RobotSeries.
  • value : Raw series number: 1 for CB3, 2 for e-Series, 3 for UR Series, 4 for G Series.
SafetyModeAllowsExecution(SafetyModes)
Method
static
bool
Tells if the safety mode lets the robot move and run a program: Normal or Reduced.
  • mode : Safety mode.
SafetyModeFromValue(int)
Method
static
SafetyModes
Converts a raw safety mode number to SafetyModes.
  • value : Raw safety mode number.
ToolFlangeTypeFromValue(int)
Method
static
ToolFlangeType
Converts a raw tool flange number to ToolFlangeType.
  • value : Raw tool flange number: 1 for V1, 2 for V2.

CloseSafetyPopup

Close any safety-related popup.

C#
// Closes a safety popup. (From FW 3.1)
public CommandResponse CloseSafetyPopup()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.CloseSafetyPopup();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

RestartSafety

Restart the safety system after a safety fault.

C#
// Restarts the safety. Used when robot gets a safety fault or violation to restart the safety. After safety has been rebooted the robot will be in Power Off. (From FW 3.7 to 3.12.0 and from 5.1.0)
public CommandResponse RestartSafety()
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.RestartSafety();
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Diagnostics

The Dashboard Server saves the log, generates flight reports and support files. Flight reports and support files take time: the SDK waits up to 3 minutes for a flight report and up to 10 minutes for a support file.

var robot = new UR();
robot.Connect("192.168.0.1");
// Save the log of the robot to its log history file
robot.Dashboard.SaveLog();
// Generate a flight report (the SDK waits up to 3 minutes)
CommandResponse<string> report = robot.Dashboard.GenerateFlightReport(FlightReportTypes.System);
Console.WriteLine($"Flight report id: {report.Value}");
// Generate a support file in a directory of the programs folder (the SDK waits up to 10 minutes)
CommandResponse<string> supportFile = robot.Dashboard.GenerateSupportFile("/programs/support");
Console.WriteLine($"Support file: {supportFile.Value}");
robot.Disconnect();
}
Click to see the full code

SaveLog

Save the log of the robot to its log history file.

GenerateFlightReport

Generate a flight report of the controller, of the software or of the system. Value contains the identifier of the report.

Enum
FlightReportTypes
C#Python

Types of flight report that the robot can generate.

NameValueDescription
Controller
0
Report of the controller.
Software
1
Report of the software.
System
2
Report of the system.

GenerateSupportFile

Generate a support file in an existing directory of the robot. The directory must be inside the programs directory. Value contains the name of the file.

Variables and other commands

GetVariable

Read a global variable of the running program. See Read and write variables.

C#
// Get variable value and estimate its type
public CommandResponse<GlobalVariable> GetVariable(string name)
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.GetVariable("myVar");
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
// Get returned value
GlobalVariable variable = response.Value;
}

SendCustomDashboardCommand

Send a command of the Dashboard Server that has no method in the SDK. The answer of the robot is in Message.

C#
// Send a custom command to the Dashboard Server port
public CommandResponse SendCustomDashboardCommand(string command)
Example :
C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// Call the command
var response = ur.Dashboard.SendCustomDashboardCommand("robotmode");
if(response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
}

Try it in the demo application

Everything on this page can be tried without writing code, in the Dashboard (Polyscope legacy) page of the demo application.

Dashboard (Polyscope legacy) page of the Universal Robots SDK demo application

The demo application is open source. The C# source of this page is DashboardControl.cs.

What to read next

  • Run a program: a complete program, from power on to the end of the program.
  • Read and reset alarms: protective stops and safety faults.
  • Dashboard Server by Universal Robots: the list of the commands of the robot.