Home› Programming
Discussion
Back to discussions page
MarvinW
Posts: 3 Apprentice
What's the best way to send a whole UR Script to the Robot or to start different scripts on the UR? |
4.9K views
|
Answered | |
/ Most recent by matthewd92
in Programming
|
3 comments |

in Programming
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!
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!
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:
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/
Integration Coach
robotiq.com
[email protected]
I tried it exactly the way you wrote it here but i didn't manage it.
I took the python Code for the Client as it is and then modified the script Code, you can see it below.
In this line you give your port as a fix integere but from where do you know it? It's something that does your OS for you i thougt.
The modified Code, with an additional line so that i can see if the Robot is moving (in URSim) and that i could see in the response the message with the multiple \xff ' s.
But neither i get the message back(a lot of Bytes but not the \xff's)( i print it in the while-loop) nor i can see the Robot moving.
I deleted the if condition to try if that would change the behavior but nothing happens.
Do you have any suggestions? Anything would help
Or I may be misunderstanding what you are asking. Do you have a FT sensor installed on the robot? If not, the port is never opening and therefore you are not getting into the if statement.
Try modifying the script you are sending to the following