Back to all lessons

Lesson 05

The OR Logic Operation

OR combines commands or conditions when one active signal is enough.

logicbeginnerschooluniversityengineerOR

1. The OR Operation

OR is the logical disjunction operation. Use it when an output should turn on if at least one of several conditions is satisfied.

Output = Input_1 OR Input_2

The output is active when Input_1 is active, Input_2 is active, or both are active.

2. Where OR Is Used

OR combines different causes of the same result:

  • an alarm activates when any fault signal is active;
  • a start request comes from a physical button or HMI;
  • an elevator call comes from a landing button or cabin button;
  • a warning indicates overheating or low pressure;
  • a stop request comes from Stop or an external inhibit.

3. The Basic OR Rule

OR produces TRUE if at least one input is TRUE. Only when every input is FALSE is the result FALSE.

Input_1Input_2Output_1
FALSEFALSEFALSE
TRUEFALSETRUE
FALSETRUETRUE
TRUETRUETRUE

4. FBD Diagram

OR has several inputs and one output:

[Input_1] ─────┐
               ├── [OR] ──> [Output_1]
[Input_2] ─────┘

Any active input makes the output TRUE.

5. Example: Starting from Two Locations

A mechanism can be started from a button or operator panel:

SignalTypePurpose
Start_ButtonInputPhysical Start button
HMI_StartInputStart command from the operator panel
Start_RequestInternal signalCombined start request
Start_Request = Start_Button OR HMI_Start
Start_ButtonHMI_StartStart_Request
FALSEFALSEFALSE
TRUEFALSETRUE
FALSETRUETRUE
TRUETRUETRUE

Either command source activates Start_Request.

6. Example: A Common Alarm

OR can combine several individual faults:

SignalTRUE means
Motor_OverloadMotor overload
Low_PressureLow air pressure
Door_Open_AlarmDoor open during hazardous operation
Common_AlarmAt least one fault is active
Common_Alarm = Motor_Overload OR Low_Pressure OR Door_Open_Alarm

Any listed fault activates Common_Alarm. In the lesson's JSON diagram, this output is named Alarm.

7. OR and Equipment Stops

OR also combines reasons to stop:

Stop_Request = Stop_Button OR Emergency_Active OR External_Stop

The result can reset a latch, stop a conveyor, or inhibit starting. Real safety circuits require separate engineering rules; a simple software OR is only the logical principle demonstrated here.

8. Simulator Practice

Open the lesson's common-alarm example and start the simulation.

  • 1. Leave Motor_Overload, Low_Pressure, and Door_Open_Alarm FALSE; check Alarm = FALSE.
  • 2. Set each input TRUE in turn and check that Alarm becomes TRUE.
  • 3. Set several inputs TRUE and confirm that Alarm remains TRUE.
  • 4. Return all inputs to FALSE; check that Alarm turns off.

For a two-input exercise, open the OR example in the examples catalog and test High_Level and Manual_Test against Alarm_Request.

9. Key Points

  • OR produces TRUE when at least one input is TRUE.
  • Use OR for requests, common alarms, and multiple stop causes.
  • Keep commands and permissives distinct when combining OR with AND.

Practice block

Open the related example in the editor, run the simulation, and repeat the exercise from the article. The JSON is also available as a direct download.