Float from Python to UR3

Hi,

I’m looking for a way to send a float from Python to UR3 and read it to define a Variable.

I have managed to activate the output but only in controller mode I have not succeeded when the robot is running a normal program.

could someone help me!

Hi,

I think there is a way, if you create a float variable in the variable table of the UR and then through dashboard server you send the string “variable=x”.I haven´t tryed it, i did only send movement commands but if the UR is capable of executing those movements , i think this could work too.

I leave here an example, i used it with movep(x,y,x,rx,ry.rx) but i guess it can work with floats aswell, you only have to change your ip, maybe you have to try with the different dashboard port of th UR as i don´t know which one could accept the floats.

image
I leave the code in text if you need it too:

import socket

HOST = ‘192.168.1.15’
PORT = 30003

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send((‘counter=3’+ ‘\n’).encode(“utf8”))