The objective of this tutorial is to explain how to add and configure Trace in 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
Trace is a feature used to monitor and record the behavior of variables over time, displaying this information in graph form.
This feature is extremely useful for:
- Analyzing the operation of complex logic
- Diagnosing timing problems
- Verifying the behavior of digital and analog signals
- Comparing multiple variables simultaneously
Unlike simply viewing variables online, Trace allows you to track the evolution of values continuously, facilitating system analysis.
How to Add a Trace to the Project
To create a trace in the project, follow the steps below:
- In the project tree, locate the Application object.
- Right-click on it.
- Select Add Object.
- Choose the Trace option (the name may vary depending on the software language).
Figure 2. Adding the Trace
After that, you will be prompted for the name of the trace object.
- The user can keep the default name or define a new name.
- It is possible to create multiple traces within the same project if it is necessary to monitor different groups of variables.
Configuring the Logging Task
After creating the Trace, it will be necessary to define the task responsible for collecting the data.
In the Logging Task Reference field, select:
MainTask
This task defines the frequency with which the variable data will be logged, as the trace occurs synchronized with the cycle of the selected task.
Figure 3. Configuring Trace
Adding variables to the graph
For Trace to work, it is necessary to specify which variables will be monitored.
To do this:
- Click on Add Variable.
- Enter the variables you want to track in the graph.
There are two ways to select variables:
- Direct typing
The user can type the variable name directly.
- For global variables, simply type the name.
- For local variables, it may be necessary to provide the complete path of the variable, including the block or program where it was declared.
Figure 4. Adding a variable directly
- Selection via the project tree
Another more practical way is to use the button with three dots (...) next to the selection field.
By clicking this button:
- The project's variable tree will open
- The user can manually navigate to the desired variable
- Select and add to the trace
This method avoids typing errors and facilitates the location of variables.
Figure 5. Adding a variable via the design tree
Running the Trace
After configuring the trace:
- Log in to the PLC.
- Put the controller in RUN mode.
- Right-click on the Trace object.
- Select the Download Trace option.
This command sends the trace configuration to the controller and starts recording the data.
Figure 6. Downloading the trace
Important note
The Trace is an extremely useful tool for diagnosing and analyzing the behavior of variables, allowing you to accurately visualize the dynamics of the logic over time, something that is not possible to observe just by looking at the instantaneous state of the variables in Ladder logic.
Figure 7. Trace operation
Comments
0 comments
Please sign in to leave a comment.