The objective of this tutorial is to explain how to use the comparison block with the less than and less 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 LT (Less Than) and LE (Less Than or Equal) operators are used to perform comparisons of numerical values, returning a logical result (BOOL) that can be used for decision-making in Ladder logic.
These operators are very common in applications involving limits, operating ranges, and safety conditions.
Concept of Operation
LT Operator (Less Than)
- Returns TRUE when the first value is less than the second
- Returns FALSE when the first value is greater than or equal to the second
LE Operator (Less Than or Equal to)
- Returns TRUE when the first value is less than or equal to the second
- Returns FALSE when the first value is greater than the second
The comparison always occurs in the order:
- First parameter in relation to the second.
Use in Ladder Logic
The LT and LE operators return a logical value (TRUE or FALSE), which is normally used:
- In series with other blocks
- To enable coils
- To allow or block the execution of parts of the logic
- To create operational limits
The logic will only be executed when the comparison condition is met.
Inserting LT and LE operators into logic
To add the LT or LE operators:
- Open the Toolbox.
- Access Mathematical Operators.
- Select LT or LE.
- Click and drag the block to the Ladder logic.
Once inserted, the blocks will be available to receive the values to be compared.
Figure 2. Insertion of the LT and LE mathematical operators
Conceptual application example
- Activate an output while a value is below a limit
- Release an operation when a counter is less than or equal to a maximum value
- Create safety ranges for analog variables
Logical example:
- Current value < Limit → LT = TRUE
- Current value ≤ Limit → LE = TRUE
Precautions with data types
When using the LT and LE operators, observe:
- Data types must be compatible
- Comparisons between INT, DINT, REAL must be consistent
- In REAL values, small decimal variations can influence the result
- Always check the scale and unit of the variables involved
Figure 3. Parameterization of the LT and LE mathematical operators
Serial connection as logical control
Like other comparison operators, LT and LE are often connected in series with the main logic:
- They function as a conditional lock or release
- They prevent Improper triggers
- They make the program safer and more predictable
Practical application
After inserting and configuring the LT or LE operator:
- Download the application.
- Put the CPU in RUN mode.
- Change the compared values.
- Observe:
- The condition is true when the criterion is met
- The logic is blocked when the criterion is not met
The LT and LE operators are fundamental for implementing limit comparisons, being widely used in process control, variable monitoring, and logic protection systems.
Figure 4. Mathematical operator LT and LE conditioning the logic as a filter
Comments
0 comments
Please sign in to leave a comment.