LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP connection between PC and UR5 Universal Robot

I have a UR5 robot connected to a PC via ethernet. I am currently trying to have the robot and PC send strings back and forth via the TCP/IP functions in LabVIEW. Using the code below I have been able to recieve strings from my robot sent to my pc, but have been unable to send strings from my to my robot. I am able to send and recieve strings in both directions via the program Sockettest. Does anyone have a lot of TCP/IP knowledge and know how to send strings from my PC to my robot? Alternatively does anyone know how I could connect Sockettest to my LabVIEW code?

 

TCP_IP_UR5.PNG

Message 1 of 21
(30,750 Views)

Actually you can use LabVIEW example in Help>>Find Examples>> Search Tab>>Simple TCP

You would see something like this.

Simple TCP.png

0 Kudos
Message 2 of 21
(30,698 Views)

Hi robotathon,

I have a UR5 robot like yours, but I'm not able to recieve string from the robot. I'm sending script commands to the robbot using the port 30002 but I can not recieve info from the robot.

Do you find the way to communicate with the UR5? (back and forward), coud you share information? 

0 Kudos
Message 3 of 21
(30,583 Views)

Loop 2 Times

   Socket_Test:=socket_open("local IP adress of computer here",port number here)

   Wait 0.1

   Recieve_Data=socket_read_ascii_float(6)

    wait 0.1

tcp_base:=get_forward_kin()

socket_send_string(tcp_base)

socket_send_byte(13)

socket_send_byte(10)

socket_close()

 

###NOTES

1. The recieve part of the script must be looped or the connection will be timed out and no data will be sent

2. My code is spefically for send and recieving robot position, if you are just sending scripts you won't need "get_forward_kin()", and "socket_read_ascii_float(6)" will probably be replaced by "socket_read_string()"

3. socket_send_byte() functions as a carriage return

4. No data sent from the robot will appear in LabVIEW until the "socket_close()" command is run so you may need to open and close the connection multiple times in the same program

 

Pictures of my applicable LabVIEW are attatched, let me know if you have any more questions

 

TCP_read.PNGTCP-write.PNG

0 Kudos
Message 4 of 21
(30,569 Views)

Hi robotathon

 

I studied your work and figured out your problem. Please see attached pictures.

QQ截圖20160310172655.pngQQ截圖20160310172708.pngQQ截圖20160310172708.png

0 Kudos
Message 5 of 21
(29,906 Views)

Hello, can you give me the vi? I'am  trying to connect my pc to UR5. Thank you!

0 Kudos
Message 6 of 21
(28,762 Views)

Hi seraph1989,

 

Can you please share the .vi for the above program, we are trying to control an universal robot via labview.

 

thanks in advance

Message 7 of 21
(28,721 Views)

I have a problem with the communication PC-UR5, can you help me pelase, my email is: amu_alex@hotmail.com

thank you so much.

I hope to help me.  

Do you have any tutorial?? 

0 Kudos
Message 8 of 21
(27,330 Views)

Hi, a faster and easy way to control the UR5 with TCP/IP connection:

1.- sending function scripts, just like the you can find in the manual "The URScript Programming Language" (https://www.universal-robots.com/download/).

This is a faster and easy communication, but one way communication. So the “one way” commands cannot read something back, so reading of inputs or getting the result of a “get_inverse_kin” command will not return the result with this method

Sending functions scripts.JPG

Message 9 of 21
(27,234 Views)

Hi,  I am trying to make a small Ui for dashboard server on port 2999.

When I send a command String, robot behaves as expected but,  I don't get any reply.

I have a Parellel loop running which is reading incoming data, but I am not getting any data from the robot, 

Things tried 

1.Data comes Inc socket test application 

2. Looped twice for read data 

3. Closed connection after read vi

Any suggestion to read robotmode

0 Kudos
Message 10 of 21
(27,231 Views)