Remote Commands

Generality

All commands described below use the TCP/IP Dashboard server protocol to remote control the robot. Every command returns a CommandResponse object that describes the success of the request.

For more information about Dashboard server protocol, see : https://www.universal-robots.com/articles/ur/dashboard-server-cb-series-port-29999/

Members of Dashboard.CommandResponse :
public class CommandResponse {
// 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()
}

In particular, for request that have a returned value, a CommandResponse<t> object is returned with an additional public T Value member that contains the returned value.

Connect to the robot

By default, the Connect function of the UR class activates the Dashboard protocol.

// Create a new robot instance
var robot = new UR();
// Setup connection to the robot
var param = new ConnectParameters();
param.IP = "192.168.0.1";
// Optional : dashboard server is enabled by default in ConnectParameters
param.Dashboard.Enable = true;
//...
// Access all commands
robot.Dashboard.PowerOn();
robot.Dashboard.ReleaseBrake();
robot.Dashboard.Play();
//...
// Close connection to the robot
robot.Dashboard.Disable();

It is possible to create a client Dashboard outside an instance of UR. To do this, you just need to instantiate a DashboardClient object

// Create a dashboard client alone, outside any UR instance
var client = new DashboardClient();
// Set robot IP
client.Enable("192.168.0.1");
//...
// Access all commands
client.PowerOn();
client.ReleaseBrake();
client.Play();
//...
// Close connection to the robot
client.Disable();

Try it with the Windows example

DashboardServer

Power commands

Get robot mode

// Returns the current robot state. (From FW 1.6)
public CommandResponse<RobotModes> GetRobotMode()
Example :
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;
}
Members of Common.RobotModes :
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
// Robot 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
// Firmware is upgrading
UpdatingFirmware = 8
}

Power on

// Powers on the robot arm. (From FW 3.0)
public CommandResponse PowerOn()
Example :
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);
}

Power off

// Powers off the robot arm. (From FW 3.0)
public CommandResponse PowerOff()
Example :
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);
}

Release brake

// Releases the brakes. (From FW 3.0)
public CommandResponse ReleaseBrake()
Example :
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);
}

Unlock protective stop

// Closes the current popup and unlocks protective stop. (From FW 3.1)
public CommandResponse UnlockProtectiveStop()
Example :
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 robot

// Shuts down and turns off robot and controller. Closes the connection. (From FW 1.4)
public CommandResponse Shutdown()
Example :
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);
}

Program commands

Load program

// 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 &apos;Error while loading program&apos;.
public CommandResponse LoadProgram(string programName)
Example :
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);
}

Get loaded program

// 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 :
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

// 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 :
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

// Stops running program. (From FW 1.4)
Returns failure if the program fails to stop
public CommandResponse Stop()
Example :
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

// Pauses the running program . (From FW 1.4)
Returns failure if the program fails to pause
public CommandResponse Pause()
Example :
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);
}

Is program running

// Returns a True value is a program is running. (From FW 1.6)
public CommandResponse<bool> IsProgramRunning()
Example :
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;
}

Get program state

// 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 :
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;
}
Members of Dashboard.ProgramState :
public class ProgramState {
// Name of the loaded program
public string Name
// Running state of the loaded program
public ProgramStates State
public override string ToString()
}

Is program saved

// Returns the save state of the active program and path to loaded program file. (From FW 1.8.11997)
public CommandResponse<ProgramSaveState> IsProgramSaved()
Example :
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;
}
Members of Dashboard.ProgramSaveState :
public class ProgramSaveState {
// Is the program saved
public bool IsSaved
// Name of the loaded program
public string Name
public override string ToString()
}

Information commands

Show popup

// 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 :
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);
}

Close popup

// Closes the popup (From FW 1.6)
public CommandResponse ClosePopup()
Example :
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);
}

Add message to log

// Adds log-message to the Log history. (From FW 1.8.11657)
public CommandResponse AddToLog(string message)
Example :
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);
}

Get Polyscope version

// Returns the version of the Polyscope software (From FW 1.8.14035)
public CommandResponse<PolyscopeVersion> GetPolyscopeVersion()
Example :
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);
}

Load installation file

// Loads the specified installation file (From FW 3.2.18654)
public CommandResponse LoadInstallation(string installation)
Example :
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);
}

Get serial number

// Returns serial number of the robot (FW 3.12 and from FW 5.6)
public CommandResponse GetSerialNumber()
Example :
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);
}

Get robot model

// Returns the robot model (UR3, UR5, UR10 or UR16). (FW 3.12 and from FW 5.6)
public CommandResponse<RobotModels> GetRobotModel()
Example :
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;
}
Members of Common.RobotModels :
public enum RobotModels {
UR10 = 2
UR16 = 4
UR3 = 3
UR5 = 1
}

Operational mode commands

Get operational mode

// Returns the operational mode. (From FW 5.6)
public CommandResponse<OperationalModes> GetOperationalMode()
Example :
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;
}
Members of Dashboard.OperationalModes :
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
}

Clear operational mode

// The operational mode can again be changed from PolyScope, and the user password is enabled. (From FW 5.0.0)
public CommandResponse ClearOperationalMode()
Example :
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);
}

Set operational mode

// 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 :
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);
}
Members of Dashboard.OperationalModes :
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
}

Is robot in remote control

// 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 :
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;
}

Safety commands

Get safety status

// Returns the current safety status. (From FW 3.11 to 3.12 and from FW 5.5)
public CommandResponse<SafetyStatus> GetSafetyStatus()
Example :
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;
}
Members of Common.SafetyStatus :
public enum SafetyStatus : byte {
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->Screen) Physical e-stop interface input activated
RobotEmergencyStop = 7
// (SI0 + SI1 + SBUS) Physical s-stop interface input
SafeguardStop = 5
// (EA + EB + SBUS->Euromap67) Physical e-stop interface input activated
SystemEmergencyStop = 6
SystemThreePositionEnablingStop = 11
// Safety is in violation mode (for example, violation of the allowed delay between redundant signals)
Violation = 8
}

Close safety popup

// Closes a safety popup. (From FW 3.1)
public CommandResponse CloseSafetyPopup()
Example :
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);
}

Restart safety

// 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 :
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);
}

Read more