UnderAutomation
Eine Frage?

[email protected]

Kontakt
UnderAutomation
⌘Q
Diese Seite ist nur auf Englisch verfügbar.

Primary Interface: data streaming

Receive the state of a UR cobot at 10 Hz with the Primary Interface: robot mode, joints, tool, I/O, Cartesian position, kinematics and configuration.

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.

Connect

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

PortInterfacesDataURScript
30001PrimaryInterface (default)All packagesyes
30002SecondaryInterfaceAll packagesyes
30011PrimaryInterfaceReadOnlyAll packagesno
30012SecondaryInterfaceReadOnlyAll packagesno
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();
}
}
Click to see the full code

The same client works without UR:

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();
}
}
Click to see the full code

The service Primary Client Interface must be enabled on the robot: see Prepare the robot. For the data of the interface, see Remote control via TCP/IP 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.

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;
};
}
}
Click to see the full code

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.

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;
};
}
}
Click to see the full code

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.

Primary Interface (Data streaming and script) page of the Universal Robots SDK demo application

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

Packages

Robot mode

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
RobotModeDataPackageEventArgsinherits PackageEventArgs
C#Python

Information about current robot mode

MemberTypeDescription
RobotModeDataPackageEventArgs()
Constructor
ControlMode
Property
ControlModes
Current robot control mode
EmergencyStopped
Property
bool
The button Emergency Stop is pressed
PhysicalRobotConnected
Property
bool
Robot is connected to its controller
ProgramPaused
Property
bool
The running program is paused
ProgramRunning
Property
bool
A program is running
ProtectiveStopped
Property
bool
A stop occured due to a fault detection
RealRobotEnabled
Property
bool
Real robot mode active. False if robot is in simulation
RobotMode
Property
RobotModes
Current robot running mode
RobotPowerOn
Property
bool
Robot is powered on and boot is completed. If false, you need to press "ON" button to power it on
SpeedScaling
Property
double
Speed scaling
TargetSpeedFraction
Property
double
Overriden speed ratio between 0 (0%) and 1 (100%)
TargetSpeedFractionLimit
Property
double
Maximum target speed fraction
Timestamp
Property
TimeSpan
Timespan since the robot controller has started
ToString()
Method
string
Returns a string representation of the robot mode data.
Enum
ControlModes
C#Python

Robot control modes

NameValueDescription
Force
2
Robot is force controlled. (For example : URScript force_mode() function is called)
Position
0
Robot is position controlled
Teach
1
The robot is hand guided by pushing teached button
Torque
3
Robot is torque controlled
Enum
RobotModes
C#Python

Robot running modes

NameValueDescription
BackDrive
6
The robot is hand guided by pushing teached button
Booting
2
The robot controller is booting
ConfirmSafety
1
Robot has stopped due to a Safety Stop
Disconnected
0
Robot is not connected to its controller
Idle
5
Power is on but breaks are not released
Other
-1
Robot is in an obsolete CB2 mode
PowerOff
3
The robot is powered off
PowerOn
4
The robot is powered on
Running
7
Robot is in normal mode
UpdatingFirmware
8
Firmware is upgrading

Joint data

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
JointDataPackageEventArgsinherits PackageEventArgs
C#Python

Status of each joints

MemberTypeDescription
JointDataPackageEventArgs()
Constructor
Base
Property
JointData
Base joint data
Elbow
Property
JointData
Elbow joint data
Shoulder
Property
JointData
Shoulder joint data
Wrist1
Property
JointData
Wrist1 joint data
Wrist2
Property
JointData
Wrist2 joint data
Wrist3
Property
JointData
Wrist3 (Tool) joint data
ToString()
Method
string
Returns a string representation of the joint data for all six joints.

Joints of a UR robot

Class
JointData
C#Python

Joint data

MemberTypeDescription
JointData()
Constructor
ActualSpeed
Property
double
Joint rotation speed in rad/s
Current
Property
float
Motor current in Amps
JointMode
Property
JointModes
Joint mode
Position
Property
double
Angular joint position in radian
TargetPosition
Property
double
Angular target position in radian
Temperature
Property
float
Joint temperature in °C
Voltage
Property
float
Motor voltage in Volts
Equals(object)
Method
bool
GetHashCode()
Method
int
ToString()
Method
string
Enum
JointModes
C#Python

Joint modes

NameValueDescription
Backdrive
238
Joint is in backdrive mode.
Booting
247
Joint is booting.
Bootloader
249
Joint is in bootloader mode.
Calibration
250
Joint is calibrating.
Fault
252
Joint is in a fault state.
Idle
255
Joint is idle.
MotorInitialisation
246
Joint motor is initializing.
NotResponding
245
Joint is not responding.
PartDCalibration
237
Joint is in part D calibration mode.
PartDCalibrationError
248
Joint part D calibration encountered an error.
PowerOff
239
Joint is powered off.
Running
253
Joint is running normally.
ShuttingDown
236
Joint is shutting down.

Tool data

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
ToolDataPackageEventArgsinherits PackageEventArgs
C#Python

Tool data

MemberTypeDescription
ToolDataPackageEventArgs()
Constructor
AnalogInput2
Property
double
Value of Analog input 2 (analog_in[2])
AnalogInput3
Property
double
Value of Analog input 3 (analog_in[3])
AnalogInputRange2
Property
AnalogRanges
Unit of analog input 2 (analog_in[2])
AnalogInputRange3
Property
AnalogRanges
Unit of analog input 3 (analog_in[3])
ToolCurrent
Property
float
Tool current in Amps
ToolMode
Property
ToolModes
Tool mode
ToolOutputVoltage
Property
sbyte
Tool output voltage
ToolTemperature
Property
float
Tool Temperature in °C
ToolVoltage48V
Property
float
Actual robot voltage power supply
ToString()
Method
string
Returns a string representation of the tool data.
Enum
AnalogRanges
C#Python

Analog units of analog inputs and outputs

NameValueDescription
Current
0
The analog value is in Amps (A)
Voltage
1
The analog value is in Volts (V)
Enum
ToolModes
C#Python

Tool modes

NameValueDescription
Bootloader
249
Bootloader
Idle
255
Idle
Running
253
Running

Masterboard data

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
MasterboardDataPackageEventArgsinherits PackageEventArgs
C#Python

Masterboard data

MemberTypeDescription
MasterboardDataPackageEventArgs()
Constructor
AnalogInput0
Property
double
Value of analog input 0 (analog_in[0])
AnalogInput1
Property
double
Value of analog input 1 (analog_in[1])
AnalogInputRange0
Property
AnalogRanges
Unit of analog input 0 (analog_in[0])
AnalogInputRange1
Property
AnalogRanges
Unit of analog input 1 (analog_in[1])
AnalogOutput0
Property
double
Value of analog output 0 (analog_out[0])
AnalogOutput1
Property
double
Value of analog output 1 (analog_out[1])
AnalogOutputDomain0
Property
AnalogRanges
Unit of analog output 0 (analog_out[0])
AnalogOutputDomain1
Property
AnalogRanges
Unit of analog output 1 (analog_out[1])
DigitalInputs
Property
MasterboardDigitalIO
Register where each bit is a digital input value
DigitalOutputs
Property
MasterboardDigitalIO
Register where each bit is a digital output value
Euromap67Installed
Property
sbyte
The robot is interfaced to injection molding machines Euromap 67
EuromapCurrent
Property
float
Euromap current
EuromapInputBits
Property
int
Register where each bit is a digital Euromap input
EuromapOutputBits
Property
int
Register where each bit is a digital Euromap output
EuromapVoltage
Property
float
Euromap voltage
InReducedMode
Property
byte
Robot is in reduced speed mode
MasterIOCurrent
Property
float
Current of all digital and analog inputs and outputs
MasterboardTemperature
Property
float
Temperature of masterboard in °C
OperationalModeSelectorInput
Property
byte
Position of operational mode selector input switch
RobotCurrent
Property
float
Robot current consumption in Amps
RobotVoltage48V
Property
float
Voltage of internal 48V power supply
Safetymode
Property
SafetyStatus
Masterboard safety mode
ThreePositionEnablingDeviceInput
Property
byte
Position of the 3-position enabling device
ToString()
Method
string
Returns a string representation of the masterboard data.
Class
MasterboardDigitalIO
C#Python

Represents the state of digital I/O pins on the UR controller masterboard, including standard digital, configurable, and tool digital pins.

MemberTypeDescription
BitArray
Property
read only
BitArray
Register value seen as a bool array
Configurable0
Property
read only
bool
State of configurable digital I/O pin 0.
Configurable1
Property
read only
bool
State of configurable digital I/O pin 1.
Configurable2
Property
read only
bool
State of configurable digital I/O pin 2.
Configurable3
Property
read only
bool
State of configurable digital I/O pin 3.
Configurable4
Property
read only
bool
State of configurable digital I/O pin 4.
Configurable5
Property
read only
bool
State of configurable digital I/O pin 5.
Configurable6
Property
read only
bool
State of configurable digital I/O pin 6.
Configurable7
Property
read only
bool
State of configurable digital I/O pin 7.
Digital0
Property
read only
bool
State of standard digital I/O pin 0.
Digital1
Property
read only
bool
State of standard digital I/O pin 1.
Digital2
Property
read only
bool
State of standard digital I/O pin 2.
Digital3
Property
read only
bool
State of standard digital I/O pin 3.
Digital4
Property
read only
bool
State of standard digital I/O pin 4.
Digital5
Property
read only
bool
State of standard digital I/O pin 5.
Digital6
Property
read only
bool
State of standard digital I/O pin 6.
Digital7
Property
read only
bool
State of standard digital I/O pin 7.
ToolDigital0
Property
read only
bool
State of tool digital I/O pin 0.
ToolDigital1
Property
read only
bool
State of tool digital I/O pin 1.
Value
Property
read only
int
Register value
Equals(object)
Method
bool
GetHashCode()
Method
int
ToString()
Method
string
Enum
SafetyStatus
C#Python

Safety modes

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

Cartesian information

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
CartesianInfoPackageEventArgsinherits PackageEventArgs
C#Python

Contains current cartesian position of the robot, including its TCP offset

MemberTypeDescription
CartesianInfoPackageEventArgs()
Constructor
Rx
Property
double
RX axis coordinate in rad of the TCP in the current frame
Ry
Property
double
RY axis coordinate in rad of the TCP in the current frame
Rz
Property
double
RZ axis coordinate in rad of the TCP in the current frame
TCPOffsetRX
Property
double
RX position of the TCP in the flange frame in rad
TCPOffsetRY
Property
double
RY position of the TCP in the flange frame in rad
TCPOffsetRZ
Property
double
RZ position of the TCP in the flange frame in rad
TCPOffsetX
Property
double
X position of the TCP in the flange frame in meter
TCPOffsetY
Property
double
Y position of the TCP in the flange frame in meter
TCPOffsetZ
Property
double
Z position of the TCP in the flange frame in meter
X
Property
double
X axis coordinate in meter of the TCP in the current frame
Y
Property
double
Y axis coordinate in meter of the TCP in the current frame
Z
Property
double
Z axis coordinate in meter of the TCP in the current frame
AsPose()
Method
Pose
Returns the current cartesian position as a Pose object
AsTCPOffsetPose()
Method
Pose
Returns the TCP offset as a Pose object
ToString()
Method
string
Returns a string representation of the cartesian position data.

Flange frame

Flange frame, projection

Kinematics information

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
KinematicsInfoPackageEventArgsinherits PackageEventArgs
C#Python

Kinematics info

MemberTypeDescription
KinematicsInfoPackageEventArgs()
Constructor
A2
Property
read only
double
DH parameter a2 (Shoulder.DHa)
A3
Property
read only
double
DH parameter a3 (Elbow.DHa)
Base
Property
JointKinematicsInfo
Base kinematics info
CalibrationStatus
Property
int
Calibration status (0 : OK)
D1
Property
read only
double
DH parameter d1 (Base.DHd)
D4
Property
read only
double
DH parameter d4 (Wrist1.DHd)
D5
Property
read only
double
DH parameter d5 (Wrist2.DHd)
D6
Property
read only
double
DH parameter d6 (Wrist3.DHd)
Elbow
Property
JointKinematicsInfo
Elbow kinematics info
Shoulder
Property
JointKinematicsInfo
Shoulder kinematics info
Wrist1
Property
JointKinematicsInfo
Wrist1 kinematics info
Wrist2
Property
JointKinematicsInfo
Wrist2 kinematics info
Wrist3
Property
JointKinematicsInfo
Wrist3 (Tool) kinematics info
ToString()
Method
string
Returns a string representation of the kinematics info data.
Class
JointKinematicsInfo
C#Python

Joint kinematics info, Denavit–Hartenberg (DH) parameters

MemberTypeDescription
JointKinematicsInfo()
Constructor
Checksum
Property
int
Joint checksum
DHa
Property
double
DH convention a parameter
DHd
Property
double
DH convention d parameter
DHtheta
Property
double
DH convention theta parameter
Dhalpha
Property
double
DH convention alpha parameter
Equals(object)
Method
bool
GetHashCode()
Method
int
ToString()
Method
string

These are the Denavit-Hartenberg parameters of the robot, with its calibration. See Kinematics and the DH parameters of each model.

Configuration data

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
ConfigurationDataPackageEventArgsinherits PackageEventArgs
C#Python

Joint configuration

MemberTypeDescription
ConfigurationDataPackageEventArgs()
Constructor
A2
Property
read only
double
DH parameter a2 (Shoulder.DHa)
A3
Property
read only
double
DH parameter a3 (Elbow.DHa)
AJointDefault
Property
double
Default joint acceleration speed in rad/s²
AToolDefault
Property
double
Default TCP acceleration speed in m/s²
Base
Property
JointConfiguration
Base joint configuration
ControllerBoxType
Property
ControllerBoxTypes
Controller box type
D1
Property
read only
double
DH parameter d1 (Base.DHd)
D4
Property
read only
double
DH parameter d4 (Wrist1.DHd)
D5
Property
read only
double
DH parameter d5 (Wrist2.DHd)
D6
Property
read only
double
DH parameter d6 (Wrist3.DHd)
Elbow
Property
JointConfiguration
Elbow joint configuration
EqRadius
Property
double
Equipment radius in meter
MasterboardVersion
Property
int
Masterboard version
RobotSubType
Property
RobotSubTypes
Robot series (e-Series, CB-Series, etc.)
RobotType
Property
RobotModels
Model of the robot (UR3, UR5, UR10, UR16, ...)
Shoulder
Property
JointConfiguration
Shoulder joint configuration
VJointDefault
Property
double
Default joint angular speed in rad/s
VToolDefault
Property
double
Default TCP speed speed in m/s
Wrist1
Property
JointConfiguration
Wrist1 joint configuration
Wrist2
Property
JointConfiguration
Wrist2 joint configuration
Wrist3
Property
JointConfiguration
Wrist3 (Tool) joint configuration
ToString()
Method
string
Returns a string representation of the configuration data.
Enum
ControllerBoxTypes
C#Python

Controller box types

NameValueDescription
UR10
5
UR10 controller box
UR16
16
UR16 controller box
UR20
10
UR20 controller box
UR3
6
UR3 controller box
UR30
11
UR30 controller box
UR5
4
UR5 controller box
Class
JointConfiguration
C#Python

Joint configuration

MemberTypeDescription
JointConfiguration()
Constructor
DHa
Property
double
a parameter of Denavit–Hartenberg (DH) convention
DHalpha
Property
double
Alpha parameter of Denavit–Hartenberg (DH) convention
DHd
Property
double
d parameter of Denavit–Hartenberg (DH) convention
DHtheta
Property
double
Theta parameter of Denavit–Hartenberg (DH) convention
JointMaxAcceleration
Property
double
Maximum rotation speed in rad/s²
JointMaxLimit
Property
double
Maximum angular position in rad
JointMaxSpeed
Property
double
Maximum rotation speed in rad/s
JointMinLimit
Property
double
Minimum angular position in rad
Equals(object)
Method
bool
GetHashCode()
Method
int
ToString()
Method
string
Enum
RobotSubTypes
C#Python

Robot sub type (e-Serie or CB-Serie)

NameValueDescription
CB2Serie
1
CB2-series (Firmware 1.x)
CB3Serie
2
CB3-series (Firmware 3.x)
ESerie
3
e-series (Firmware 5.x)
Enum
RobotModels
C#Python

Model of a UR robot

NameValueDescription
UR10
2
UR10 robot model.
UR16
4
UR16 robot model.
UR18
5
UR18 robot model.
UR20
7
UR20 robot model.
UR3
3
UR3 robot model.
UR30
8
UR30 robot model.
UR5
1
UR5 robot model.
UR8L
6
UR8 Long robot model.

Force mode data

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
ForceModeDataPackageEventArgsinherits PackageEventArgs
C#Python

Force mode data

MemberTypeDescription
ForceModeDataPackageEventArgs()
Constructor
RobotDexterity
Property
double
Dexterity of the robot
Rx
Property
double
Rx torque in tool frame in Nm
Ry
Property
double
Ry torque in tool frame in Nm
Rz
Property
double
Rz torque in tool frame in Nm
X
Property
double
X force in tool frame in N
Y
Property
double
Y force in tool frame in N
Z
Property
double
Z force in tool frame in N
ToString()
Method
string
Returns a string representation of the force mode data.

Additional information

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
AdditionalInfoPackageEventArgsinherits PackageEventArgs
C#Python

Additional information

MemberTypeDescription
AdditionalInfoPackageEventArgs()
Constructor
FreedriveButtonEnabled
Property
bool
The free drive button is enabled
FreedriveButtonPressed
Property
bool
The free drive button is pressed
IOEnabledFreedrive
Property
bool
Free drive is enable via IO
ToString()
Method
string
Returns a string representation of the additional info data.

Calibration data

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
CalibrationDataPackageEventArgsinherits PackageEventArgs
C#Python

Calibration data

MemberTypeDescription
CalibrationDataPackageEventArgs()
Constructor
Frx
Property
double
Frx calibration data
Fry
Property
double
Fry calibration data
Frz
Property
double
Frz calibration data
Fx
Property
double
Fx calibration data
Fy
Property
double
Fy calibration data
Fz
Property
double
Fz calibration data
ToString()
Method
string
Returns a string representation of the calibration data.

Safety data

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
SafetyDataPackageEventArgsinherits PackageEventArgs
C#Python

Safety internal data

MemberTypeDescription
SafetyDataPackageEventArgs()
Constructor
Data
Property
byte[]
Irrelevant (Internal use only)
ToString()
Method
string
Returns a string representation of the safety data.

Tool communication information

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
ToolCommunicationInfoPackageEventArgsinherits PackageEventArgs
C#Python

Tool communication info

MemberTypeDescription
ToolCommunicationInfoPackageEventArgs()
Constructor
BaudRate
Property
int
Baud rate for tool serial communication
Parity
Property
int
Parity
RxIdleChars
Property
float
RX Idle Chars
StopBits
Property
int
Stop bits
ToolCommunicationIsEnabled
Property
bool
Is the tool communication interface enabled
TxIdleChars
Property
float
TX Idle Chars
ToString()
Method
string
Returns a string representation of the tool communication info.

Tool mode

C#
private UR ur;
private void Start() {
ur = new UR(); // Create a new UR instance
ur.Connect("192.168.0.1"); // Connect to the robot
// ...
// 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
}
Class
ToolModeInfoPackageEventArgsinherits PackageEventArgs
C#Python

Tool mode info

MemberTypeDescription
ToolModeInfoPackageEventArgs()
Constructor
DigitalOutputMode0
Property
DigitalOutputConfigurations
Digital output 0 configuration
DigitalOutputMode1
Property
DigitalOutputConfigurations
Digital output 1 configuration
OutputMode
Property
OutputModes
Digital output mode
ToString()
Method
string
Returns a string representation of the tool mode info.
Enum
DigitalOutputConfigurations
C#Python

Digital output configuration (NPN, PNP, Push/Pull)

NameValueDescription
PushPull
3
Push / Pull
SinkingNPN
1
Sinking (NOPN)
SourcingPNP
2
Sourcing (PNP)
Enum
OutputModes
C#Python

Digital output modes

NameValueDescription
DualPinPower
1
Dual Pin Power
StandardOutput
0
Standard output

What to read next

  • Send URScript: run URScript from the PC.
  • Read and write variables: the program and installation variables.
  • RTDE: the same data, up to 500 Hz.

Integrieren Sie Roboter von Universal Robots, Fanuc, Yaskawa, ABB oder Staubli ganz einfach in Ihre .NET-, Python-, LabVIEW- oder Matlab-Anwendungen

UnderAutomation
KontaktLegal

© All rights reserved.