Home Programming


Left ArrowBack to discussions page
AndreAndre Posts: 17 Apprentice
Hi everyone,

I am using LabVIEW 2018 to control a UR5 CB-series (Polyscope 3.9) via TCP/IP connection.
I would like to send a file with a series of variables defined in it to give as inputs to some functions defined in Polyscope inside the UR5. I read that it is possibile to use secondary programs and to send them with the port 30002, but I'm not able to do that and don't know why. Here it is the reported the VI I created.

The "data_input.script" file is written according to the URscript manual of Universal Robots as a secondary program:
sec data():
 global a=1
 global b=2

I am able to transfer it as a primary program (so "a" and "b" are displaied in the "Variables" tab) by writing "def" instead of "sec" in the file, but this, of course, stops the execution of the running program on the UR5 and I don't it to happen, this is why I would like to use a secondary program.

Thank you very much for your help.

Best regards



  • bcastetsbcastets Vacuum Beta tester Posts: 695 Expert
    I am not familiar with secondary program but what about saving your variable in the modbus register of the robot ?
    Your program could use modbus variables and you could even monitor or change those them.
  • AndreAndre Posts: 17 Apprentice
    I already used Modbus and TCP/IP communication protocols, but considering the fact that I have to send about 30 variables each time such as waypoints or joints angular positions, I would like to avoid to unpack/convert the data transfered to the robot to build the varable I want, but to directly send the variable itself. If I'm sending a waypoint, for example, I have to use 6 registers and then to assemble them in a variable like
    local wp=p[.......], while it would be much faster an easier for me to send directly "local wp=p[......]. This is why I was asking about secondary programs or other ways to do that.
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,267 Handy
    Have you thought about XMLRPC?  Then the robot could request the value that it wants. This is also available with TCP sockets on the UR making a get call and passing the variable name it will then return the value. 
  • AndreAndre Posts: 17 Apprentice
    @matthewd92 I read something about this option, but I saw only some examples with Python or Java or C on the Universal Robots website, but I was not able to find any example on the Internet about how to use the xmlrpc communication with LabVIEW, so I don't know to to implement it in LabVIEW. Do you have any idea about how to use it to cmmunicate with the robot? Because I don't know how to open the connection and to specifify to execute a certin file/function.

    Thank you very much for your help!
Sign In or Register to comment.
Left ArrowBack to discussions page