Here is the information extracted from the ClientInterfaces_Primary.pdf document formatted into Markdown for a technical document/tutorial:

Primary and Secondary Interfaces

Primary Client Interface (10 Hz)

This section applies to UR software versions shown below:

  • Primary client: port 30001 (Robot state and messages)

  • Secondary client: port 30002 (Only robot state and the Version messages)

  • Primary client read only: port 30011 (Robot state and messages)

  • Secondary client read only: port 30012 (Only robot state and the Version messages)

Robot Software 5.9

Message Formatting

Messages Sent to Primary and Secondary Clients

Messages not documented in this manual are used internally by UR software and are not backwards compatible.

Robot State Message

Field

Description

int messageSize

Length of overall package: total length of package including this field

unsigned char messageType

MESSAGE_TYPE_ROBOT_STATE = 16

Sub packages

Each sub package contains size, type, and package specific data

Robot Mode Data (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_ROBOT_MODE_DATA = 0

uint64_t timestamp

bool isRealRobotConnected

bool isRealRobotEnabled

bool isRobotPowerOn

bool isEmergencyStopped

bool isProtectiveStopped

bool isProgramRunning

bool isProgramPaused

unsigned char robotMode

Robot Modes

unsigned char controlMode

Control Modes

double targetSpeedFraction

double speedScaling

double targetSpeedFractionLimit

unsigned char reserved

Joint Data (Sub Package of Robot State Message)

Field

Description

int packageSize

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_JOINT_DATA = 1

double q_actual

double q_target

double qd_actual

float I_actual

float V_actual

float T_motor

float T_micro

Deprecated - ignore

uint8_t jointMode

Joint Modes

Tool Data (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_TOOL_DATA = 2

unsigned char analogInputRange0

unsigned char analogInputRange1

double analogInput0

double analogInput1

float toolVoltage48V

unsigned char toolOutputVoltage

float toolCurrent

float toolTemperature

uint8_t toolMode

Tool Modes

Masterboard Data (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_MASTERBOARD_DATA = 3

int digitalInputBits

int digitalOutputBits

unsigned char analogInputRange0

unsigned char analogInputRange1

double analogInput0

double analogInput1

char analogOutputDomain0

char analogOutputDomain1

double analogOutput0

double analogOutput1

float masterBoardTemperature

float robotVoltage48V

float robotCurrent

float masterIOCurrent

unsigned char safetyMode

Safety Modes

uint8_t InReducedMode

char euromap67InterfaceInstalled

uint32_t euromapInputBits

If Euromap67 interface is installed

uint32_t euromapOutputBits

If Euromap67 interface is installed

float euromapVoltage24V

If Euromap67 interface is installed

float euromapCurrent

If Euromap67 interface is installed

uint32_t

Used by Universal Robots software only

uint8_t operationalModeSelectorInput

uint8_t threePositionEnablingDeviceInput

unsigned char

Used by Universal Robots software only

Cartesian Info (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_CARTESIAN_INFO = 4

double X

double Y

double Z

double Rx

double Ry

double Rz

double TCPOffsetX

double TCPOffsetY

double TCPOffsetZ

double TCPOffsetRx

double TCPOffsetRy

double TCPOffsetRz

Kinematics Info (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_KINEMATICS_INFO = 5

uint32_t checksum

For each joint

double DHtheta

For each joint

double DHa

For each joint

double Dhd

For each joint

double Dhalpha

For each joint

uint32_t calibration_status

This information is sent when leaving initializing mode and/or if the kinematics configuration is changed.

Configuration Data (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_CONFIGURATION_DATA = 6

double jointMinLimit

For each joint

double jointMaxLimit

For each joint

double jointMaxSpeed

For each joint

double jointMaxAcceleration

For each joint

double vJointDefault

double aJointDefault

double vToolDefault

double aToolDefault

double eqRadius

double DHa

For each joint

double Dhd

For each joint

double DHalpha

For each joint

double DHtheta

For each joint

int32_t masterboardVersion

int32_t controllerBoxType

int32_t robotType

int32_t robotSubType

This information is sent when leaving initializing mode and/or if the kinematics configuration is changed.

Force Mode Data (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_FORCE_MODE_DATA = 7

double Fx

double Fy

double Fz

double Frx

double Fry

double Frz

double robotDexterity

Additional Info (Sub Package of Robot State Message)

Field

Description

int packageSize

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_ADDITIONAL_INFO = 8

unsigned char tpButtonState

bool freedriveButtonEnabled

bool IOEnabledFreedrive

unsigned char reserved

Calibration Data (Sub Package of Robot State Message, Internally Used Only)

Field

Description

int packageSize

Length

of Sub Package: total length of subpackage including this field | | unsigned char packageType | ROBOT_STATE_PACKAGE_TYPE_CALIBRATION_DATA = 9 | | uint32_t calibrationData | 84 * 8 bytes |

Safety Data (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_SAFETY_DATA = 10

uint64_t timestamp

uint8_t robotMessageType

uint8_t source

uint8_t robotMessageCode

Tool Communication Info (Sub Package of Robot State Message)

Field

Description

int packageSize

Length of Sub Package: total length of subpackage including this field

unsigned char packageType

ROBOT_STATE_PACKAGE_TYPE_TOOL_COMM_INFO = 11

uint64_t timestamp

uint8_t toolCommMessageType

uint8_t toolCommMessageCode

Additional Resources

IMMI Euromap67 Input and Output bits