(This post is a Wiki, experienced developers can modify the content)
It is possible to connect to the robot using the Ethernet port in the bottom of the controller cabinet.
There is one port available. Consider using a switch, it you need to use this port, to increase flexibility and enable connecting additional devices.
TCP/IP 100 Mbit: IEEE 802.3u, 100BASE-TX (1)
The robot can be set up to have either a static IP or use DHCP in PolyScope.
Internally, it is possible to connect to the robot on localhost: IP 127.0.0.1
There are a number of servers and interfaces running always in the robot:
-
Primary client interface
Port: 30001
Constantly transmits a data stream about the robot state + additional messages.
Can receive URScript codes and URScript programs.
Running at 10 Hz.
See more at the UR Support Site -
Secondary client interface
Port: 30002
Constantly transmits a data stream about the robot state.
Can receive URScript codes and URScript programs.
Running at 10 Hz.
See more at the UR Support Site -
Real-time client interface
Port: 30003
Constantly transmits a data stream about the robot state.
Can receive URScript codes and URScript programs.
Running at 125 Hz.
See more at the UR Support Site -
Real time data exchange (RTDE)
Port: 30004
Transmitting selected robot state data.
Can receive commands for outputs, external force/torque sensors and more.
Running at 125 Hz.
See more at the UR Support Site -
Dashboard server
Port: 29999
Can receive commands to load, start and stop installed programs, and answer to robot state requests.
See more at the UR Support Site -
FTP server
Port: 22
Warning: The file system is not write-protected. Be sure which files you are working with, as damage may be caused to the UR software.
Host: IP address of robot
User: root
Password: easybot -
Modbus server
Port: 502
Contains robot state data and general purpose registers.
See more at the UR Support Site
NOTE:
It is generally recommended to use RTDE and fieldbus protocols (Modbus Client, Ethernet IP or Profinet) rather than the Primary, Secondary, Realtime and Dashboard server interfeces.
The recommended interfaces are actual API, and provide elements of versioning, backwards compatibility and protocol negotiation. The other interfaces are semi-API, and does not provide things such as backwards compatibility and may change or be deprecated without notice.
Using the client interfaces
The primary, secondary or real-time client interfaces can receive URScript commands for execution.
Example 1
Sending a single URScript command:
set_digital_out(0, True)
This command will set digital output 0 to high.
Example 2
Sending a URScript program:
def myprogram():
movel(p[0.2,0.2,0.0,0,3.14,0],a=1.2,v=0.25)
movel(p[0.4,0.2,0.0,0,3.14,0],a=1.2,v=0.25)
end
This URScript program will be executed upon receiving it by the controller.
Thus the robot will first do a linear move to the position p[0.2,0.2,0.0,0,3.14,0], and then to the position p[0.4,0.2,0.0,0,3.14,0], where after the program has ended and stops.
URScript codes are explained in the URScript Manual, which is included in the URCaps SDK.
Both the script code in example 1 and 2 will halt any already running program in the controller, thus cannot be done simultaneously.
Alternatively a āSecondary Programā can be sent.
The secondary program is not allowed to use any physical time, e.g. movement of the robot, but does not affect exiting program execution. Read more.
Example 3
Sending a secondary program:
sec mysecondaryprogram():
set_digital_out(0, True)
end
This program will turn on digital output 0 without halting the primary running program. It may not use any physical time (no move or wait commands).
Ethernet raw
It is possible to use other ports than mentioned above for Ethernet raw communication.
From URScript ir is possible to open a socket connection using:
socket_open(āIPā, port, āsocket_nameā)
Where the IP address and socket name must be a string, and the port an integer.
It is possible to transmit and receive string, floats and integers using socket connections from URScript language.
These options are further explained in the URScript manual.
It is also possible to open a socket connection between a daemon process, e.g. as listener, and the program, e.g. as the client.
Optional communication interfaces
The robot does also support following industrial fieldbus protocols:
- Ethernet/IP (from software version 3.2)
- PROFINET (from software version 3.3)
Also check out this article: Overview of client interfaces - 21744