The objective of this tutorial is to explain how to use the comparison block with the greater than and greater than or equal to functions 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
The GT (Greater Than) and GE (Greater Than or Equal) operators are used to perform numerical comparisons, returning a logical result (BOOL) that serves as a basis for decisions within Ladder logic.
These operators are widely used to define minimum limits, enabling conditions, and operating ranges.
Concept of Operation
GT Operator (Greater Than)
- Returns TRUE when the first value is greater than the second
- Returns FALSE when the first value is less than or equal to the second
GE Operator (Greater Than or Equal to)
- Returns TRUE when the first value is greater than or equal to the second
- Returns FALSE when the first value is less than the second
The comparison always occurs considering the first parameter in relation to the second.
Use in Ladder Logic
The GT and GE operators return a logical value (TRUE or FALSE), which is normally used:
- In series with other blocks
- To enable coils
- To allow or block parts of the logic
- To define minimum operating conditions
The logic will only be executed when the comparison condition is met.
Inserting GT and GE operators into the logic
To add the GT or GE operators:
- Open the Toolbox.
- Access Mathematical Operators.
- Select GT or GE.
- Click and drag the block to the Ladder logic.
Once inserted, the blocks will be ready to receive the values to be compared.
Figure 2. Insertion of the GT and GE mathematical operators
Conceptual application example
- Triggering an output when a value exceeds a minimum limit
- Releasing a process step when a counter reaches or exceeds a value
- Ensuring that a variable is above a safe level
Logical example:
- Current value > Limit → GT = TRUE
- Current value ≥ Limit → GE = TRUE
Precautions with data types
When using the GT and GE operators, it is important to:
- Ensure compatibility between data types
- Pay attention when comparing REAL, due to decimal places
- Avoid comparisons between values of different scales without prior processing
These precautions prevent unexpected behavior in the logic.
Figure 3. Parameterization of the GT and GE mathematical operators
Series connection as a control method
Like other comparison operators, GT and GE are usually connected in series with the main logic:
- They function as a release condition
- They increase the application's security
- They make the logic clearer and more organized
Practical application
After inserting and configuring the GT or GE operator:
- Download the application.
- Put the CPU in RUN mode.
- Change the compared values.
- Observe:
- The logic being enabled when the condition is true
- The logic being blocked when the condition is not met
The GT and GE operators are essential for implementing minimum value comparisons, being widely used in industrial controls, process validations, and protection logic.
Figure 4. GT and GE mathematical operators conditioning the logic as a filter
Comments
0 comments
Please sign in to leave a comment.