The objective of this tutorial is to explain how to use Boolean operators with AND and OR functionality, where both analyze 3 variables at a time, 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 Boolean operators AND and OR are used to perform logical operations directly on BOOL signals, allowing multiple conditions to be combined into a single logic block.
In MasterTool IEC XE, these operators can have more than two inputs, such as the 3-input AND and 3-input OR versions, facilitating the organization and reading of the logic.
Operating Concept
AND Operator (3 inputs)
- The output will be TRUE only if all inputs are TRUE.
- If any of the inputs are FALSE, the output will be FALSE.
Logical representation:
A AND B AND C → Q
OR Operator (3 inputs)
- The output will be TRUE if at least one of the inputs is TRUE.
- The output will be FALSE only if all inputs are FALSE.
Logical representation:
Q = A OR B OR C
Inserting operators into the logic
To add the AND (3 inputs) or OR (3 inputs) operators:
- Open the Toolbox.
- Access Boolean Operators.
- Select AND (3 inputs) or OR (3 inputs).
- Click and drag the block to the Ladder logic.
After insertion, the blocks will be available for parameterization.
Figure 2. Insertion of the 3-input Boolean AND and OR operator
Parameterization of inputs and outputs
Inputs
- The operator inputs (IN1, IN2, IN3) must be of type BOOL
- They can receive:
- Boolean variables
- TRUE or FALSE constants
- Outputs from contacts or logic blocks
Output
- The output (Q) is of type BOOL
- Because it is not a function block, the output must be connected:
- To a BOOL variable
- Or directly to a coil
Unlike function blocks, these operators do not maintain an internal state, functioning only as instantaneous logic processing.
Use in Ladder Logic
The AND and OR operators are used to:
- Group multiple conditions into a single point
- Reduce excessive parallel and series connections
- Improve logic readability
- Centralize complex logical decisions
They can be connected:
- In series with other blocks
- In parallel
- Directly to coils
Figure 3. Parameterization of the 3-input Boolean AND and OR operators
Conceptual application example
AND (3 inputs)
- Trigger an output only when:
- Sensor 1 = TRUE
- Sensor 2 = TRUE
- Permission = TRUE
OR (3 inputs)
- Trigger an alarm when:
- Failure 1 = TRUE
- Failure 2 = TRUE
- Failure 3 = TRUE
Practical application
After assembling the logic:
- Download the application.
- Put the CPU in RUN mode.
- Change the values of the Boolean inputs.
- Note:
- In the AND operator: the output is only active when all inputs are true.
- In the OR operator: the output is active when any input is true.
The Boolean AND and OR operators with multiple inputs are fundamental for organizing and simplifying complex logic, ensuring clarity, efficiency, and easy maintenance in Ladder logic projects.
Figure 4. Boolean AND and OR operators with 3 inputs in operation.
Comments
0 comments
Please sign in to leave a comment.