Back to all lessons

Lesson 03

Boolean Values TRUE and FALSE

What TRUE and FALSE mean in PLC programs and how they relate to real signals.

logicbeginnerschooluniversityINOUTCONST

1. Boolean Values

PLC programs frequently use TRUE and FALSE to represent the two possible states of a Boolean signal.

ValueNumerical notationBasic meaning
TRUE1Active or on
FALSE0Inactive or off

Start_Button = TRUE means that the Start button signal is active. Motor_Run = FALSE means that the motor run command is inactive.

2. Why This Matters for PLCs

Many PLC signals have two states: a button is pressed or released, a sensor detects a part or does not, a door is closed or not, a fault is active or not, a motor is on or off, and a valve is open or closed.

These conditions are conveniently described using TRUE and FALSE. Door_Closed = TRUE means the door is closed; Door_Closed = FALSE means it is not closed.

3. TRUE and FALSE on Real Equipment

A PLC receives electrical signals from buttons, sensors, and other devices. For a typical digital input:

Voltage present → TRUE
Voltage absent  → FALSE

For an initial understanding, remember that TRUE means the signal is active and FALSE means it is inactive. PLC Portal does not simulate physical voltage: you switch inputs between TRUE and FALSE manually.

4. Button Example

Start_Button is FALSE when the button is released and TRUE when it is pressed.

[Start_Button] ───────────────> [Lamp_On]
Start_ButtonLamp_On
FALSEFALSE
TRUETRUE

The lamp turns on when the button signal is active.

5. Sensor Example

Part_Sensor is FALSE when no part is present and TRUE when a part is detected. The program might stop a conveyor or start the next mechanism when Part_Sensor becomes TRUE.

TRUE itself does not specify an action. It describes the signal state; the program decides what to do.

6. Output Values

Boolean values describe outputs as well as inputs:

Motor_RunMeaning
FALSEThe motor should not run
TRUEThe motor should run

In the simulator, this is the logical state of a command. Real equipment usually has a relay, contactor, drive, variable-frequency drive, or control module between the PLC output and the motor.

7. Active and Inactive Signals

An active Boolean signal normally means TRUE; an inactive one means FALSE. The meaning depends on the name:

SignalTRUE means
Start_ButtonStart is pressed
Door_ClosedThe door is closed
Part_SensorA part is detected
Motor_RunThe motor command is on
AlarmA fault is active

Door_Closed = TRUE and Door_Open = TRUE describe opposite conditions of the same door. Clear names are essential.

8. Active-High and Active-Low Signals

Some real signals are considered active when voltage is present; others when it is absent. Initially, think of TRUE as a satisfied condition and FALSE as an unsatisfied one, but remember that voltage present does not always mean everything is healthy.

Emergency_OK = TRUE  → emergency circuit healthy; operation permitted
Emergency_OK = FALSE → emergency circuit open; operation prohibited

Use a precise name such as Emergency_OK or Emergency_Active rather than the ambiguous Emergency. This makes the meaning of TRUE clear.

9. Boolean Values in FBD

Each Boolean block input receives TRUE or FALSE. AND evaluates these values and produces TRUE only if all its inputs are TRUE:

[Input_1] ─────┐
               ├── [AND] ──> [Output_1]
[Input_2] ─────┘
Input_1Input_2Output_1
FALSEFALSEFALSE
TRUEFALSEFALSE
FALSETRUEFALSE
TRUETRUETRUE

The following lessons examine the logic operations individually.

10. Example: Motor Start Permissive

The motor should run only when Start is pressed and Safety_OK is active:

Motor_Run = Start_Button AND Safety_OK
Start_ButtonSafety_OKMotor_Run
FALSEFALSEFALSE
TRUEFALSEFALSE
FALSETRUEFALSE
TRUETRUETRUE

Motor_Run becomes TRUE only when both conditions are true.

11. Choosing Signal Names

The same physical condition can be named in different ways:

ValueDoor_Closed meansDoor_Open means
TRUEDoor closedDoor open
FALSEDoor not closedDoor not open

Both names are valid, but the program reads differently. For learning diagrams, permissive names such as Door_Closed, Emergency_OK, Safety_OK, Pressure_OK, and Drive_Ready often make logic easier to follow.

12. Simulator Practice

Open the example, where Output_1 follows Input_1:

[Input_1] ───────────────> [Output_1]
  • 1. Start the simulation.
  • 2. Set Input_1 = FALSE and check Output_1 = FALSE.
  • 3. Set Input_1 = TRUE and check Output_1 = TRUE.
  • 4. Return Input_1 to FALSE and check that Output_1 becomes FALSE again.

Observe how the logical input state affects the output state.

13. Additional Exercise

In edit mode, insert NOT between the input and output:

[Input_1] ──> [NOT] ──> [Output_1]
Input_1Output_1
FALSETRUE
TRUEFALSE

This shows that FBD blocks can transform a signal's value.

14. What to Understand

TRUE and FALSE are the basic Boolean values used in FBD programs. Their exact meaning depends on the signal name. Door_Closed = TRUE describes a normal condition, while Alarm = TRUE describes a fault.

15. Key Points

Boolean signals have two states, TRUE/FALSE or 1/0. Inputs represent buttons, sensors, and permissives. Outputs represent commands sent to equipment.

To read a diagram correctly, identify what TRUE and FALSE mean for each signal, which blocks process it, and whether it is inverted.

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.