First thing I notice is you have some really long waits in your socket communications, have you tried taking those waits out? In my experience opening a socket is pretty fast. You have 2.5 seconds of wait time between the send, the receive and using the coordinates. We generally have at most 100 ms delay between sending multiple writes to the server but if I’m sending a request and waiting for a response those lines are written back to back.
That’s where I would start to look at reducing times. You could then look to open the socket just once for the program and use that open socket, we do that as well but it needs to be a connection that is long lived so that the server doesn’t close the connection if data is not received for a period of time. I do not recommend to just keep opening sockets in a thread as you would be opening a lot of unneeded sockets and could cause performance issues on the robot or the server. Unfortunately UR does not provide any methods for determining if the socket is open or closed, so you could write your own where you make a request to the server and so long as it does not time out you know the server connection remains open, on a timeout event you could reopen the socket.
In my experience though its not a huge detriment unless I’m talking to the server non-stop. Then UR has a better tool for that called xmlrpc but it requires you to have an xmlrpc server not just a simple tcp socket. Once you understand how to write the server, and there are libraries to do that depending on what language you are using, they are very easy to use and very performant. We are sending multiple commands within a single sync cycle of the robot.
Hi @matthewd92
Pls find the attachment. am communicating my PC to UR3e.
PC will send co-ordinates to robot. Gripper also communicating in socket with UR3e.
1. But do i need to open and close the socket everytime. because it takes too much of time.
2. Can i add socket open command in thread so that it will be open all the time.
3. check the pictures. i want to run "Glue dispense " program for 5 times. how should i do without using socket open and close? or is there any method for socket speed optimization.
thanks in advance