The Primary Interface of a Universal Robots cobot sends the state of the robot 10 times per second: modes, joints, tool, I/O, Cartesian position, kinematics, configuration and messages. This page shows how to connect to it and read its data. The same connection sends URScript: see [Send URScript](/universal-robots/documentation/remote-send-script).

## Connect

The Primary Interface is enabled by default: `Connect("192.168.0.1")` opens it. With a `ConnectParameters`, you can also choose the port:

| Port  | `Interfaces`                 | Data          | URScript |
| ----- | ---------------------------- | ------------- | -------- |
| 30001 | `PrimaryInterface` (default) | All packages  | yes      |
| 30002 | `SecondaryInterface`         | All packages  | yes      |
| 30011 | `PrimaryInterfaceReadOnly`   | All packages  | no       |
| 30012 | `SecondaryInterfaceReadOnly` | All packages  | no       |

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

class PrimaryInterface
{
  static void Main(string[] args)
  {
    /**/
    var robot = new UR();

    var parameters = new ConnectParameters("192.168.0.1");

    // The Primary Interface is enabled by default
    parameters.PrimaryInterface.Enable = true;

    // Port 30001 (default) accepts URScript. The read only ports do not
    parameters.PrimaryInterface.Port = Interfaces.PrimaryInterface;

    robot.Connect(parameters);

    // The last values received are in the properties of the client
    double baseSpeed = robot.PrimaryInterface.JointData.Base.ActualSpeed;

    // Close the Primary Interface only
    robot.PrimaryInterface.Disconnect();

    // Close every service
    robot.Disconnect();
    /**/
  }
}
```

**Python : PrimaryInterface**
```python
from underautomation.universal_robots.ur import UR
from underautomation.universal_robots.connect_parameters import ConnectParameters
from underautomation.universal_robots.primary_interface.interfaces import Interfaces

##
robot = UR()

parameters = ConnectParameters("192.168.0.1")

# The Primary Interface is enabled by default
parameters.primary_interface.enable = True

# Port 30001 (default) accepts URScript. The read only ports do not
parameters.primary_interface.port = Interfaces.PrimaryInterface

robot.connect(parameters)

# The last values received are in the properties of the client
base_speed = robot.primary_interface.joint_data.base.actual_speed

# Close the Primary Interface only
robot.primary_interface.disconnect()

# Close every service
robot.disconnect()
##
```

The same client works without `UR`:

**C# : PrimaryInterfaceDirect**
```csharp
using UnderAutomation.UniversalRobots.PrimaryInterface;

class PrimaryInterfaceDirect
{
  static void Main(string[] args)
  {
    /**/
    // A Primary Interface client, without a UR instance
    var client = new PrimaryInterfaceClient();

    client.Connect("192.168.0.1", Interfaces.PrimaryInterface);

    double baseSpeed = client.JointData.Base.ActualSpeed;

    client.Disconnect();
    /**/
  }
}
```

**Python : PrimaryInterfaceDirect**
```python
from underautomation.universal_robots.primary_interface.primary_interface_client import PrimaryInterfaceClient
from underautomation.universal_robots.primary_interface.interfaces import Interfaces

##
# A Primary Interface client, without a UR instance
client = PrimaryInterfaceClient()

client.connect("192.168.0.1", Interfaces.PrimaryInterface)

base_speed = client.joint_data.base.actual_speed

client.disconnect()
##
```

The service `Primary Client Interface` must be enabled on the robot: see [Prepare the robot](/universal-robots/documentation/connect#prepare_the_robot). For the data of the interface, see [Remote control via TCP/IP](https://www.universal-robots.com/articles/ur/interface-communication/remote-control-via-tcpip/) by Universal Robots.

## Read the data

Each package of the robot has a property, which holds the last values received, and an event, raised when the package arrives. A property is `null` until its first package: wait about 100 ms after the connection.

**C# : PrimaryInterfaceData**
```csharp
using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.PrimaryInterface;

class PrimaryInterfaceData
{
  static void Main(string[] args)
  {
    var robot = new UR();

    robot.Connect("192.168.0.1");

    /**/
    // Last package received, read at any time
    JointDataPackageEventArgs joints = robot.PrimaryInterface.JointData;
    double shoulder = joints.Shoulder.Position; // rad

    CartesianInfoPackageEventArgs tool = robot.PrimaryInterface.CartesianInfo;
    double x = tool.X; // m

    // Or an event, raised when a package arrives (10 Hz)
    robot.PrimaryInterface.JointDataReceived += (sender, e) =>
    {
      double wrist3Speed = e.Wrist3.ActualSpeed; // rad/s
    };

    robot.PrimaryInterface.RobotModeDataReceived += (sender, e) =>
    {
      bool programRunning = e.ProgramRunning;
    };
    /**/
  }
}
```

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

robot = UR()

robot.connect("192.168.0.1")

##
# Last package received, read at any time
joints = robot.primary_interface.joint_data
shoulder = joints.shoulder.position  # rad

tool = robot.primary_interface.cartesian_info
x = tool.x  # m

# Or an event, raised when a package arrives (10 Hz).
# Read the values in the properties of the client
def on_joint_data(sender, e):
    wrist3_speed = robot.primary_interface.joint_data.wrist3.actual_speed  # rad/s

robot.primary_interface.joint_data_received(on_joint_data)

def on_robot_mode(sender, e):
    program_running = robot.primary_interface.robot_mode_data.program_running

robot.primary_interface.robot_mode_data_received(on_robot_mode)
##
```

The sections below list the content of each package.

## State of the connection

`Connected` becomes `false` when the connection is lost (robot stopped, cable unplugged). No event is raised and there is no automatic reconnection: call `Connect` again. `InternalErrorOccured` is raised when the SDK meets an error.

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

class PrimaryInterfaceStatus
{
  static void Main(string[] args)
  {
    var robot = new UR();

    robot.Connect("192.168.0.1");

    /**/
    // false after a loss of the connection. There is no automatic reconnection
    bool connected = robot.PrimaryInterface.Connected;

    if (!connected)
      robot.Connect("192.168.0.1");

    // Raised when an error happens in the background
    robot.PrimaryInterface.InternalErrorOccured += (sender, e) =>
    {
      Exception exception = e.Exception;
      string message = e.Message;
      StatusCode status = e.Status;
    };
    /**/
  }
}
```

**Python : PrimaryInterfaceStatus**
```python
from underautomation.universal_robots.ur import UR
from underautomation.universal_robots.common.internal_error_event_args import InternalErrorEventArgs

robot = UR()

robot.connect("192.168.0.1")

##
# False after a loss of the connection. There is no automatic reconnection
connected = robot.primary_interface.connected

if not connected:
    robot.connect("192.168.0.1")

# Raised when an error happens in the background
def on_error(sender, e):
    error = InternalErrorEventArgs(e._instance)
    print(error.status, error.message, error.exception)

robot.primary_interface.internal_error_occured(on_error)
##
```

## Try it in the demo application

Everything on this page can be tried without writing code, in the **Primary Interface (Data streaming and script)** page of the [demo application](/universal-robots/documentation/demo-app).

![Primary Interface (Data streaming and script) page of the Universal Robots SDK demo application](/universal-robots/WinformsScreenshots/PrimaryInterface.jpg)

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

## Packages

### Robot mode

**C# : RobotModeData**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.RobotModeDataPackageEventArgs**
```csharp
public class RobotModeDataPackageEventArgs : PackageEventArgs {
    public RobotModeDataPackageEventArgs()

    // Current robot control mode
    [PackageDescription("Current robot control mode")]
    public ControlModes ControlMode { get; set; }

    // The button Emergency Stop is pressed
    [PackageDescription("The button Emergency Stop is pressed")]
    public bool EmergencyStopped { get; set; }

    // Robot is connected to its controller
    [PackageDescription("Robot is connected to its controller")]
    public bool PhysicalRobotConnected { get; set; }

    // The running program is paused
    [PackageDescription("The running program is paused")]
    public bool ProgramPaused { get; set; }

    // A program is running
    [PackageDescription("A program is running")]
    public bool ProgramRunning { get; set; }

    // A stop occured due to a fault detection
    [PackageDescription("A stop occured due to a fault detection")]
    public bool ProtectiveStopped { get; set; }

    // Real robot mode active. False if robot is in simulation
    [PackageDescription("Real robot mode active. False if robot is in simulation")]
    public bool RealRobotEnabled { get; set; }

    // Current robot running mode
    [PackageDescription("Current robot running mode")]
    public RobotModes RobotMode { get; set; }

    // Robot is powered on and boot is completed. If false, you need to press "ON" button to power it on
    [PackageDescription("Robot is powered on and boot is completed. If false, you need to press \"ON\" button to power it on")]
    public bool RobotPowerOn { get; set; }

    // Speed scaling
    [PackageDescription("Speed scaling")]
    public double SpeedScaling { get; set; }

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

    // Maximum target speed fraction
    [PackageDescription("Maximum target speed fraction")]
    public double TargetSpeedFractionLimit { get; set; }

    // Timespan since the robot controller has started
    [PackageDescription("Timespan since the robot controller has started")]
    public TimeSpan Timestamp { get; set; }

    // Returns a string representation of the robot mode data.
    public override string ToString()
}
```

**Members of Common.ControlModes**
```csharp
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 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
}
```

### Joint data

**C# : JointData**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.JointDataPackageEventArgs**
```csharp
public class JointDataPackageEventArgs : PackageEventArgs {
    public JointDataPackageEventArgs()

    // Base joint data
    [PackageDescription("Base joint data")]
    public JointData Base { get; set; }

    // Elbow joint data
    [PackageDescription("Elbow joint data")]
    public JointData Elbow { get; set; }

    // Shoulder joint data
    [PackageDescription("Shoulder joint data")]
    public JointData Shoulder { get; set; }

    // Returns a string representation of the joint data for all six joints.
    public override string ToString()

    // Wrist1 joint data
    [PackageDescription("Wrist1 joint data")]
    public JointData Wrist1 { get; set; }

    // Wrist2 joint data
    [PackageDescription("Wrist2 joint data")]
    public JointData Wrist2 { get; set; }

    // Wrist3 (Tool) joint data
    [PackageDescription("Wrist3 (Tool) joint data")]
    public JointData Wrist3 { get; set; }
}
```

![Joints of a UR robot](/universal-robots/joints.png)

**Members of PrimaryInterface.JointData**
```csharp
public class JointData {
    public JointData()

    // Joint rotation speed in rad/s
    [PackageDescription("Joint rotation speed in rad/s", PackageUnit.RadianPerSecond)]
    public double ActualSpeed { get; set; }

    // Motor current in Amps
    [PackageDescription("Motor current in Amps", PackageUnit.Amp)]
    public float Current { get; set; }

    public override bool Equals(object obj)

    public override int GetHashCode()

    // Joint mode
    [PackageDescription("Joint mode")]
    public JointModes JointMode { get; set; }

    // Angular joint position in radian
    [PackageDescription("Angular joint position in radian", PackageUnit.Radian)]
    public double Position { get; set; }

    // Angular target position in radian
    [PackageDescription("Angular target position in radian", PackageUnit.Radian)]
    public double TargetPosition { get; set; }

    // Joint temperature in °C
    [PackageDescription("Joint temperature in °C", PackageUnit.CelsiusDegree)]
    public float Temperature { get; set; }

    public override string ToString()

    // Motor voltage in Volts
    [PackageDescription("Motor voltage in Volts", PackageUnit.Volt)]
    public float Voltage { get; set; }
}
```

**Members of Common.JointModes**
```csharp
public enum JointModes : byte {
    // Joint is in backdrive mode.
    Backdrive = 238

    // Joint is booting.
    Booting = 247

    // Joint is in bootloader mode.
    Bootloader = 249

    // Joint is calibrating.
    Calibration = 250

    // Joint is in a fault state.
    Fault = 252

    // Joint is idle.
    Idle = 255

    // Joint motor is initializing.
    MotorInitialisation = 246

    // Joint is not responding.
    NotResponding = 245

    // Joint is in part D calibration mode.
    PartDCalibration = 237

    // Joint part D calibration encountered an error.
    PartDCalibrationError = 248

    // Joint is powered off.
    PowerOff = 239

    // Joint is running normally.
    Running = 253

    // Joint is shutting down.
    ShuttingDown = 236
}
```

### Tool data

**C# : ToolData**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.ToolDataPackageEventArgs**
```csharp
public class ToolDataPackageEventArgs : PackageEventArgs {
    public ToolDataPackageEventArgs()

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

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

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

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

    // Returns a string representation of the tool data.
    public override string ToString()

    // Tool current in Amps
    [PackageDescription("Tool current in Amps", PackageUnit.Amp)]
    public float ToolCurrent { get; set; }

    // Tool mode
    [PackageDescription("Tool mode")]
    public ToolModes ToolMode { get; set; }

    // Tool output voltage
    [PackageDescription("Tool output voltage", PackageUnit.Volt)]
    public sbyte ToolOutputVoltage { get; set; }

    // Tool Temperature in °C
    [PackageDescription("Tool Temperature in °C", PackageUnit.CelsiusDegree)]
    public float ToolTemperature { get; set; }

    // Actual robot voltage power supply
    [PackageDescription("Actual robot voltage power supply", PackageUnit.Volt)]
    public float ToolVoltage48V { get; set; }
}
```

**Members of Common.AnalogRanges**
```csharp
public enum AnalogRanges {
    // The analog value is in Amps (A)
    Current = 0

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

**Members of Common.ToolModes**
```csharp
public enum ToolModes : byte {
    // Bootloader
    Bootloader = 249

    // Idle
    Idle = 255

    // Running
    Running = 253
}
```

### Masterboard data

**C# : MasterboardData**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.MasterboardDataPackageEventArgs**
```csharp
public class MasterboardDataPackageEventArgs : PackageEventArgs {
    public MasterboardDataPackageEventArgs()

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

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

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

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

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

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

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

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

    // Register where each bit is a digital input value
    [PackageDescription("Register where each bit is a digital input value")]
    public MasterboardDigitalIO DigitalInputs { get; set; }

    // Register where each bit is a digital output value
    [PackageDescription("Register where each bit is a digital output value")]
    public MasterboardDigitalIO DigitalOutputs { get; set; }

    // The robot is interfaced to injection molding machines Euromap 67
    [PackageDescription("The robot is interfaced to injection molding machines Euromap 67")]
    public sbyte Euromap67Installed { get; set; }

    // Euromap current
    [PackageDescription("Euromap current", PackageUnit.Amp)]
    public float EuromapCurrent { get; set; }

    // Register where each bit is a digital Euromap input
    [PackageDescription("Register where each bit is a digital Euromap input")]
    public int EuromapInputBits { get; set; }

    // Register where each bit is a digital Euromap output
    [PackageDescription("Register where each bit is a digital Euromap output")]
    public int EuromapOutputBits { get; set; }

    // Euromap voltage
    [PackageDescription("Euromap voltage", PackageUnit.Volt)]
    public float EuromapVoltage { get; set; }

    // Robot is in reduced speed mode
    [PackageDescription("Robot is in reduced speed mode")]
    public byte InReducedMode { get; set; }

    // True if the robot is in a protective, safeguard or enabling device stop.
    public bool IsProtectiveStopped { get; }

    // Current of all digital and analog inputs and outputs
    [PackageDescription("Current of all digital and analog inputs and outputs", PackageUnit.Amp)]
    public float MasterIOCurrent { get; set; }

    // Temperature of masterboard in °C
    [PackageDescription("Temperature of masterboard in °C", PackageUnit.CelsiusDegree)]
    public float MasterboardTemperature { get; set; }

    // Position of operational mode selector input switch
    [PackageDescription("Position of operational mode selector input switch")]
    public byte OperationalModeSelectorInput { get; set; }

    // Robot current consumption in Amps
    [PackageDescription("Robot current consumption in Amps", PackageUnit.Amp)]
    public float RobotCurrent { get; set; }

    // Voltage of internal 48V power supply
    [PackageDescription("Voltage of internal 48V power supply", PackageUnit.Volt)]
    public float RobotVoltage48V { get; set; }

    // True if the safety mode lets the robot move (Normal or Reduced).
    public bool SafetyModeAllowsExecution { get; }

    // Safety mode as a <xref href="UnderAutomation.UniversalRobots.Common.SafetyModes" data-throw-if-not-resolved="false"></xref> value. <xref href="UnderAutomation.UniversalRobots.Common.SafetyModes.Unknown" data-throw-if-not-resolved="false"></xref> if the robot sent a value this SDK does not know.
    public SafetyModes SafetyModeValue { get; }

    // Masterboard safety mode
    [PackageDescription("Masterboard safety mode")]
    public SafetyStatus Safetymode { get; set; }

    // Position of the 3-position enabling device
    [PackageDescription("Position of the 3-position enabling device")]
    public byte ThreePositionEnablingDeviceInput { get; set; }

    // Returns a string representation of the masterboard data.
    public override string ToString()
}
```

**Members of PrimaryInterface.MasterboardDigitalIO**
```csharp
public class MasterboardDigitalIO {
    // Register value seen as a bool array
    [PackageDescription("Register value seen as a bool array")]
    public BitArray BitArray { get; }

    // State of configurable digital I/O pin 0.
    public bool Configurable0 { get; }

    // State of configurable digital I/O pin 1.
    public bool Configurable1 { get; }

    // State of configurable digital I/O pin 2.
    public bool Configurable2 { get; }

    // State of configurable digital I/O pin 3.
    public bool Configurable3 { get; }

    // State of configurable digital I/O pin 4.
    public bool Configurable4 { get; }

    // State of configurable digital I/O pin 5.
    public bool Configurable5 { get; }

    // State of configurable digital I/O pin 6.
    public bool Configurable6 { get; }

    // State of configurable digital I/O pin 7.
    public bool Configurable7 { get; }

    // State of standard digital I/O pin 0.
    public bool Digital0 { get; }

    // State of standard digital I/O pin 1.
    public bool Digital1 { get; }

    // State of standard digital I/O pin 2.
    public bool Digital2 { get; }

    // State of standard digital I/O pin 3.
    public bool Digital3 { get; }

    // State of standard digital I/O pin 4.
    public bool Digital4 { get; }

    // State of standard digital I/O pin 5.
    public bool Digital5 { get; }

    // State of standard digital I/O pin 6.
    public bool Digital6 { get; }

    // State of standard digital I/O pin 7.
    public bool Digital7 { get; }

    public override bool Equals(object obj)

    public override int GetHashCode()

    public override string ToString()

    // State of tool digital I/O pin 0.
    public bool ToolDigital0 { get; }

    // State of tool digital I/O pin 1.
    public bool ToolDigital1 { get; }

    // Register value
    [PackageDescription("Register value")]
    public int Value { get; }
}
```

**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
}
```

`SafetyModeValue` gives the safety mode as a `SafetyModes` value, or `SafetyModes.Unknown` for a value that the SDK does not know. `IsProtectiveStopped` is true for a protective, safeguard or enabling device stop. `SafetyModeAllowsExecution` is true when the robot can move (`Normal` or `Reduced`).

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

class PrimaryInterfaceSafetyMode
{
  static void Main(string[] args)
  {
    var robot = new UR();
    var param = new ConnectParameters("192.168.0.1");
    param.PrimaryInterface.Enable = true;
    robot.Connect(param);

    /**/
    var masterboard = robot.PrimaryInterface.MasterboardData;

    // Unknown if the robot sends a value that the SDK does not know
    SafetyModes mode = masterboard.SafetyModeValue;

    // Protective, safeguard or enabling device stop
    bool stopped = masterboard.IsProtectiveStopped;

    // Normal or Reduced
    bool canMove = masterboard.SafetyModeAllowsExecution;

    Console.WriteLine($"{mode}, stopped: {stopped}, can move: {canMove}");
    /**/

    robot.Disconnect();
  }
}
```

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

robot = UR()
param = ConnectParameters("192.168.0.1")
param.primary_interface.enable = True
robot.connect(param)

##
masterboard = robot.primary_interface.masterboard_data

# Unknown if the robot sends a value that the SDK does not know
mode = masterboard.safety_mode_value

# Protective, safeguard or enabling device stop
stopped = masterboard.is_protective_stopped

# Normal or Reduced
can_move = masterboard.safety_mode_allows_execution

print(f"{mode}, stopped: {stopped}, can move: {can_move}")
##

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
}
```

### Cartesian information

**C# : CartesianInfo**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.CartesianInfoPackageEventArgs**
```csharp
public class CartesianInfoPackageEventArgs : PackageEventArgs {
    public CartesianInfoPackageEventArgs()

    // Returns the current cartesian position as a Pose object
    public Pose AsPose()

    // Returns the TCP offset as a Pose object
    public Pose AsTCPOffsetPose()

    // RX axis coordinate in rad of the TCP in the current frame
    [PackageDescription("RX axis coordinate in rad of the TCP in the current frame", PackageUnit.Radian)]
    public double Rx { get; set; }

    // RY axis coordinate in rad of the TCP in the current frame
    [PackageDescription("RY axis coordinate in rad of the TCP in the current frame", PackageUnit.Radian)]
    public double Ry { get; set; }

    // RZ axis coordinate in rad of the TCP in the current frame
    [PackageDescription("RZ axis coordinate in rad of the TCP in the current frame", PackageUnit.Radian)]
    public double Rz { get; set; }

    // RX position of the TCP in the flange frame in rad
    [PackageDescription("RX position of the TCP in the flange frame in rad", PackageUnit.Radian)]
    public double TCPOffsetRX { get; set; }

    // RY position of the TCP in the flange frame in rad
    [PackageDescription("RY position of the TCP in the flange frame in rad", PackageUnit.Radian)]
    public double TCPOffsetRY { get; set; }

    // RZ position of the TCP in the flange frame in rad
    [PackageDescription("RZ position of the TCP in the flange frame in rad", PackageUnit.Radian)]
    public double TCPOffsetRZ { get; set; }

    // X position of the TCP in the flange frame in meter
    [PackageDescription("X position of the TCP in the flange frame in meter", PackageUnit.Meter)]
    public double TCPOffsetX { get; set; }

    // Y position of the TCP in the flange frame in meter
    [PackageDescription("Y position of the TCP in the flange frame in meter", PackageUnit.Meter)]
    public double TCPOffsetY { get; set; }

    // Z position of the TCP in the flange frame in meter
    [PackageDescription("Z position of the TCP in the flange frame in meter", PackageUnit.Meter)]
    public double TCPOffsetZ { get; set; }

    // Returns a string representation of the cartesian position data.
    public override string ToString()

    // X axis coordinate in meter of the TCP in the current frame
    [PackageDescription("X axis coordinate in meter of the TCP in the current frame", PackageUnit.Meter)]
    public double X { get; set; }

    // Y axis coordinate in meter of the TCP in the current frame
    [PackageDescription("Y axis coordinate in meter of the TCP in the current frame", PackageUnit.Meter)]
    public double Y { get; set; }

    // Z axis coordinate in meter of the TCP in the current frame
    [PackageDescription("Z axis coordinate in meter of the TCP in the current frame", PackageUnit.Meter)]
    public double Z { get; set; }
}
```

![Flange frame](/universal-robots/flange-frame-3d.png)

![Flange frame, projection](/universal-robots/flange-frame-projection.png)

### Kinematics information

**C# : KinematicsInfo**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.KinematicsInfoPackageEventArgs**
```csharp
public class KinematicsInfoPackageEventArgs : PackageEventArgs, IUrDhParameters {
    public KinematicsInfoPackageEventArgs()

    // DH parameter a2 (Shoulder.DHa)
    public double A2 { get; }

    // DH parameter a3 (Elbow.DHa)
    public double A3 { get; }

    // Base kinematics info
    [PackageDescription("Base kinematics info")]
    public JointKinematicsInfo Base { get; set; }

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

    // DH parameter d1 (Base.DHd)
    public double D1 { get; }

    // DH parameter d4 (Wrist1.DHd)
    public double D4 { get; }

    // DH parameter d5 (Wrist2.DHd)
    public double D5 { get; }

    // DH parameter d6 (Wrist3.DHd)
    public double D6 { get; }

    // Elbow kinematics info
    [PackageDescription("Elbow kinematics info")]
    public JointKinematicsInfo Elbow { get; set; }

    // Shoulder kinematics info
    [PackageDescription("Shoulder kinematics info")]
    public JointKinematicsInfo Shoulder { get; set; }

    // Returns a string representation of the kinematics info data.
    public override string ToString()

    // Wrist1 kinematics info
    [PackageDescription("Wrist1 kinematics info")]
    public JointKinematicsInfo Wrist1 { get; set; }

    // Wrist2 kinematics info
    [PackageDescription("Wrist2 kinematics info")]
    public JointKinematicsInfo Wrist2 { get; set; }

    // Wrist3 (Tool) kinematics info
    [PackageDescription("Wrist3 (Tool) kinematics info")]
    public JointKinematicsInfo Wrist3 { get; set; }
}
```

**Members of PrimaryInterface.JointKinematicsInfo**
```csharp
public class JointKinematicsInfo {
    public JointKinematicsInfo()

    // Joint checksum
    [PackageDescription("Joint checksum")]
    public int Checksum { get; set; }

    // DH convention a parameter
    [PackageDescription("DH convention a parameter", PackageUnit.Meter)]
    public double DHa { get; set; }

    // DH convention d parameter
    [PackageDescription("DH convention d parameter", PackageUnit.Meter)]
    public double DHd { get; set; }

    // DH convention theta parameter
    [PackageDescription("DH convention theta parameter", PackageUnit.Radian)]
    public double DHtheta { get; set; }

    // DH convention alpha parameter
    [PackageDescription("DH convention alpha parameter", PackageUnit.Radian)]
    public double Dhalpha { get; set; }

    public override bool Equals(object obj)

    public override int GetHashCode()

    public override string ToString()
}
```

These are the Denavit-Hartenberg parameters of the robot, with its calibration. See [Kinematics](/universal-robots/documentation/kinematics) and the [DH parameters](https://www.universal-robots.com/articles/ur/application-installation/dh-parameters-for-calculations-of-kinematics-and-dynamics/) of each model.

### Configuration data

**C# : ConfigurationData**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.ConfigurationDataPackageEventArgs**
```csharp
public class ConfigurationDataPackageEventArgs : PackageEventArgs, IUrDhParameters {
    public ConfigurationDataPackageEventArgs()

    // DH parameter a2 (Shoulder.DHa)
    public double A2 { get; }

    // DH parameter a3 (Elbow.DHa)
    public double A3 { get; }

    // Default joint acceleration speed in rad/s²
    [PackageDescription("Default joint acceleration speed in rad/s²", PackageUnit.RadianPerSecondSquared)]
    public double AJointDefault { get; set; }

    // Default TCP acceleration speed in m/s²
    [PackageDescription("Default TCP acceleration speed in m/s²", PackageUnit.MetersPerSecondSquared)]
    public double AToolDefault { get; set; }

    // Base joint configuration
    [PackageDescription("Base joint configuration")]
    public JointConfiguration Base { get; set; }

    // Controller box type
    [PackageDescription("Controller box type")]
    public ControllerBoxTypes ControllerBoxType { get; set; }

    // DH parameter d1 (Base.DHd)
    public double D1 { get; }

    // DH parameter d4 (Wrist1.DHd)
    public double D4 { get; }

    // DH parameter d5 (Wrist2.DHd)
    public double D5 { get; }

    // DH parameter d6 (Wrist3.DHd)
    public double D6 { get; }

    // Elbow joint configuration
    [PackageDescription("Elbow joint configuration")]
    public JointConfiguration Elbow { get; set; }

    // Equipment radius in meter
    [PackageDescription("Equipment radius in meter", PackageUnit.Meter)]
    public double EqRadius { get; set; }

    // Masterboard version
    [PackageDescription("Masterboard version")]
    public int MasterboardVersion { get; set; }

    // Robot series (e-Series, CB-Series, etc.)
    [PackageDescription("Robot series")]
    public RobotSubTypes RobotSubType { get; set; }

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

    // Shoulder joint configuration
    [PackageDescription("Shoulder joint configuration")]
    public JointConfiguration Shoulder { get; set; }

    // Returns a string representation of the configuration data.
    public override string ToString()

    // Default joint angular speed in rad/s
    [PackageDescription("Default joint angular speed in rad/s", PackageUnit.RadianPerSecond)]
    public double VJointDefault { get; set; }

    // Default TCP speed speed in m/s
    [PackageDescription("Default TCP speed speed in m/s", PackageUnit.MeterPerSecond)]
    public double VToolDefault { get; set; }

    // Wrist1 joint configuration
    [PackageDescription("Wrist1 joint configuration")]
    public JointConfiguration Wrist1 { get; set; }

    // Wrist2 joint configuration
    [PackageDescription("Wrist2 joint configuration")]
    public JointConfiguration Wrist2 { get; set; }

    // Wrist3 (Tool) joint configuration
    [PackageDescription("Wrist3 (Tool) joint configuration")]
    public JointConfiguration Wrist3 { get; set; }
}
```

**Members of Common.ControllerBoxTypes**
```csharp
public enum ControllerBoxTypes {
    // UR10 controller box
    UR10 = 5

    // UR16 controller box
    UR16 = 16

    // UR20 controller box
    UR20 = 10

    // UR3 controller box
    UR3 = 6

    // UR30 controller box
    UR30 = 11

    // UR5 controller box
    UR5 = 4
}
```

**Members of PrimaryInterface.JointConfiguration**
```csharp
public class JointConfiguration {
    public JointConfiguration()

    // a parameter of Denavit–Hartenberg (DH) convention
    [PackageDescription("a parameter of Denavit–Hartenberg (DH) convention", PackageUnit.Meter)]
    public double DHa { get; set; }

    // Alpha parameter of Denavit–Hartenberg (DH) convention
    [PackageDescription("Alpha parameter of Denavit–Hartenberg (DH) convention", PackageUnit.Radian)]
    public double DHalpha { get; set; }

    // d parameter of Denavit–Hartenberg (DH) convention
    [PackageDescription("d parameter of Denavit–Hartenberg (DH) convention", PackageUnit.Meter)]
    public double DHd { get; set; }

    // Theta parameter of Denavit–Hartenberg (DH) convention
    [PackageDescription("Theta parameter of Denavit–Hartenberg (DH) convention", PackageUnit.Radian)]
    public double DHtheta { get; set; }

    public override bool Equals(object obj)

    public override int GetHashCode()

    // Maximum rotation speed in rad/s²
    [PackageDescription("Maximum rotation speed in rad/s²", PackageUnit.RadianPerSecondSquared)]
    public double JointMaxAcceleration { get; set; }

    // Maximum angular position in rad
    [PackageDescription("Maximum angular position in rad", PackageUnit.Radian)]
    public double JointMaxLimit { get; set; }

    // Maximum rotation speed in rad/s
    [PackageDescription("Maximum rotation speed in rad/s", PackageUnit.RadianPerSecond)]
    public double JointMaxSpeed { get; set; }

    // Minimum angular position in rad
    [PackageDescription("Minimum angular position in rad", PackageUnit.Radian)]
    public double JointMinLimit { get; set; }

    public override string ToString()
}
```

**Members of Common.RobotSubTypes**
```csharp
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 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
}
```

### Force mode data

**C# : ForceModeData**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.ForceModeDataPackageEventArgs**
```csharp
public class ForceModeDataPackageEventArgs : PackageEventArgs {
    public ForceModeDataPackageEventArgs()

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

    // Returns a string representation of the force mode data.
    public override string ToString()

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

**C# : AdditionalInfo**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.AdditionalInfoPackageEventArgs**
```csharp
public class AdditionalInfoPackageEventArgs : PackageEventArgs {
    public AdditionalInfoPackageEventArgs()

    // The free drive button is enabled
    [PackageDescription("The free drive button is enabled")]
    public bool FreedriveButtonEnabled { get; set; }

    // The free drive button is pressed
    [PackageDescription("The free drive button is pressed")]
    public bool FreedriveButtonPressed { get; set; }

    // Free drive is enable via IO
    [PackageDescription("Free drive is enable via IO")]
    public bool IOEnabledFreedrive { get; set; }

    // Returns a string representation of the additional info data.
    public override string ToString()
}
```

### Calibration data

**C# : CalibrationData**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.CalibrationDataPackageEventArgs**
```csharp
public class CalibrationDataPackageEventArgs : PackageEventArgs {
    public CalibrationDataPackageEventArgs()

    // Frx calibration data
    [PackageDescription("Frx calibration data")]
    public double Frx { get; set; }

    // Fry calibration data
    [PackageDescription("Fry calibration data")]
    public double Fry { get; set; }

    // Frz calibration data
    [PackageDescription("Frz calibration data")]
    public double Frz { get; set; }

    // Fx calibration data
    [PackageDescription("Fx calibration data")]
    public double Fx { get; set; }

    // Fy calibration data
    [PackageDescription("Fy calibration data")]
    public double Fy { get; set; }

    // Fz calibration data
    [PackageDescription("Fz calibration data")]
    public double Fz { get; set; }

    // Returns a string representation of the calibration data.
    public override string ToString()
}
```

### Safety data

**C# : SafetyData**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.SafetyDataPackageEventArgs**
```csharp
public class SafetyDataPackageEventArgs : PackageEventArgs {
    public SafetyDataPackageEventArgs()

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

    // Returns a string representation of the safety data.
    public override string ToString()
}
```

### Tool communication information

**C# : ToolCommunicationInfo**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.ToolCommunicationInfoPackageEventArgs**
```csharp
public class ToolCommunicationInfoPackageEventArgs : PackageEventArgs {
    public ToolCommunicationInfoPackageEventArgs()

    // Baud rate for tool serial communication
    [PackageDescription("Baud rate")]
    public int BaudRate { get; set; }

    // Parity
    [PackageDescription("Parity")]
    public int Parity { get; set; }

    // RX Idle Chars
    [PackageDescription("RX Idle Chars")]
    public float RxIdleChars { get; set; }

    // Stop bits
    [PackageDescription("Stop bits")]
    public int StopBits { get; set; }

    // Returns a string representation of the tool communication info.
    public override string ToString()

    // Is the tool communication interface enabled
    [PackageDescription("Is the tool communication interface enabled")]
    public bool ToolCommunicationIsEnabled { get; set; }

    // TX Idle Chars
    [PackageDescription("TX Idle Chars")]
    public float TxIdleChars { get; set; }
}
```

### Tool mode

**C# : ToolModeInfo**
```csharp
private UR ur;

private void Start() {
  ur = new UR();
  ur.Connect("192.168.0.1");

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

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

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

**Members of PrimaryInterface.ToolModeInfoPackageEventArgs**
```csharp
public class ToolModeInfoPackageEventArgs : PackageEventArgs {
    public ToolModeInfoPackageEventArgs()

    // Digital output 0 configuration
    [PackageDescription("Digital output 0 configuration")]
    public DigitalOutputConfigurations DigitalOutputMode0 { get; set; }

    // Digital output 1 configuration
    [PackageDescription("Digital output 1 configuration")]
    public DigitalOutputConfigurations DigitalOutputMode1 { get; set; }

    // Digital output mode
    [PackageDescription("Digital output mode")]
    public OutputModes OutputMode { get; set; }

    // Returns a string representation of the tool mode info.
    public override string ToString()
}
```

**Members of Common.DigitalOutputConfigurations**
```csharp
public enum DigitalOutputConfigurations {
    // Push / Pull
    PushPull = 3

    // Sinking (NOPN)
    SinkingNPN = 1

    // Sourcing (PNP)
    SourcingPNP = 2
}
```

**Members of Common.OutputModes**
```csharp
public enum OutputModes {
    // Dual Pin Power
    DualPinPower = 1

    // Standard output
    StandardOutput = 0
}
```

## What to read next

- [Send URScript](/universal-robots/documentation/remote-send-script): run URScript from the PC.
- [Read and write variables](/universal-robots/documentation/variables): the program and installation variables.
- [RTDE](/universal-robots/documentation/rtde): the same data, up to 500 Hz.