The objective of this tutorial is to demonstrate how to insert comments into the symbols and networks of a MasterTool X project.
Components
Equipment: 1 computer/notebook.
Software: MasterTool X
Tutorial Sections
- ARCHITECTURE
- DEVELOPMENT
1. ARCHITECTURE
A computer/notebook will be required to use MasterTool X.
Figure 1. Computer running MasterTool X
2. DEVELOPMENT
In automation projects, the use of comments is fundamental to facilitate understanding of the logic, system maintenance, and the work of other programmers who may access the code in the future. However, an excess of visual information can make the logic cluttered and difficult to interpret, making it important to enable only the truly essential comments.
To enable the visualization of variable comments in Ladder logic, follow the steps below:
1. Access the Tools menu.
2. Click on Options.
3. Select FBD, LD, and IL Editors.
4. On the General tab, check the "Show symbol comment" option.
5. Click OK.
Figures 2 and 3. Enabling the visibility of logic comments
After this configuration, the comment (Description) associated with the variable will be displayed directly in the logic, facilitating the understanding and maintenance of the program.
Figure 4. Logic with comment visualization enabled
Note on other visualization options
MasterTool IEC XE offers other comment and visualization options, such as:
- Line (network) comment
- Visualization of the physical address to which the variable is related
These options can be useful in specific situations, but are not essential in everyday use. It is recommended that the user enable only what is really necessary, avoiding excess information and keeping the logic cleaner and more readable.
Inserting comments in local variables
In addition to comments via Description, it is possible to add comments directly in the declaration of local variables.
To do this, simply use // after the variable declaration and insert the desired comment.
Example:
VAR
Button_On : BOOL; // System activation button
Motor_ON : BOOL; // Indicates motor is on
END_VARThese comments help document the function of each variable directly in the code, contributing to clearer and more organized programming.
Figure 5. Local variable comments
Comments
0 comments
Please sign in to leave a comment.