Testing UR Client-Server and script commands via TCP socket connection.
To test the TCP socket connection from a host (PC) to a Universal-Robots the program Sockettest can be used.
In this example the robot is connected to a router with a RJ-45 Ethernet cable – and the computer is connected to the same router via WiFi. Notice that the computer is not connected directly to the robot Ethernet port because that is a unliekly situation in an application.
The computer IP address configuration can be found on a Windows computer by running a DOS box – which can be done by Run and “cmd”.
In the DOS box the IP configuration can be found with “ipconfig”
In this example the computer has the IP address 192.168.0.100 – the Subnet setting is 255.255.255.0 and the default gateway is 192.168.0.1
So In this example the robot IP address is configured to 192.168.0.11 – subnet 255.255.255.0 and gateway and DNS is configured for the router address i.e. 192.168.0.1
The host and robot needs each their own IP address and in the same subnet so they can communicate .
A good start is to see if it is possible to ping the robot from the host (computer).
Here is a good reply from the robot.
Below shows the Sockettest connected to a robot with IP address 192.168.0.11. Notice that the PC where the Sockettest is running is the client and it connects to the robot at address 192.168.0.11 and port 30002.
See also this page for port description on the UR. Link to UR real time server.
Notice the data that is shown in the “Conversation with host” screen. It looks like random data, but it is Matlab data send out from the robot – so this is normal.
When the communication has been verified – Then a simple test can be performed by sending a script command that set an output high.
Below shows the I/O screen before sending a command.
Then the command set_digital_out(1, True) is send to the robot via the TCP socket connection.
Which sets the digital output high on the robot.
To set the output low again the script command set_digital_out_(1, False) is send over the TCP socket connection.
And the out number 1 go low again.
Disclaimer: While the Zacobria Pte. Ltd. believes that information and guidance provided is correct, parties must rely upon their skill and judgement when making use of them. Zacobria Pte. Ltd. assumes no liability for loss or damage caused by error or omission, whether such an error or omission is the result of negligence or any other cause. Where reference is made to legislation it is not to be considered as legal advice. Any and all such liability is disclaimed.
If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.