General Programming Questions


I am trying to pick up on typical coding principles of URscript. I have a cobot with a few UR caps installed which is what i think is making this a little difficult to understand. Above is a photo of what I programmed into the teach pendant and pulled off of it using a USB. The program works and runs. What i dont understand is how much of the proceeding 3000 lines of code is needed and what is simply used to load in the UR caps. I apologize for my lack of knowledge on the subject and am trying to broaden my understanding of URscript.

1 Like

This depends somewhat on if you’re using any of the installed URCAPs in your program. at the very very top of top of your screenshot you can see “# end: URCap Installation Node.” There’s likely some stuff above that, though not necessarily. It would depend on what the URCAPs are writing, which you don’t know unless you look at what’s there or have access to the source code.

Otherwise everything I see in the screenshot is just the robot program code, all of which would be required.

I guess my question really is, would it run safely without everything else above it?

On the very beginning of your URScript are the definition of your gravaty for the tool etc.
a little example:

set_tcp(p[0.0,0.0,0.1,0.0,0.0,0.0])
set_gravity([0.0, 0.0, 9.82])
set_standard_analog_input_domain(0, 1)
set_standard_analog_input_domain(1, 1)

after this are the globel variables
example:
global actuel_force=p[0, 0, 0, 0, 0, 0]
this is all needed for the robot.

now all between

begin: URCap Installation Node

and

end: URCap Installation Node

are not needed for the funktion of the Robot. (if you dont use any urcap)
But you can test it if you deinstall all urcap in the simulation programm and run your programm again.