Share this

Remote control of the UR robot by a host computer based on TCP/IP protocol

2026-04-06 04:50:27 · · #1

[Abstract] This paper introduces a method for remote control of a UR robot via a host computer. The UR robot has a TCP/IP port with specific functions, and a sample host computer program is provided.

1. Introduction

In 2010, German academia and industry proposed the concept of "Industry 4.0 ," which is the fourth industrial revolution, or a revolutionary production method, led by intelligent manufacturing. This strategy aims to transform manufacturing towards intelligent manufacturing by fully utilizing information and communication technologies and the combination of cyber-physical systems. Therefore, in recent years, many industrial automation manufacturers have focused on remote control capabilities as a key aspect of their product development. On the other hand, with the continuous rise in domestic labor costs and the uncertainty of factory worker turnover, the robotics industry is a sunrise industry in recent years and is expected to continue to be so in the coming years. Therefore, remote control of industrial robots in factory production is a promising topic in robot integration. We know that among industrial robots, UR Robotics was the first human-robot collaborative robot to work in industrial environments, known for its lightweight, simplicity, and safety. Below, we will explore how to achieve remote control of UR Robotics from a host computer.

2. UR Robots provides an interface based on the TCP/IP protocol.

The TCP/IP protocol, originating in 1969, is an architecture and protocol standard developed for the Internet, aiming to solve communication problems between heterogeneous computer networks. It enables networks to provide users with a universal and consistent communication service when interconnected. It is the protocol standard adopted by the Internet. TCP/IP-based communication features low cost, high reliability, strong practicality, and high performance. Therefore, many industrial automation products now have interfaces based on the TCP/IP protocol, enabling communication between devices and between devices and networks. UR robots, based on the TCP/IP protocol, provide rich interfaces for interaction with external devices, as shown in Table 1.

Port Interface Description

Robot as server

502 Modbus TCP protocol, robot as server

22. SSH/SFTP (Secure File Transfer Protocol)

29999Dashboard Features

The first client port, 30001, automatically returns robot status and supplementary messages.

The second client port (30002) automatically returns robot status and messages.

30003 real-time feedback port automatically returns robot status and messages; 125Hz real-time feedback interface.

Robot as client

Custom defined by UR script functions

502 Modbus TCP protocol, robot as client

Table 1. UR Robot TCP/IP Interface Table

With these interfaces, the host computer can remotely control the robot. Figure 1 shows a simplified system diagram of the host computer remotely monitoring the UR robot.

Figure 1. Remote control system diagram

Next, we will introduce the relevant communication interfaces provided by UR robots, so as to remotely control the robot.

3. Modbus TCP port

MODBUS is an application-layer message transport protocol at Layer 7 of the OSI model, providing client/server communication between devices connected to different types of buses or networks. Since its emergence as the de facto standard for industrial serial links in 1979, MODBUS has enabled communication for thousands of automated devices. Currently, support for the simple and elegant MODBUS architecture continues to increase. Internet organizations can access MODBUS via reserved system port 502 on the TCP/IP stack. MODBUS is a request/response protocol and provides services defined by function codes. MODBUS function codes are elements of MODBUS request/response PDUs.

The UR robot can function as both a Modbus TCP server and a Modbus TCP client; the main difference lies in the message requester. Here, we will only discuss the case of the UR robot acting as a Modbus TCP server, as shown in Figure 2.

Figure 2 Modbus TCP Server

Since the UR robot acts as a Modbus TCP server, it must have a series of Modbus addresses for the host computer to access.

Address type description

Register 0-33 can access all of the robot's I/O.

128-255 Register Configurable Register

256-265 Register Robot Status

270-315 Register information such as joint position, speed, current, temperature, and mode.

400-425 RegisterTCP position, speed, offset, and other information

768-770 Register tool status

Bits 0-159 can access all of the robot's I/O.

260-265 Bit Robot Status

Table 2 Modbus Address Summary

By accessing the Modbus address of the UR robot, we can obtain a lot of information about the robot, which can then be displayed on a host computer. The image below shows an interface created by accessing the Modbus address, mimicking Polyscope (the original software of the UR robot). This interface allows us to monitor and control the robot's I/O.

Figure 3 IO Control

4. Dashboard Port

The host computer can send simple commands directly to the robot via port 29999. These commands are defined by UR itself, and this function is called the Dashboard. The table below shows the list of commands for the Dashboard.

Instruction Description

load .urp > loads the program stored in the controller.

getloadedprogram returns the program currently being executed by the robot.

play launches the currently loaded program.

stop: Stop the robot from executing its current program.

pause to pause the robot's currently executing program.

`isProgramSaved` checks whether the program currently being executed by the robot has been saved, returning "True" or "False".

`programState` indicates the current running state of the program, returning "PLAYING", "STOPPED", or "PAUSED".

shutdown to shut down the robot system

The running status of the robot is displayed, returning either "True" or "False".

robotmode access robot mode

popupPolyscope pops up a dialog box

closepopup closes the dialog box.

`addToLog` adds the message to the logfile.

`setUserRole` and `whereisClass` are used to set user permissions.

polyscopeVersion returns the current version number of Polyscope.

Poweron powers the robot.

poweroff disconnects the power to the robot.

brake release releases the brake.

safetymode returns the current safety mode status of the robot.

Table 3 Dashboard Command List

Obviously, we can remotely switch and load programs using some dashboard commands, and we can also start, pause, and stop programs, so that the host computer can remotely control the programs.

5. Host computer programming port

UR robots offer three programming methods: Polyscope programming, script programming, and C-API programming. Polyscope programming involves editing the program on the teach pendant, which the robot then executes; this is the UI-level programming method. C-API programming is a development-level programming method. We will focus on script programming, using URScript, a language developed by UR based on Python. URScript is the programming language for controlling the robot at the script level. Like other programming languages, it has variable types, syntax structures, methods, etc. Additionally, it has a series of dedicated methods to control robot movement and I/O states.

The UR robot's controller runs on a Mini-ITX PC. Once the PC starts the robot controller (like starting a service), the Polyscope software establishes a connection with the robot controller through the PC's local TCP/IP port. Similarly, when the host computer acts as a client, it establishes a TCP/IP connection with the robot controller through a specific programming port (30001, 30002, or 30003). This allows us to write scripts in the URScript language on the host computer and send them directly to the robot controller, which can then execute the program.

Based on the robot scripting principles described above, I can create the following interface on the host computer to remotely program the UR robot.

Figure 4 Script Programming

6. Real-time feedback port

In addition to being used for remote programming, 30001, 30002, and 30003 have other functions, as shown in the table below.

Port name function

The first client port (30001) allows the client to send script code to the server; the server automatically returns robot status and supplementary messages to the client at a frequency of 5Hz.

The second client port (30002) allows the client to send script code via a secure file transfer protocol; the server automatically returns robot status and messages to the client at a frequency of 5Hz.

The 30003 real-time feedback port allows the client to send script code via a secure file transfer protocol; the server automatically returns robot status and messages to the client at a frequency of 125Hz.

Table 4 Programming Ports

Another common feature of these three ports is that once the client opens the port, it will receive messages from the robot at a certain frequency. It's important to note that port 30003 is a real-time feedback port; the client receives a message from the robot every 8ms. Additionally, testing showed that clients using ports 30001 and 30002 only receive messages from the robot approximately every 200ms.

In fact, the robot information received by the client through these three ports is slightly different. The information received through port 30003 is the most comprehensive, including the information received through port 30002 and most of the information received through port 30001.

Therefore, receiving robot information through the real-time feedback port is the most efficient and comprehensive method for the client. Each data packet received through the real-time feedback port is 1044 bytes, arranged in a standard format. Note that in rare cases, the client may receive fewer than 1044 bytes, but the byte arrangement remains unchanged. The table below shows the 1044-byte sequence.

byte order content

1-4 Number of bytes in the entire data packet

5-12 Controller power-on time, power-off reset to zero

13-444 Joint target position, velocity, acceleration, current, torque, actual position, velocity, current, control current

445-684 TCP position, velocity, force; 0 target position, velocity

685-692 Input Bit Status

693-740 motor temperature

740-748 Program Scan Time

749-756 are reserved

757-820 Robot Mode, Articulated Mode, Safety Mode

821-868 (reserved)

869-892 TCP Acceleration

893-940 are reserved

941-948 speed ratio

Current momentum value of robot 949-956

957-972 are reserved

973-996 control board voltage, robot voltage, robot current

997-1044 Joint Voltage

Table 5 Real-time Feedback Data Packet

With this data, the host computer can display a wealth of information. Below are two screenshots of the host computer interface: the "animated graph" shows the joint position and TCP position; the "initialization graph" shows the joint mode, actual joint current, joint voltage, and other data.

Figure 5 Animated GIF

Figure 6 Initialization diagram

7. Conclusion

In summary, the robot acts as a Modbus TCP server, and the host computer can control all of the robot's I/O through port 502; the host computer can remotely download programs to the robot through ports 30001, 30002, or 30003; the host computer can remotely control the program's running status through port 29999; and the host computer can obtain real-time status information about the robot through port 30003. In other words, by utilizing the TCP/IP-based ports open on the UR robot, one can create their own Polyscope software to achieve remote control from the host computer.

Read next

CATDOLL 139CM Qiu Silicone Doll

Height: 139 Silicone Weight: 25kg Shoulder Width: 33cm Bust/Waist/Hip: 61/56/69cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22