Good practice using folders and comments
THIS HOW TO DESCRIBES GOOD PRACTICE IN DEVELOPING PROGRAMS USING FOLDERS AND COMMENTS
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.
-
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. - 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). - Input some text into the text field, to see the comment change in the program tree.
- 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). - 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. - Now we can make our complex program very easily understandable, using comments and folders.
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