Hello there,
We just got a UR 10e to our lab and we were testing if we can send commands to it through socket. If I use port 29999 I can connect to the Dashboard Server and receive whatever data I want (i.e. robotmode, safetymode etc…). However, when switching to port 30002 to send commands such as set_digital_out() I don’t see any change happening on the panel.
I am using the following code to achieve this
import socket
import time
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.2.66', 30002))
def sendCommand(cmd):
cmd = 'def program():\n ' + cmd + '\nend\n'
print(cmd)
s.send(cmd)
while (True):
sendCommand('set_digital_out(0, False)')
time.sleep(1)
sendCommand('set_digital_out(0, True)')
time.sleep(1)
The terminal only continuously prints the command I’m sending since I’m asking it too but does not show any errors. Is there something I am doing wrong from my part?