Discussion

Left ArrowBack to discussions page
AndreAndre Posts: 12 Apprentice
Good time of the day to everyone,

I am using a UR10 CB-series with Polyscope 3.9 and LabVIEW to control it.
I would like to know if it possible to call a function defined inside the robot program by using TCP/IP. I know that, using the port 30001, I can send a command string such as:
def fnc_move():
movel(p[x,y,z,rx,ry,rz],a,v)
end
and the robot will move with a certain speed and acceleration to the waypoint.
My question is about calling a function defined as a .script file on the UR such as: "fnc movel(wp,a,v)", by sending a command string like "fnc movel(p[0.1,0.2,0.3,0,3.141,0],0.5,0.5)" to call the function stored inside the UR with specific parameters by using TCP/IP. 
Do you know if it is possible to do something like this or similar?

Thank you very much for your help and I wish you a nice day

Best regards

Andrea

Comments

  • matthewd92matthewd92 Posts: 851Founding Pro, Tactile Sensor Beta Testers Handy
    If you are just wanting to send the command and not have a program running on the robot then it’s not possible as the function would not be loaded into memory, it loads the non-native functions on program start. 

    If a program was running and the function didn’t cause motion then I believe you could send it as a secondary program. Anything sent as a primary program stops the execution of the current program to run the new program. 
  • AndreAndre Posts: 12 Apprentice
    Thanks @matthewd92 for your answer. I have a full function defined inside the robot program in Polyscope saved as a script file with some input arguments. When I call the function on the robot program I have to specifiy them, but I'm wondering if I can call the functions with the correct parameters directly with TCP/IP.

    Example:
    .script function on the UR program:
    def fnc_move(wp,a,v):
    movel(wp,a,v)
    end

    function called in the Robot Program (classic approach):
    fnc_move(p[0.1,0.2,0.3,0,3.141,0],0.5,0.5)

    I would like to write on the Robot Program, when calling the function, just:
    fnc_move(wp,a,v,)

    and to call the function with full parameters or to send the input arguments from LabVIEW with TCP/IP like:
    fnc_move(p[0.1,0.2,0.3,0,3.141,0],0.5,0.5)

    or maybe even just to update the input arguments of the fnc_move somewhere, maybe in .script file, before calling the function in the Robot Program.

    Do you know if such a thing is possible and how to do that?

    Thank you very much for your help
  • matthewd92matthewd92 Posts: 851Founding Pro, Tactile Sensor Beta Testers Handy
    The easiest thing would be to make a call from UR to labview and request the parameters that you want to use then just call the function as normal from within the UR program. This would be how we’d typically get coordinates from a camera for instance and then use those coordinates as either a variable waypoint or in a scripted move sequence. 

    UR also provides a tcp/ip method for requesting a variable or you can pass a string and have the server respond with the correct variable. Then there’s no need to use port 30001, the program is making the request and labview is just responding with the correct response. 
  • AndreAndre Posts: 12 Apprentice
    Thamk you very much for your help @matthewd92

    I wish you a nice day

    Best regards

    Andrea
Sign In or Register to comment.
Left ArrowBack to discussions page