Introduction

All C# examples below assume that the assembly UnderAutomation.UniversalRobots.dll is referenced in your project, and that the directive using UnderAutomation.UniversalRobots; is present.

Connection

Connect to a UR robot

Initialize a TCP communication with a robot. The Connect() method take the hostname (ur-xxx) of the robot or its IP address that you can find in the “About Dialog-Box” in PolyScope.

using UnderAutomation.UniversalRobots;

///...

// Create a new UR instance
var ur = new UR();
ur.Connect("192.168.0.1");

The Connect() method can throw a InvalidLicenseException if your trial period is over or if your license key is invalid.

Check if robot is still connected

// Create a new UR instance
var ur = new UR();
ur.Connect("192.168.0.1");

// ...

// Ask if the robot is still connected
bool isConnected = ur.Connected;

Connect to a specific TCP port

// Create a new UR instance
var ur = new UR();

var port = UniversalRobotPorts.SecondaryClient;
ur.Connect("192.168.0.1", port);

When port is not specified, UniversalRobotPorts.PrimaryClient is used.

Members of UniversalRobotPorts :

public enum UniversalRobotPorts {

  // The default port that allow reading data and sending URScript
  PrimaryClient = 30001

  // This port can only read data. It is unable to send URScript.
  PrimaryClientReadOnly = 30011

  // The secondary port with same features as PrimaryClient
  SecondaryClient = 30002

  // A secondary port that can only read data. It is unable to send URScript.
  SecondaryClientReadOnly = 30012

}

Disconnect

// Create a new UR instance
var ur = new UR();
ur.Connect("192.168.0.1");

// ...

// Stop connection
ur.Disconnect();

Licensing

Register a license

You have 30 days free trial. For a long term use, you need to buy a license (See pricing). Then, we will send you a license key and you will just have to specify it with your company name with the static method RegisterLicense() of class UR.

// Register your license
UnderAutomation.UniversalRobots.UR.RegisterLicense("YourCompanyName", "YOUR_LICENSE_KEY");

Get current license information

You can get full information about current license with the static property LicenseInfo of class UR.

var info = UnderAutomation.UniversalRobots.UR.LicenseInfo;

Members of LicenseInfo :

public sealed class LicenseInfo {

  // Create a new LicenseInfo instance to retrieve informations about a pair of identifier/keyThis class should not be used to register your product. Please use static function UnderAutomation.UniversalRobot.UniversalRobotInterface.RegisterLicense to register a license.
  public LicenseInfo(string licenseIdentifier, string licenseKey)

  // Remaining days of the trial period. Null if the product is licensed. It could be negative if the trial period is ended since several days.
  public int? EvaluationDaysLeft { get; }

  // The date the trial period starts. If the product is licensed, the date of the library first use.
  public DateTime EvaluationStartDate { get; }

  // Name of your organisation
  public string Licensee { get; }

  // The date you get the license
  public DateTime? LicenseIssuedDate { get; }

  // The license key supplied by UnderAutomation (null for trial period)
  public string LicenseKey { get; }

  // The date your maintenance contract end and you no longer can use this license with newer versions.
  public DateTime? MaintenanceExpirationDate { get; }

  // Number of maintenance years included in your license
  public int MaintenanceYears { get; }

  // Commercial name of this .NET Software library
  public string Product { get; }

  // The date this version of the product was released.
  public DateTime ProductReleaseDate { get; }

  // The current license state
  public LicenseState State { get; }

  // A human description of the license
  public override string ToString()

  // The date the product will expire. Null if the product is licensed.
  public DateTime? TrialPeriodExpirationDate { get; }

}

Members of LicenseState :

public enum LicenseState {

  // The trial period as expired, you no more can use the library
  Expired = 3

  // The library is in an extra trial period, you can use the library
  ExtraTrial = 2

  // The pair License Identifier and License Key are incompatible, you cannot use the library
  Invalid = 0

  // Congratulations, the library is licensed.
  Licensed = 5

  // Your license does not allow you to use such a recent release. Please buy maintenance to use this version
  MaintenanceNeeded = 4

  // The library is in a trial period, you can use the library
  Trial = 1

}

Remote execute URScript

When calling Send() method, URScript (the programming language that controls the robot) is directly executed. If a program is running, it is immediately stopped to execute this script. Script can only be executed if you are connected to port UniversalRobotPorts.PrimaryClient (default if not specified) or UniversalRobotPorts.SecondaryClient.

// Create a new UR instance
var ur = new UR();
ur.Connect("192.168.0.1");

// ...

// Remote execute a movej
ur.Send("movej([-1.5,-1.5,-2,-0.5,1.8,0],a=1.4, v=1.05, t=0, r=0)");

// Set digital output 2 to true
ur.Send(set_digital_out(7,True));

Please refer to the Script Manual to see all the functions you can remotely call : Download PDF Script Manual.

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.

Members of 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.

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

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

  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.Play();
  
  if(response.Succeed) Console.WriteLine("Succeed");
  else Console.WriteLine("Command failed");
  
  Console.WriteLine(response.Message);
  
}

Stop

Stops running program. (From FW 1.4)

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

  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.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.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.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 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.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 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.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.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.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 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.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.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.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.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 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.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 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.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.SetOperationalMode(OperationalModes.Manual);
  
  if(response.Succeed) Console.WriteLine("Succeed");
  else Console.WriteLine("Command failed");
  
  Console.WriteLine(response.Message);
  
}

Members of 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.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.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 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.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.RestartSafety();
  
  if(response.Succeed) Console.WriteLine("Succeed");
  else Console.WriteLine("Command failed");
  
  Console.WriteLine(response.Message);
  
}

Robot data

Data described below are sent by the robot controller at 10Hz by the TCP/IP Client Interface protocol.

Robot 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
  // ...

  // Direct access to last received package
  RobotModeDataPackageEventArgs _lastRobotModeData = ur.RobotModeData;

  // Attach a delegate to the event triggered when new package comes 
  ur.RobotModeDataReceived += Ur_RobotModeDataReceived;
}

private void Ur_RobotModeDataReceived(object sender, RobotModeDataPackageEventArgs e) {
  // e contains the incoming package
}

Members of RobotModeDataPackageEventArgs :

public class RobotModeDataPackageEventArgs : PackageEventArgs {

  // Current robot control mode
  public ControlModes ControlMode { get; set; }

  // The button Emergency Stop is pressed
  public bool EmergencyStopped { get; set; }

  // Robot is connected to its controller
  public bool PhysicalRobotConnected { get; set; }

  // The running program is paused
  public bool ProgramPaused { get; set; }

  // A program is running
  public bool ProgramRunning { get; set; }

  // A stop occured due to a fault detection.
  public bool ProtectiveStopped { get; set; }

  // Real robot mode active. False if robot is in simulation
  public bool RealRobotEnabled { get; set; }

  // Current robot running mode
  public RobotModes RobotMode { get; set; }

  // Robot is powered on and boot is completed. If false, you need to press &quot;ON&quot; button to power it on.
  public bool RobotPowerOn { get; set; }

  // Speed scaling
  public double SpeedScaling { get; set; }

  // Overriden speed ratio between 0 (0%) and 1 (100%)
  public double TargetSpeedFraction { get; set; }

  // Maximum target speed fraction
  public double TargetSpeedFractionLimit { get; set; }

  // Timespan since the robot controller as started
  public TimeSpan Timestamp { get; set; }

}

Members of ControlModes :

public enum ControlModes {

  // Robot is force controlled. (For example : URScript force_mode() function is called)
  Force = 2

  // Robot is position controlled
  Position = 0

  // The robot is hand guided  by pushing teached button
  Teach = 1

  // Robot is torque controlled
  Torque = 3

}

Members of 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

}

Joint data

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

  // Direct access to last received package
  JointDataPackageEventArgs _lastJointData = ur.JointData;

  // Attach a delegate to the event triggered when new package comes 
  ur.JointDataReceived += Ur_JointDataReceived;
}

private void Ur_JointDataReceived(object sender, JointDataPackageEventArgs e) {
  // e contains the incoming package
}

Members of JointDataPackageEventArgs :

public class JointDataPackageEventArgs : PackageEventArgs {

  // Base joint data
  public JointData Base { get; set; }

  // Elbow joint data
  public JointData Elbow { get; set; }

  // Shoulder joint data
  public JointData Shoulder { get; set; }

  // Wrist1 joint data
  public JointData Wrist1 { get; set; }

  // Wrist2 joint data
  public JointData Wrist2 { get; set; }

  // Wrist3 (Tool) joint data
  public JointData Wrist3 { get; set; }

}

Members of JointData :

public class JointData {

  // Joint rotation speed in rad/s
  public double ActualSpeed { get; set; }

  // Motor current in Amps
  public float Current { get; set; }

  // Joint mode
  public JointModes JointMode { get; set; }

  // Angular joint position in radians
  public double Position { get; set; }

  // Angular target position in radians
  public double TargetPosition { get; set; }

  // Joint temperature in °C
  public float Temperature { get; set; }

  // Motor votage in Volts
  public float Voltage { get; set; }

}

Members of JointModes :

public enum JointModes : byte {

  Backdrive = 238

  Booting = 247

  Bootloder = 249

  Calibration = 250

  Fault = 252

  Idle = 255

  MotorInitialisation = 246

  NotResponding = 245

  PartDCalibration = 237

  PartDCalibrationError = 248

  PowerOff = 239

  Running = 253

  ShuttingDown = 236

}

Tool data

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

  // Direct access to last received package
  ToolDataPackageEventArgs _lastToolData = ur.ToolData;

  // Attach a delegate to the event triggered when new package comes 
  ur.ToolDataReceived += Ur_ToolDataReceived;
}

private void Ur_ToolDataReceived(object sender, ToolDataPackageEventArgs e) {
  // e contains the incoming package
}

Members of ToolDataPackageEventArgs :

public class ToolDataPackageEventArgs : PackageEventArgs {

  // Value of Analog input 2 (analog_in[2])
  public double AnalogInput2 { get; set; }

  // Value of Analog input 3 (analog_in[3])
  public double AnalogInput3 { get; set; }

  // Unit of analog input 2 (analog_in[2])
  public AnalogRanges AnalogInputRange2 { get; set; }

  // Unit of analog input 3 (analog_in[3])
  public AnalogRanges AnalogInputRange3 { get; set; }

  // Tool current in Amps
  public float ToolCurrent { get; set; }

  // Tool mode
  public ToolModes ToolMode { get; set; }

  // Tool output voltage
  public sbyte ToolOutputVoltage { get; set; }

  // Tool Temperature in °C
  public float ToolTemperature { get; set; }

  // Actual robot voltage power supply
  public float ToolVoltage48V { get; set; }

}

Members of AnalogRanges :

public enum AnalogRanges {

  // The analog value is in Amps (A)
  Current = 0

  // The analog value is in Volts (V)
  Voltage = 1

}

Members of ToolModes :

public enum ToolModes : byte {

  // Bootloader
  Bootloader = 249

  // Idle
  Idle = 255

  // Running
  Running = 253

}

Masterboard data

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

  // Direct access to last received package
  MasterboardDataPackageEventArgs _lastMasterboardData = ur.MasterboardData;

  // Attach a delegate to the event triggered when new package comes 
  ur.MasterboardDataReceived += Ur_MasterboardDataReceived;
}

private void Ur_MasterboardDataReceived(object sender, MasterboardDataPackageEventArgs e) {
  // e contains the incoming package
}

Members of MasterboardDataPackageEventArgs :

public class MasterboardDataPackageEventArgs : PackageEventArgs {

  // Value of analog input 0 (analog_in[0])
  public double AnalogInput0 { get; set; }

  // Value of analog input 1 (analog_in[1])
  public double AnalogInput1 { get; set; }

  // Unit of analog input 0 (analog_in[0])
  public AnalogRanges AnalogInputRange0 { get; set; }

  // Unit of analog input 1 (analog_in[1])
  public AnalogRanges AnalogInputRange1 { get; set; }

  // Value of analog output 0 (analog_out[0])
  public double AnalogOutput0 { get; set; }

  // Value of analog output 1 (analog_out[1])
  public double AnalogOutput1 { get; set; }

  // Unit of analog output 0 (analog_out[0])
  public AnalogRanges AnalogOutputDomain0 { get; set; }

  // Unit of analog output 1 (analog_out[1)
  public AnalogRanges AnalogOutputDomain1 { get; set; }

  // Register where each bit is a digital input value
  public MasterboardDigitalIO DigitalInputs { get; set; }

  // Register where each bit is a digital output value
  public MasterboardDigitalIO DigitalOutputs { get; set; }

  // The robot is interfaced to injection molding machines Euromap 67
  public sbyte Euromap67Installed { get; set; }

  // Euromap current
  public float EuromapCurrent { get; set; }

  // Register where each bit is a digital Euromap input
  public int EuromapInputBits { get; set; }

  // Register where each bit is a digital Euromap output
  public int EuromapOutputBits { get; set; }

  // Euromap votage
  public float EuromapVoltage { get; set; }

  // Robot is in reduced speed mode
  public byte InReducedMode { get; set; }

  // Temperature of masterboard in °C
  public float MasterboardTemperature { get; set; }

  // Current of all digital and analog inputs and outputs
  public float MasterIOCurrent { get; set; }

  // Position of operational mode selector input switch
  public byte OperationalModeSelectorInput { get; set; }

  // Robot current consumption in Amps
  public float RobotCurrent { get; set; }

  // Voltage of internal 48V power supply
  public float RobotVoltage48V { get; set; }

  // Masterboard safety mode
  public SafetyStatus Safetymode { get; set; }

  // Position of the 3-position enabling device
  public byte ThreePositionEnablingDeviceInput { get; set; }

}

Members of AnalogRanges :

public enum AnalogRanges {

  // The analog value is in Amps (A)
  Current = 0

  // The analog value is in Volts (V)
  Voltage = 1

}

Members of MasterboardDigitalIO :

public class MasterboardDigitalIO {

  // Register value seen as a bool array
  public BitArray BitArray { get; }

  public bool Configurable0 { get; }

  public bool Configurable1 { get; }

  public bool Configurable2 { get; }

  public bool Configurable3 { get; }

  public bool Configurable4 { get; }

  public bool Configurable5 { get; }

  public bool Configurable6 { get; }

  public bool Configurable7 { get; }

  public bool Digital0 { get; }

  public bool Digital1 { get; }

  public bool Digital2 { get; }

  public bool Digital3 { get; }

  public bool Digital4 { get; }

  public bool Digital5 { get; }

  public bool Digital6 { get; }

  public bool Digital7 { get; }

  public bool ToolDigital0 { get; }

  public bool ToolDigital1 { get; }

  // Register value
  public int Value { get; }

}

Members of SafetyModes :

public enum SafetyModes : byte {

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

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

}

Cartesian information

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

  // Direct access to last received package
  CartesianInfoPackageEventArgs _lastCartesianInfo = ur.CartesianInfo;

  // Attach a delegate to the event triggered when new package comes 
  ur.CartesianInfoReceived += Ur_CartesianInfoReceived;
}

private void Ur_CartesianInfoReceived(object sender, CartesianInfoPackageEventArgs e) {
  // e contains the incoming package
}

Members of CartesianInfoPackageEventArgs :

public class CartesianInfoPackageEventArgs : PackageEventArgs {

  // RX axis coordinate in degrees of the TCP in the current frame 
  public double Rx { get; set; }

  // RY axis coordinate in degrees of the TCP in the current frame 
  public double Ry { get; set; }

  // RZ axis coordinate in degrees of the TCP in the current frame 
  public double Rz { get; set; }

  // RX position of the TCP in the flange frame
  public double TCPOffsetRX { get; set; }

  // RY position of the TCP in the flange frame
  public double TCPOffsetRY { get; set; }

  // RZ position of the TCP in the flange frame
  public double TCPOffsetRZ { get; set; }

  // X position of the TCP in the flange frame
  public double TCPOffsetX { get; set; }

  // Y position of the TCP in the flange frame
  public double TCPOffsetY { get; set; }

  // Z position of the TCP in the flange frame
  public double TCPOffsetZ { get; set; }

  // X axis coordinate in mm of the TCP in the current frame 
  public double X { get; set; }

  // Y axis coordinate in mm of the TCP in the current frame 
  public double Y { get; set; }

  // Z axis coordinate in mm of the TCP in the current frame 
  public double Z { get; set; }

}

Kinematics information

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

  // Direct access to last received package
  KinematicsInfoPackageEventArgs _lastKinematicsInfo = ur.KinematicsInfo;

  // Attach a delegate to the event triggered when new package comes 
  ur.KinematicsInfoReceived += Ur_KinematicsInfoReceived;
}

private void Ur_KinematicsInfoReceived(object sender, KinematicsInfoPackageEventArgs e) {
  // e contains the incoming package
}

Members of KinematicsInfoPackageEventArgs :

public class KinematicsInfoPackageEventArgs : PackageEventArgs {

  // Base kinematics info
  public JointKinematicsInfo Base { get; set; }

  // Calibration status (0 : OK)
  public int CalibrationStatus { get; set; }

  // Elbow kinematics info
  public JointKinematicsInfo Elbow { get; set; }

  // Shoulder kinematics info
  public JointKinematicsInfo Shoulder { get; set; }

  // Wrist1 kinematics info
  public JointKinematicsInfo Wrist1 { get; set; }

  // Wrist2 kinematics info
  public JointKinematicsInfo Wrist2 { get; set; }

  // Wrist3 (Tool) kinematics info
  public JointKinematicsInfo Wrist3 { get; set; }

}

Members of JointKinematicsInfo :

public class JointKinematicsInfo {

  // Joint checksum
  public int Checksum { get; set; }

  // DH convention a parameter
  public double DHa { get; set; }

  // DH convention alpha parameter
  public double Dhalpha { get; set; }

  // DH convention d parameter
  public double DHd { get; set; }

  // DH convention theta parameter
  public double DHtheta { get; set; }

}

For more information about DH (Denavit-Hartenberg) parameters, please refer the following links :

Configuration data

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

  // Direct access to last received package
  ConfigurationDataPackageEventArgs _lastConfigurationData = ur.ConfigurationData;

  // Attach a delegate to the event triggered when new package comes 
  ur.ConfigurationDataReceived += Ur_ConfigurationDataReceived;
}

private void Ur_ConfigurationDataReceived(object sender, ConfigurationDataPackageEventArgs e) {
  // e contains the incoming package
}

Members of ConfigurationDataPackageEventArgs :

public class ConfigurationDataPackageEventArgs : PackageEventArgs {

  // Default joint acceleration speed in rad/s²
  public double AJointDefault { get; set; }

  // Default TCP acceleration speed in mm/s²
  public double AToolDefault { get; set; }

  // Base joint configuration
  public JointConfiguration Base { get; set; }

  // Controller box type
  public ControllerBoxTypes ControllerBoxType { get; set; }

  // Elbow joint configuration
  public JointConfiguration Elbow { get; set; }

  // Equipment radius in m
  public double EqRadius { get; set; }

  // Masterboard version
  public int MasterboardVersion { get; set; }

  // Robot serie
  public RobotSubTypes RobotSubType { get; set; }

  // Model of the robot (UR3, UR5, UR10, UR16)
  public RobotModels RobotType { get; set; }

  // Shoulder joint configuration
  public JointConfiguration Shoulder { get; set; }

  // Default joint angular speed in rad/s
  public double VJointDefault { get; set; }

  // Default TCP speed speed in mm/s
  public double VToolDefault { get; set; }

  // Wrist1 joint configuration
  public JointConfiguration Wrist1 { get; set; }

  // Wrist2 joint configuration
  public JointConfiguration Wrist2 { get; set; }

  // Wrist3 (Tool) joint configuration
  public JointConfiguration Wrist3 { get; set; }

}

Members of ControllerBoxTypes :

public enum ControllerBoxTypes {

  // UR10 controller box
  UR10 = 5

  // UR16 controller box
  UR16 = 16

  // UR3 controller box
  UR3 = 6

  // UR5 controller box
  UR5 = 4

}

Members of JointConfiguration :

public class JointConfiguration {

  // &quot;a&quot; parameter of Denavit–Hartenberg (DH) convention 
  public double DHa { get; set; }

  // Alpha parameter of Denavit–Hartenberg (DH) convention 
  public double DHalpha { get; set; }

  // d parameter of Denavit–Hartenberg (DH) convention 
  public double DHd { get; set; }

  // Theta parameter of Denavit–Hartenberg (DH) convention 
  public double DHtheta { get; set; }

  // Maximum rotation speed in rad/s²
  public double JointMaxAcceleration { get; set; }

  // Maximum angular position in rad
  public double JointMaxLimit { get; set; }

  // Maximum rotation speed in rad/s
  public double JointMaxSpeed { get; set; }

  // Minimum angular position in rad
  public double JointMinLimit { get; set; }

}

Members of RobotSubTypes :

public enum RobotSubTypes {

  // CB2-series (Firmware 1.x)
  CB2Serie = 1

  // CB3-series (Firmware 3.x)
  CB3Serie = 2

  // e-series (Firmware 5.x)
  ESerie = 3

}

Members of RobotModels :

public enum RobotModels {

  UR10 = 2

  UR16 = 4

  UR3 = 3

  UR5 = 1

}

Force mode data

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

  // Direct access to last received package
  ForceModeDataPackageEventArgs _lastForceModeData = ur.ForceModeData;

  // Attach a delegate to the event triggered when new package comes 
  ur.ForceModeDataReceived += Ur_ForceModeDataReceived;
}

private void Ur_ForceModeDataReceived(object sender, ForceModeDataPackageEventArgs e) {
  // e contains the incoming package
}

Members of ForceModeDataPackageEventArgs :

public class ForceModeDataPackageEventArgs : PackageEventArgs {

  // Dexterity of the robot
  public double RobotDexterity { get; set; }

  // Rx torque in tool frame in Nm
  public double Rx { get; set; }

  // Ry torque in tool frame in Nm
  public double Ry { get; set; }

  // Rz torque in tool frame in Nm
  public double Rz { get; set; }

  // X force in tool frame in N
  public double X { get; set; }

  // Y force in tool frame in N
  public double Y { get; set; }

  // Z force in tool frame in N
  public double Z { get; set; }

}

Additional information

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

  // Direct access to last received package
  AdditionalInfoPackageEventArgs _lastAdditionalInfo = ur.AdditionalInfo;

  // Attach a delegate to the event triggered when new package comes 
  ur.AdditionalInfoReceived += Ur_AdditionalInfoReceived;
}

private void Ur_AdditionalInfoReceived(object sender, AdditionalInfoPackageEventArgs e) {
  // e contains the incoming package
}

Members of AdditionalInfoPackageEventArgs :

public class AdditionalInfoPackageEventArgs : PackageEventArgs {

  // The free drive button is enabled
  public bool FreedriveButtonEnabled { get; set; }

  // The free drive button is pressed
  public bool FreedriveButtonPressed { get; set; }

  // Free drive is enable via IO
  public bool IOEnabledFreedrive { get; set; }

}

Calibration data

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

  // Direct access to last received package
  CalibrationDataPackageEventArgs _lastCalibrationData = ur.CalibrationData;

  // Attach a delegate to the event triggered when new package comes 
  ur.CalibrationDataReceived += Ur_CalibrationDataReceived;
}

private void Ur_CalibrationDataReceived(object sender, CalibrationDataPackageEventArgs e) {
  // e contains the incoming package
}

Members of CalibrationDataPackageEventArgs :

public class CalibrationDataPackageEventArgs : PackageEventArgs {

  // Frx calibration data
  public double Frx { get; set; }

  // Fry calibration data
  public double Fry { get; set; }

  // Frz calibration data
  public double Frz { get; set; }

  // Fx calibration data
  public double Fx { get; set; }

  // Fy calibration data
  public double Fy { get; set; }

  // Fz calibration data
  public double Fz { get; set; }

}

Safety data

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

  // Direct access to last received package
  SafetyDataPackageEventArgs _lastSafetyData = ur.SafetyData;

  // Attach a delegate to the event triggered when new package comes 
  ur.SafetyDataReceived += Ur_SafetyDataReceived;
}

private void Ur_SafetyDataReceived(object sender, SafetyDataPackageEventArgs e) {
  // e contains the incoming package
}

Members of SafetyDataPackageEventArgs :

public class SafetyDataPackageEventArgs : PackageEventArgs {

  // Irrelevent (Internal use only)
  public byte[] Data { get; set; }

}

Tool communication information

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

  // Direct access to last received package
  ToolCommunicationInfoPackageEventArgs _lastToolCommunicationInfo = ur.ToolCommunicationInfo;

  // Attach a delegate to the event triggered when new package comes 
  ur.ToolCommunicationInfoReceived += Ur_ToolCommunicationInfoReceived;
}

private void Ur_ToolCommunicationInfoReceived(object sender, ToolCommunicationInfoPackageEventArgs e) {
  // e contains the incoming package
}

Members of ToolCommunicationInfoPackageEventArgs :

public class ToolCommunicationInfoPackageEventArgs : PackageEventArgs {

  // Baude rate
  public int BaudRate { get; set; }

  // Parity
  public int Parity { get; set; }

  // RX Idle Chars
  public float RxIdleChars { get; set; }

  // Stop bits
  public int StopBits { get; set; }

  // Is the tool communication interface enabled
  public bool ToolCommunicationIsEnabled { get; set; }

  // TX Idle Chars
  public float TxIdleChars { get; set; }

}

Tool 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
  // ...

  // Direct access to last received package
  ToolModeInfoPackageEventArgs _lastToolModeInfo = ur.ToolModeInfo;

  // Attach a delegate to the event triggered when new package comes 
  ur.ToolModeInfoReceived += Ur_ToolModeInfoReceived;
}

private void Ur_ToolModeInfoReceived(object sender, ToolModeInfoPackageEventArgs e) {
  // e contains the incoming package
}

Members of ToolModeInfoPackageEventArgs :

public class ToolModeInfoPackageEventArgs : PackageEventArgs {

  // Digital output 0 configuration
  public DigitalOutputConfigurations DigitalOutputMode0 { get; set; }

  // Digital output 1 configuration
  public DigitalOutputConfigurations DigitalOutputMode1 { get; set; }

  // Digital output mode
  public OutputModes OutputMode { get; set; }

}

Members of DigitalOutputConfigurations :

public enum DigitalOutputConfigurations {

  // Push / Pull
  PushPull = 3

  // Sinking (NOPN)
  SinkingNPN = 1

  // Sourcing (PNP)
  SourcingPNP = 2

}

Members of OutputModes :

public enum OutputModes {

  // Dual Pin Power
  DualPinPower = 1

  // Standard output
  StandardOutput = 0

}