UR10e TCP/IP Communication

Hello UR-Forum,

first of all I´m new to this topic and I´m very inexperienced when it comes to programming. As a student I´ve the chance to use a UR10e and I want to use this chance to get better in this topic, including programming.

I want to start with a TCP/IP connection between the Cobot and the PC. I read different topics in here already and also found some helpful websites related to it.

This is my first test now:

import socket
import time

HOST = “192.168.1.149”
PORT = 30002

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

s.send ((“set_digital_output(1,True)” + “\n”).encode(“utf8”))

data = s.recv(1024)

s.close()

print (“Received”, repr(data))

Problem: the output on the cobot doesn´t change true or high. I do receive an answer and I checked the connection already, thatsworks so far.

Sorry for that stupid question. I also know there is RTDE for better communication but for the beginning I want to keep it simple. The RTDE is a bit too complicated for me at the moment. Thank you for some help.

I’m no expert at socket communication, so if you think that’s all setup right, then it may just be that you have the wrong command.
https://s3-eu-west-1.amazonaws.com/ur-support-site/163530/scriptmanual_5.12.pdf The script manual can be found at that link there, but I think you’re looking for the following:
image

1 Like

I’m no expert on socket communication, either. But have you put the robot in Remote mode? :slight_smile:
It can be enabled in the settings menu in the upper right corner, and then switched to by pressing the Mode symbol next to the menu.

1 Like

Thank you, that was one mistake. I was completely wrong, because set_digital_“output” is wrong anyways, should be just “out”.

That was my second problem. I totally forgot this. Thank you very much. It works now :slight_smile: