@MarvinW
You can send a whole script to the UR with a socket connection to the client at the port 30001 - 30002 - 30003. Your script file must start with a def() end finish with an end to work correctly. This is an example I have done last year in Python to send a file and execute it:
# Echo client program
import socket
HOST = "10.20.1.102" # The UR IP address
PORT = 30003 # UR secondary client
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
f = open ("setzero.script", "rb") #Robotiq FT sensor
l = f.read(1024)
while (l):
s.send(l)
l = f.read(1024)
s.close()
The script file setzero.script is:
def rq_set_zero():
if(socket_open("127.0.0.1",63350,"acc")):
socket_send_string("SET ZRO","acc")
sleep(0.1)
socket_close("acc")
end
end
You can find information about this connection on the UR website:
https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/remote-control-via-tcpip-16496/
Hi Everyone,
since the last time it was so helpfull (big thanks to matthewd92!) to ask here a question a have another one.
We have the UR10 and in our applikation the robot have to execute different tasks depending on which state the machine is he has to serve. So, there is a Client which tests something the Robot has to put in. There is a Server connecting this Client to the Robot, sending for the Moment simple commands via the socket Connection. Now we maybe have a bunch of scripts of possible movements of the Robot an there is a objectrecognition function also with a camera. The big question is how to Control everything depending on the different states of the Client. An idea was to have a scriptbib and depending on the state we just send the Robot a whole Script but we did not find out how to do this via the sockets, is this even possible?
Again, thanks a lot and have a good day!