Articles Download Safety & Security Forum myUR Go to Main Site

Universal Robots A/S
Energivej 51
DK-5260 Odense S

T: +45 8993 8989
sales@universal-robots.com

 
  • Articles
  • Download
  • Safety & Security
  • Forum
  • myUR
  • Go to Main Site
  • Support
  • Articles
  • Good practice using folders and comments

Good practice using folders and comments

THIS HOW TO DESCRIBES GOOD PRACTICE IN DEVELOPING PROGRAMS USING FOLDERS AND COMMENTS

Last modified on Jan 29, 2025

Folders and comments in programs does not affect the program execution. 
However they are very good for making the program easily readable and simple to understand. 

Comments are very good for writing notes in the program to make it more understandable. 

Folders gives the possibility to devide the program into sections, given individual names. 
Folders can be collapsed or expanded. If collapsed the contents will be hidden in the program tree, thus making the section more readable. This is very useful if having a complex calculation og move section.
Folders can also be copied, so the same section of code, can be used multiple times within the program. However if the program is changed within one folder, the copied folders will not be changed. 

For using the same program section multiple times and between multiple programs, while only changing the code section once, please refer to the use of Subprograms. 

  1. Go to the "Program"-tab (1) in the Program Robot section.
    Click the "Structure"-tab (2) to find a pallette of the available commands. 
    Find and click the "Comment"-command (3) in the commands pallette. 
    Figure1
  2. A Comment-command is now inserted into the program tree to the left. 
    Mark the "Comment" command in the program tree (1) and click the "Command" tab to see details for this command (2). 
    The comment text can be given, by clicking the text field in the Command-tab (3).
    Figure2
  3. Input some text into the text field, to see the comment change in the program tree. 
    Figure3
  4. Now insert a "Folder" into the program. (See bullet 1).
    Select the "Folder" command in the program tree to the left (1). 
    Give the folder a useful name in the text field (2).
    Figure4
  5. Lets say the folder is used for a complex movement into a CNC-machine consisting of 13 waypoints.
    We do not need to see all the waypoints. For reading the program we just need to understand, that at this place in the program, we are moving the robot into a CNC machine. 
    Select "Hide Folder Program Tree" tick box to collapse the folder. 
    Figure5
  6. Now we can make our complex program very easily understandable, using comments and folders. 
    Figure6

Comments and folders does not affect the program execution and the program itself. However they serve as a very powerful tool to organize the program and make it readable to a colleague, wanting to make changes in the program when the process changes and thus the program needs to be reviewed. 

 

Script comments

When working in the URscript language, comments are made using the "#" character, and will thus look like this: 

# This is a comment in URscript

logo

Product

  • UR3e Robot
  • UR5e Robot
  • UR10e Robot
  • UR16e Robot
  • UR20 Robot
  • UR+ Products

Company

  • About us
  • Contact us
  • Careers We're hiring
  • UR merchandise

Training / Resources

  • Academy
  • Technical Resources
  • Articles
  • FAQ

Insights

  • Blog
  • Case stories
  • Content library
  • News centre
  • Podcast
  • Webinars & Events

Get in touch

  • Ask an Expert
  • Schedule a no-cost assessment
  • Find a distributor
  • Customer support

Connect with us

  • LinkedIn
  • Facebook
  • Twitter
  • YouTube
  • Instagram
  • Universal Robots A/S
  • Energivej 51
  • DK-5260 Odense S
  • T: +45 89 93 89 89
  • sales@universal-robots.com
  • US Corporate Office
  • 27-43 Wormwood St.
  • 02210 Boston, MA.
  • +1-844-GO-COBOT
  • ur.na@universal-robots.com
  • Copyright @ Universal Robots 2025
  • Cookie policy
  • Privacy policy
  • Universal Robots A/S
  • Energivej 51
  • DK-5260 Odense S
  • T: +45 89 93 89 89
  • sales@universal-robots.com
  • US Corporate Office
  • 27-43 Wormwood St.
  • 02210 Boston, MA.
  • +1-844-GO-COBOT
  • ur.na@universal-robots.com

Copyright © Universal Robots 2025

Cookie policy
Privacy policy