1. What the Program Does
This example checks two position sensors for agreement. When Position_A and Position_B differ, XOR activates the diagnostic output Sensor_Mismatch.
The diagram illustrates checking a pair of sensors that should normally report the same value.
Position_A XOR Position_B → Sensor_Mismatch2. Example Signals
| Signal | Type | Purpose |
|---|---|---|
| Position_A | Input | First position sensor |
| Position_B | Input | Second position sensor |
| XOR | Block | Detects differing Boolean values |
| Sensor_Mismatch | Output | Mismatch diagnostic |
3. Main Logic
XOR produces TRUE when its inputs differ:
Sensor_Mismatch = Position_A XOR Position_BBoth FALSE or both TRUE produce no mismatch. One TRUE and one FALSE produce a mismatch.
4. Truth Table
| Position_A | Position_B | Sensor_Mismatch |
|---|---|---|
| FALSE | FALSE | FALSE |
| TRUE | FALSE | TRUE |
| FALSE | TRUE | TRUE |
| TRUE | TRUE | FALSE |
5. Testing in the Simulator
- Leave both inputs FALSE: no mismatch.
- Activate only Position_A: Sensor_Mismatch becomes TRUE.
- Activate both inputs: the mismatch clears.
- Clear Position_A while Position_B stays TRUE: the mismatch returns.
6. What to Watch For
XOR detects a difference but does not explain its cause. Real diagnostics often add messages identifying each sensor's state and the duration of the mismatch.
Add a TON timer if brief transitions should not immediately activate an alarm.
Check in editor
Open the ready-made FBD diagram, toggle inputs, and compare the simulation behavior with the program notes. The JSON is also available as a direct download.