Home› Programming
Discussion
Back to discussions page
Student
Posts: 21 Apprentice
Send strings |
616 views
|
Answered | |
/ Most recent by matthewd92
in Programming
|
9 comments |

Hi!
I want to generate from the UR10 a txt file with information about the different measures, for example:
Hole 702: OK
Hole 79: NOK (bad precision)
...
Is that possible? If not, which would be the best option? I understand that I need a script (Matlab, C, LabView...) with a TCP server to receive the information from the cobot and then generate the txt. But I have to send the strings one by one?
I mean, I want to do a complete cycle with the cobot (taking different measures) and generate a txt with the results.
Thanks!
I want to generate from the UR10 a txt file with information about the different measures, for example:
Hole 702: OK
Hole 79: NOK (bad precision)
...
Is that possible? If not, which would be the best option? I understand that I need a script (Matlab, C, LabView...) with a TCP server to receive the information from the cobot and then generate the txt. But I have to send the strings one by one?
I mean, I want to do a complete cycle with the cobot (taking different measures) and generate a txt with the results.
Thanks!
Tagged:
Best Answer
-
matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,261 Handy
We used to do this. Yes you need to send the strings separately. What we would do is send them in a background thread by raising a flag, setting a variable true for instance, at the end of the cycle. If the data send took longer than the time before I needed the variables again I would quickly assign them to another variable such as prev_hole_status. The other thing to remember is you cannot concatenate strings on the robot so you may need to send a key and then the value and handle putting it back together on the server. Also, we found having a slight delay between sends of 50-100 ms would keep them in the order that we sent. Otherwise sometimes they'll come in jumbled.
I'm also using labview as server and UR10 as a client so my robot can send data to labview but i can't send data from labview to Robot so i hope that somebody give me a solution for that
You will need a handler on the server that when the request from the robot is made, what to respond back with
can you give me an exemple from labview because i used the command " Socket_read_ascii_float(6)" to recieve data from server to client
Hi Matthew,
I am using the UR10 socket communication to control thee motors by sending string (socket_send_string()) to to PC. This works great but the problem I am having is the every time I send a string I open and close the socket connection. Is there a way where I can avoid open and close connection every time I send string? I want to open the socket connection at the beginning of the program and close the socket at the end of program not every time when I send string.
example of my current code:
before Program
- open=socket_open("IPaddress",port)
main program- socket_send_string("motor1:on")
- close=socket.close()
- open=socket_open("IPaddress",port)
- socket_send_string("motor2:on")
- close=socket.close()
- open=socket_open("IPaddress",port)
- socket_send_string("motor3:on")
- close=socket.close()
Thank you in advance,Tesfit
Such as:
socket_send_string(“message”, “name”)
as long as you are frequently accessing the port it should stay alive without issue. This is how we control motors as well with sockets.