1. Home
  2. Knowledge Base
  3. Testing UR Client-Server and script commands via TCP connection

Testing UR Client-Server and script commands via TCP socket connection.

This example shows how to test the Client-Server program showed on the forum with Sockettest program.

The program is loaded into the UR. In this case the Universal-Robots is configured with IP address 192.168.0.9.

See program description at the client server example. Link to UR Client-Server example.

However in this test the timer Wait after sending the trigger string has been increased to 5 seconds because the reply data will be manual entered  – so in order to provide sufficient time for human to type in reply data the timer is set as 5 seconds or higher. If it is a host or PC with an automatic reply routine then this timer can be much lower as in the original example.

universal-robots-testing-client-server-tcp-connection-2

On a PC which is configured with IP address 192.168.0.100 the Sockettest program is started and configured.

Notice the Tab “Server” is selected and the IP address given is the IP address of the PC because it acts as a server in this case and the robot is the client – and the port is selected as 30000 because that´s the port used in the robot program, but it could be another unused port number as long it is the same on both sides.

universal-robots-testing-client-server-tcp-connection-1

The program on the robot is started.

universal-robots-testing-client-server-tcp-connection-3

And the Server detect an incoming client. Notice the string “asking_for_data” which the robot has send to the server.

Data is entered in the Message window – in this case (200,50,90) which is the corresponding X, Y, Rz data expected by the robot program. This kind of data is very similar as in a vision where the camera will reply with the X, Y and Theta Angle coordinates for an object to detect.

universal-robots-testing-client-server-tcp-connection-5

After the data is entered the Send is pressed so that data is send over the TCP connection to the robot.

universal-robots-testing-client-server-tcp-connection-6

In the “Variables” tab on the robot the data received can be observed – notice the variable var_2 which is the receiving variable has the value [3.0, 200.0, 50.0, 90.0] i.e. 4 elements where the first element is 3.0 meaning that 3 sets of data was received – namely 200.0 and 50.0 and 90.0.

And the robot moves accordingly 200 mm i X direction and 50 mm in Y direction and turn the tool head 90 degrees.

And then the program loops back to request for new data.

 

Note:
If the Server PC does not respond to the request for opening the port – then it might be because the server is out of synchronization with open and close of port and restart of the server might be necessary.

If the var_2 shows [0.0, NaN, NaN, NaN] it means no valid data was received (NaN = Not a Number).

universal-robots-testing-client-server-tcp-connection-7

 

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.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum



Was this article helpful?

2 comments

  1. Hi,

    I am currently trying to implement a Python based program utilizing the RTDE module provided by Universal Robots. I am receiving an error from the server on the controller box stating that the input parameters are already in use. I have narrowed it down to a response in String format saying “IN_USE” for any input register I try to initialize. All the output registers that I have initialized till now have worked without a problem. Why does it say that it is in use when I have never initialized those input registers and there is no program running on the robot.

    PS: The link to the RTDE client and its guide: https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/

    1. Hi Alexandro

      Thanks for the question.

      Can it be that it is trying to write to an input ?

      Author:
      By Zacobria Lars Skovsgaard
      Accredited Universal Robots support Centre and Forum.



Leave a Reply

Your email address will not be published. Required fields are marked *