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](/universal-robots/documentation/rest-api).

## Prerequisites

- The service `Dashboard Server` is enabled on the robot: see [Prepare the robot](/universal-robots/documentation/connect#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](/universal-robots/documentation/connect#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.

**C# : Dashboard**
```csharp
using UnderAutomation.UniversalRobots;

class Dashboard
{
  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();
    /**/
  }
}
```

**Python : Dashboard**
```python
from underautomation.universal_robots.ur import UR
from underautomation.universal_robots.connect_parameters import ConnectParameters

##
robot = UR()

parameters = ConnectParameters("192.168.0.1")

# The Dashboard Server is enabled by default
parameters.dashboard.enable = True

robot.connect(parameters)

# Every command returns a CommandResponse
power_on = robot.dashboard.power_on()
if not power_on.succeed:
    print(power_on.message)

robot.dashboard.release_brake()
robot.dashboard.load_program("pick_and_place.urp")
robot.dashboard.play()

# Commands that read a value return a CommandResponse with a value
running = robot.dashboard.is_program_running()
print(f"Running: {running.value}")

# Close the Dashboard Server only
robot.dashboard.disable()
##
```

The same client works without `UR`:

**C# : DashboardDirect**
```csharp
using UnderAutomation.UniversalRobots.Dashboard;

class DashboardDirect
{
  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();
    /**/
  }
}
```

**Python : DashboardDirect**
```python
from underautomation.universal_robots.dashboard.dashboard_client import DashboardClient

##
# A Dashboard Server client, without a UR instance
client = DashboardClient()

# Address of the robot. Optional: port, receive and send timeouts
client.enable("192.168.0.1")

client.power_on()
client.release_brake()
client.play()

client.disable()
##
```

## 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`.

**Members of Dashboard.CommandResponse**
```csharp
public class CommandResponse {
    public CommandResponse()

    // Determines whether the specified object is equal to this response.
    public override bool Equals(object obj)

    // Returns a hash code for this response.
    public override int GetHashCode()

    // A message that described the error or the action done
    public string Message

    // The command as succeeded
    public bool Succeed

    // A human readable answer
    public override string ToString()
}
```

## Same code for PolyScope and PolyScope X

The Dashboard Server client and the [REST API](/universal-robots/documentation/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.

**C# : DashboardCommon**
```csharp
using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.Common;

class DashboardCommon
{
  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();
    /**/
  }
}
```

**Python : DashboardCommon**
```python
from underautomation.universal_robots.ur import UR
from underautomation.universal_robots.connect_parameters import ConnectParameters

##
# True for PolyScope X (REST API), False for PolyScope 5 (Dashboard Server)
is_polyscope_x = True

robot = UR()
param = ConnectParameters("192.168.0.1")
param.dashboard.enable = not is_polyscope_x
param.rest.enable = is_polyscope_x
robot.connect(param)

# robot.dashboard and robot.rest have the same method names
client = robot.rest if is_polyscope_x else robot.dashboard

client.power_on()
# Only the brakes differ: brake_release() on robot.rest, release_brake() on robot.dashboard
if is_polyscope_x:
    robot.rest.brake_release()
else:
    robot.dashboard.release_brake()
client.load_program("my_program")
client.play()

safety = client.get_safety_mode()
if safety.succeed:
    print(f"Safety mode: {safety.value}")
else:
    print(f"Error: {safety.message}")

robot.disconnect()
##
```

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.

**Members of Common.IRobotDashboard**
```csharp
public interface IRobotDashboard {
    // Closes the popup of the screen of the robot.
    RobotDashboardResponse ClosePopup()

    // Closes a safety popup of the screen of the robot.
    RobotDashboardResponse CloseSafetyPopup()

    // Gets the loaded program.
    RobotDashboardResponse<string> GetLoadedProgram()

    // Gets the operational mode of the robot.
    RobotDashboardResponse<OperationalModes> GetOperationalMode()

    // Gets the version of PolyScope.
    RobotDashboardResponse<PolyscopeVersion> GetPolyscopeVersion()

    // Gets the state of the program.
    RobotDashboardResponse<ProgramState> GetProgramState()

    // Gets the mode of the robot.
    RobotDashboardResponse<RobotModes> GetRobotMode()

    // Gets the safety mode of the robot.
    RobotDashboardResponse<SafetyModes> GetSafetyMode()

    // Indicates whether the robot is in remote control.
    RobotDashboardResponse<bool> IsInRemoteControl()

    // Loads a program of the robot.
    RobotDashboardResponse LoadProgram(string programName)

    // Pauses the running program.
    RobotDashboardResponse Pause()

    // Starts the loaded program.
    RobotDashboardResponse Play()

    // Powers off the robot arm.
    RobotDashboardResponse PowerOff()

    // Powers on the robot arm.
    RobotDashboardResponse PowerOn()

    // Releases the brakes of the robot.
    RobotDashboardResponse ReleaseBrake()

    // Restarts the safety system. After the restart the robot is in power off mode.
    RobotDashboardResponse RestartSafety()

    // Resumes the paused program.
    RobotDashboardResponse Resume()

    // Shows a popup on the screen of the robot.
    RobotDashboardResponse ShowPopup(string message)

    // Stops the running program.
    RobotDashboardResponse Stop()

    // Unlocks a protective stop.
    RobotDashboardResponse UnlockProtectiveStop()
}
```

**Members of Common.RobotDashboardResponse**
```csharp
public class RobotDashboardResponse {
    public RobotDashboardResponse()

    public override bool Equals(object obj)

    public override int GetHashCode()

    // Message of the robot, or description of the error.
    public string Message { get; set; }

    // Indicates that the robot accepted and executed the command.
    public bool Succeed { get; set; }

    public override string ToString()
}
```

## Power and brakes

### GetRobotMode

Get the current robot mode.

```csharp
// Returns the current robot state. (From FW 1.6)
CommandResponse<RobotModes> GetRobotMode();

var response = robot.Dashboard.GetRobotMode();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
RobotModes robotMode = response.Value;
```

**Members of Common.RobotModes**
```csharp
public enum RobotModes {
    // The robot is hand guided  by pushing teached button
    BackDrive = 6

    // The robot controller is booting
    Booting = 2

    // Robot has stopped due to a Safety Stop
    ConfirmSafety = 1

    // Robot is not connected to its controller
    Disconnected = 0

    // Power is on but breaks are not released
    Idle = 5

    // The robot has no controller (value -1), or it is in an obsolete CB2 mode
    Other = -1

    // The robot is powered off
    PowerOff = 3

    // The robot is powered on
    PowerOn = 4

    // Robot is in normal mode
    Running = 7

    // The mode is not known. Returned by <xref href="UnderAutomation.UniversalRobots.Common.UrEnumHelper.RobotModeFromValue(System.Int32)" data-throw-if-not-resolved="false"></xref> for a value this SDK does not recognize.
    Unknown = -128

    // Firmware is upgrading
    UpdatingFirmware = 8
}
```

### PowerOn

Power on the robot.

```csharp
// Powers on the robot arm. (From FW 3.0)
CommandResponse PowerOn();

var response = robot.Dashboard.PowerOn();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
```

### PowerOff

Power off the robot.

```csharp
// Powers off the robot arm. (From FW 3.0)
CommandResponse PowerOff();

var response = robot.Dashboard.PowerOff();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
```

### ReleaseBrake

Release the brakes after powering on.

```csharp
// Releases the brakes. (From FW 3.0)
CommandResponse ReleaseBrake();

var response = robot.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.

```csharp
// Closes the current popup and unlocks protective stop. (From FW 3.1)
CommandResponse UnlockProtectiveStop();

var response = robot.Dashboard.UnlockProtectiveStop();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
```

### Shutdown

Completely shut down the robot.

```csharp
// Shuts down and turns off robot and controller. Closes the connection. (From FW 1.4)
CommandResponse Shutdown();

var response = robot.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.

```csharp
// 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'.
CommandResponse LoadProgram(string programName);

var response = robot.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.

```csharp
// Returns the path of the loaded program. If not program is loaded, Value member is null. (From FW 1.6)
CommandResponse<string> GetLoadedProgram();

var response = robot.Dashboard.GetLoadedProgram();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
string loadedProgram = response.Value;
```

### Play

Start executing the loaded program.

```csharp
// Starts program, if any program is loaded and robot is ready. (From FW 1.4) Returns failure if the program fails to start.
CommandResponse Play();

var response = robot.Dashboard.Play();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
```

### Stop

Stop program execution.

```csharp
// Stops running program. (From FW 1.4) Returns failure if the program fails to stop
CommandResponse Stop();

var response = robot.Dashboard.Stop();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
```

### Pause

Pause the running program.

```csharp
// Pauses the running program . (From FW 1.4) Returns failure if the program fails to pause
CommandResponse Pause();

var response = robot.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`.

**C# : DashboardResume**
```csharp
using UnderAutomation.UniversalRobots;

class DashboardResume
{
  static void Main(string[] args)
  {
    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();
  }
}
```

**Python : DashboardResume**
```python
from underautomation.universal_robots.ur import UR

robot = UR()
robot.connect("192.168.0.1")

##
robot.dashboard.pause()

# PolyScope X only. On PolyScope 5, call play() to resume a paused program.
response = robot.dashboard.resume()
if not response.succeed:
    print(f"Cannot resume: {response.message}")
##

robot.disconnect()
```

### IsProgramRunning

Check if a program is currently running.

```csharp
// Returns a True value is a program is running. (From FW 1.6)
CommandResponse<bool> IsProgramRunning();

var response = robot.Dashboard.IsProgramRunning();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
bool isProgramRunning = response.Value;
```

### GetProgramState

Get the current program state.

```csharp
// Returns the state of the active program and path to loaded program file, or STOPPED if no program is loaded
CommandResponse<ProgramState> GetProgramState();

var response = robot.Dashboard.GetProgramState();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
ProgramState state = response.Value;
```

**Members of Dashboard.ProgramState**
```csharp
public class ProgramState {
    public ProgramState()

    // Determines whether the specified object is equal to this program state.
    public override bool Equals(object obj)

    // Returns a hash code for this program state.
    public override int GetHashCode()

    // Name of the loaded program
    public string Name

    // Running state of the loaded program
    public ProgramStates State

    public override string ToString()
}
```

### IsProgramSaved

Check if the current program has unsaved changes.

```csharp
// Returns the save state of the active program and path to loaded program file. (From FW 1.8.11997)
CommandResponse<ProgramSaveState> IsProgramSaved();

var response = robot.Dashboard.IsProgramSaved();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
ProgramSaveState state = response.Value;
```

**Members of Dashboard.ProgramSaveState**
```csharp
public class ProgramSaveState {
    public ProgramSaveState()

    // Determines whether the specified object is equal to this program save state.
    public override bool Equals(object obj)

    // Returns a hash code for this program save state.
    public override int GetHashCode()

    // Is the program saved
    public bool IsSaved

    // Name of the loaded program
    public string Name

    public override string ToString()
}
```

## Teach pendant

### ShowPopup

Display a popup message on the teach pendant.

```csharp
// 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)
CommandResponse ShowPopup(string message);

var response = robot.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.

```csharp
// Closes the popup (From FW 1.6)
CommandResponse ClosePopup();

var response = robot.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.

```csharp
// Adds log-message to the Log history. (From FW 1.8.11657)
CommandResponse AddToLog(string message);

var response = robot.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.

```csharp
// Returns the version of the Polyscope software (From FW 1.8.14035)
CommandResponse<PolyscopeVersion> GetPolyscopeVersion();

var response = robot.Dashboard.GetPolyscopeVersion();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
```

### GetSerialNumber

Get the robot's serial number.

```csharp
// Returns serial number of the robot (FW 3.12 and from FW 5.6)
CommandResponse GetSerialNumber();

var response = robot.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.

```csharp
// Returns the robot model (UR3, UR5, UR10, UR16, ...). (FW 3.12 and from FW 5.6)
CommandResponse<RobotModels> GetRobotModel();

var response = robot.Dashboard.GetRobotModel();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
RobotModels model = response.Value;
```

**Members of Common.RobotModels**
```csharp
public enum RobotModels {
    // UR10 robot model.
    UR10 = 2

    // UR10 G 1750 robot model (G Series).
    UR10G1750 = 12

    // UR15 robot model.
    UR15 = 9

    // UR16 robot model.
    UR16 = 4

    // UR17 G 1300 robot model (G Series).
    UR17G1300 = 13

    // UR18 robot model.
    UR18 = 5

    // UR18 G 950 robot model (G Series).
    UR18G950 = 14

    // UR20 robot model.
    UR20 = 7

    // UR3 robot model.
    UR3 = 3

    // UR30 robot model.
    UR30 = 8

    // UR5 robot model.
    UR5 = 1

    // UR8 Long robot model.
    UR8L = 6

    // The model is not known. Returned by <xref href="UnderAutomation.UniversalRobots.Common.UrEnumHelper.RobotModelFromValue(System.Int32)" data-throw-if-not-resolved="false"></xref> for a value this SDK does not recognize.
    Unknown = -128
}
```

### LoadInstallation

Load an installation file.

```csharp
// Loads the specified installation file (From FW 3.2.18654)
CommandResponse LoadInstallation(string installation);

var response = robot.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.

```csharp
// Returns the operational mode. (From FW 5.6)
CommandResponse<OperationalModes> GetOperationalMode();

var response = robot.Dashboard.GetOperationalMode();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
OperationalModes mode = response.Value;
```

**Members of Dashboard.OperationalModes**
```csharp
public enum OperationalModes {
    // Loading and editing programs and installations is not allowed, only playing programs
    Automatic = 1

    // Loading and editing programs is allowed
    Manual = 0

    // The password has not been set.
    None = 2
}
```

### SetOperationalMode

Set the operational mode.

```csharp
// 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)
CommandResponse SetOperationalMode(OperationalModes mode);

var response = robot.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.

```csharp
// The operational mode can again be changed from PolyScope, and the user password is enabled. (From FW 5.0.0)
CommandResponse ClearOperationalMode();

var response = robot.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.

```csharp
// 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)
CommandResponse<bool> IsInRemoteControl();

var response = robot.Dashboard.IsInRemoteControl();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
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.

**C# : DashboardUserRole**
```csharp
using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.Dashboard;

class DashboardUserRole
{
  static void Main(string[] args)
  {
    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();
  }
}
```

**Python : DashboardUserRole**
```python
from underautomation.universal_robots.ur import UR
from underautomation.universal_robots.dashboard.user_roles import UserRoles

robot = UR()
robot.connect("192.168.0.1")

##
robot.dashboard.set_user_role(UserRoles.Operator)

# succeed is False if the answer is not a known role
role = robot.dashboard.get_user_role()
if role.succeed:
    print(f"User role: {role.value}")
##

robot.disconnect()
```

**Members of Dashboard.UserRoles**
```csharp
public enum UserRoles {
    // All buttons disabled and "Expert Mode" cannot be activated
    Locked = 3

    // All buttons enabled, "Expert Mode" is available (if correct password is supplied)
    None = 2

    // Only "RUN Program" And "SHUTDOWN Robot" buttons are enabled, "Expert Mode" cannot be activated
    Operator = 1

    // In Setup Robot, buttons "Update", "Set Password", "Network", "Time" and "URCaps" are disabled, "Expert Mode" is available (if correct password is supplied)
    Programmer = 0

    // Works like "operator" but does not give access to the move tab. (From FW 3.1.17136)
    restricted = 4
}
```

## Safety

### GetSafetyStatus

Get the current safety status.

```csharp
// Returns the current safety status. (From FW 3.11 to 3.12 and from FW 5.5)
CommandResponse<SafetyStatus> GetSafetyStatus();

var response = robot.Dashboard.GetSafetyStatus();
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
SafetyStatus status = response.Value;
```

**Members of Common.SafetyStatus**
```csharp
public enum SafetyStatus : byte {
    // Automatic mode safeguard stop is active.
    AutomaticModeSafeguardStop = 10

    // Safety is in fault mode
    Fault = 9

    // Safety is in normal operating conditions
    Normal = 1

    // 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.
    ProtectiveStop = 3

    // When a safety limit is violated, the safety system must be restarted.
    Recovery = 4

    // Speed is reduced
    Reduced = 2

    // (EA + EB + SBUS-&gt;Screen) Physical e-stop interface input activated
    RobotEmergencyStop = 7

    // (SI0 + SI1 + SBUS) Physical s-stop interface input
    SafeguardStop = 5

    // (EA + EB + SBUS-&gt;Euromap67) Physical e-stop interface input activated
    SystemEmergencyStop = 6

    // System three-position enabling device stop is active.
    SystemThreePositionEnablingStop = 11

    // Safety is in violation mode (for example, violation of the allowed delay between redundant signals)
    Violation = 8
}
```

### 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`).

**C# : DashboardSafetyMode**
```csharp
using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.Common;
using UnderAutomation.UniversalRobots.Dashboard;

class DashboardSafetyMode
{
  static void Main(string[] args)
  {
    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();
  }
}
```

**Python : DashboardSafetyMode**
```python
from underautomation.universal_robots.ur import UR
from underautomation.universal_robots.common.ur_enum_helper import UrEnumHelper

robot = UR()
robot.connect("192.168.0.1")

##
response = robot.dashboard.get_safety_mode()

# Unknown if the robot answers a mode that the SDK does not know
mode = response.value

if UrEnumHelper.is_protective_stopped(mode):
    robot.dashboard.unlock_protective_stop()

if UrEnumHelper.safety_mode_allows_execution(mode):
    robot.dashboard.play()
##

robot.disconnect()
```

**Members of Common.SafetyModes**
```csharp
public enum SafetyModes {
    // Safeguard stop in automatic mode.
    AutomaticModeSafeguardStop = 12

    // Safety fault.
    Fault = 9

    // Emergency stop from the IMMI interface.
    ImmiEmergencyStop = 15

    // Safeguard stop from the IMMI interface.
    ImmiSafeguardStop = 16

    // Normal operation.
    Normal = 1

    // PROFIsafe safeguard stop in automatic mode.
    ProfisafeAutomaticModeSafeguardStop = 18

    // PROFIsafe emergency stop.
    ProfisafeEmergencyStop = 20

    // PROFIsafe safeguard stop.
    ProfisafeSafeguardStop = 19

    // PROFIsafe is waiting for its parameters.
    ProfisafeWaitingForParameters = 17

    // Protective stop.
    ProtectiveStop = 3

    // Recovery mode after a safety limit violation.
    Recovery = 4

    // Reduced mode: speed and force limits are lower.
    Reduced = 2

    // Robot emergency stop.
    RobotEmergencyStop = 7

    // Safeguard stop.
    SafeguardStop = 5

    // Safeguard stop requested through the safety API.
    SafetyApiSafeguardStop = 22

    // System emergency stop.
    SystemEmergencyStop = 6

    // System three-position enabling device stop.
    SystemThreePositionEnablingStop = 13

    // Teach pendant three-position enabling device stop.
    TpThreePositionEnablingStop = 14

    // Undefined safety mode.
    UndefinedSafetyMode = 11

    // The safety mode is not known. Returned for a value this SDK does not recognize.
    Unknown = -128

    // The safety system validates the joint identification.
    ValidateJointId = 10

    // Safety violation.
    Violation = 8
}
```

**Members of Common.UrEnumHelper**
```csharp
public static class UrEnumHelper {
    // Converts a raw control box number to <xref href="UnderAutomation.UniversalRobots.Common.ControlBoxType" data-throw-if-not-resolved="false"></xref>.
    // Both numberings sent by the robots are accepted: 1 and 5 mean CB5, 2 and 7 mean CB7.
    public static ControlBoxType ControlBoxTypeFromValue(int value)

    // Tells if the safety mode is a protective, safeguard or enabling device stop.
    // Emergency stops, faults and violations are not included.
    public static bool IsProtectiveStopped(SafetyModes mode)

    // Converts a raw robot mode number to <xref href="UnderAutomation.UniversalRobots.Common.RobotModes" data-throw-if-not-resolved="false"></xref>.
    public static RobotModes RobotModeFromValue(int value)

    // Converts a raw robot model number to <xref href="UnderAutomation.UniversalRobots.Common.RobotModels" data-throw-if-not-resolved="false"></xref>.
    public static RobotModels RobotModelFromValue(int value)

    // Finds the series of a robot from its model and its software version.
    public static RobotSeries RobotSeriesFromModel(RobotModels model, int softwareMajor, int softwareMinor)

    // Converts a raw robot series number to <xref href="UnderAutomation.UniversalRobots.Common.RobotSeries" data-throw-if-not-resolved="false"></xref>.
    public static RobotSeries RobotSeriesFromValue(int value)

    // Tells if the safety mode lets the robot move and run a program: Normal or Reduced.
    public static bool SafetyModeAllowsExecution(SafetyModes mode)

    // Converts a raw safety mode number to <xref href="UnderAutomation.UniversalRobots.Common.SafetyModes" data-throw-if-not-resolved="false"></xref>.
    public static SafetyModes SafetyModeFromValue(int value)

    // Converts a raw tool flange number to <xref href="UnderAutomation.UniversalRobots.Common.ToolFlangeType" data-throw-if-not-resolved="false"></xref>.
    public static ToolFlangeType ToolFlangeTypeFromValue(int value)
}
```

### CloseSafetyPopup

Close any safety-related popup.

```csharp
// Closes a safety popup. (From FW 3.1)
CommandResponse CloseSafetyPopup();

var response = robot.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.

```csharp
// 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)
CommandResponse RestartSafety();

var response = robot.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.

**C# : DashboardDiagnostics**
```csharp
using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.Dashboard;

class DashboardDiagnostics
{
  static void Main(string[] args)
  {
    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();
  }
}
```

**Python : DashboardDiagnostics**
```python
from underautomation.universal_robots.ur import UR
from underautomation.universal_robots.dashboard.flight_report_types import FlightReportTypes

robot = UR()
robot.connect("192.168.0.1")

##
# Save the log of the robot to its log history file
robot.dashboard.save_log()

# Generate a flight report (the SDK waits up to 3 minutes)
report = robot.dashboard.generate_flight_report(FlightReportTypes.System)
print(f"Flight report id: {report.value}")

# Generate a support file in a directory of the programs folder (the SDK waits up to 10 minutes)
support_file = robot.dashboard.generate_support_file("/programs/support")
print(f"Support file: {support_file.value}")
##

robot.disconnect()
```

### 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.

**Members of Dashboard.FlightReportTypes**
```csharp
public enum FlightReportTypes {
    // Report of the controller.
    Controller = 0

    // Report of the software.
    Software = 1

    // Report of the system.
    System = 2
}
```

### 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](/universal-robots/documentation/variables).

```csharp
// Get variable value and estimate its type
CommandResponse<GlobalVariable> GetVariable(string name);

var response = robot.Dashboard.GetVariable("myVar");
if (response.Succeed) Console.WriteLine("Succeed");
else Console.WriteLine("Command failed");
Console.WriteLine(response.Message);
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`.

```csharp
// Send a custom command to the Dashboard Server port
CommandResponse SendCustomDashboardCommand(string command);

var response = robot.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](/universal-robots/documentation/demo-app).

![Dashboard (Polyscope legacy) page of the Universal Robots SDK demo application](/universal-robots/WinformsScreenshots/Dashboard.jpg)

Its C# source is [DashboardControl.cs](https://github.com/underautomation/UniversalRobots.NET/blob/main/UnderAutomation.UniversalRobots.Showcase.Forms/Components/DashboardControl.cs).

## What to read next

- [Run a program](/universal-robots/documentation/how-to-run-program): a complete program, from power on to the end of the program.
- [Read and reset alarms](/universal-robots/documentation/how-to-read-reset-alarms): protective stops and safety faults.
- [Dashboard Server](https://www.universal-robots.com/articles/ur/dashboard-server-e-series-port-29999/) by Universal Robots: the list of the commands of the robot.