Learn PLCs free
Data Types & VariablesBeginnerEssential
4 min read
Updated
Beginner

BOOL

BOOL

Quick answer

BOOL is a PLC Boolean data type whose logical value is TRUE or FALSE. Use it for conditions, commands and digital states; its physical storage allocation and I/O behavior depend on the controller and runtime.

Key Takeaways

  • BOOL is a PLC Boolean data type whose logical value is TRUE or FALSE. Use it for conditions, commands and digital states...
  • Beginner-level topic in Data Types & Variables
  • Commonly used in: Digital input and output state, Permissives, alarms and sequence conditions
  • Related to: Bit Field, BYTE, Signed

Detailed Definition

BOOL represents a two-state logical value: FALSE or TRUE. Ladder contacts evaluate Boolean conditions and coils write Boolean results, while Structured Text uses BOOL values directly in expressions such as StartRequest AND PermissiveOK. A BOOL tag describes logic state; it does not by itself detect an edge, debounce an input or implement a safety function.

IEC semantics describe a one-bit Boolean value, but memory allocation is platform-specific. Rockwell documents BOOL as a one-bit Boolean, while CODESYS documents an ordinary BOOL as reserving eight bits and offers a separate BIT type for packed structure members. Do not infer memory layout, atomic access or fieldbus encoding from the logical type alone.

Technical reference

TRUE/FALSE semantics are consistent; storage allocation, direct I/O mapping and conversion rules are controller-specific.

Reviewed against current primary documentation:

BOOL PLC Data Type at a glance

Type family
Boolean
Width
1-bit logical value; allocated storage varies
Signedness
Not numeric signedness
Range / values
FALSE or TRUE
IEC-style literal
BOOL#TRUE
Best fit
Conditions, commands, comparison results and digital states

Avoid this type when: You need an event count, elapsed time, packed protocol field or safety-rated function.

Vendor notation and support boundaries

IEC names help portability, but controller generations, compiler options and instruction signatures still differ.

CODESYS

An ordinary BOOL is documented as reserving eight bits. CODESYS BIT is a separate one-bit member type for defined layouts.

Siemens SIMATIC

S7 documentation treats Bool as a bit value. Addressing and optimized data-block layout still depend on the selected CPU and block settings.

Rockwell Logix

Studio 5000 documents BOOL as a one-bit value and warns against converting data to or from BOOL. Use Boolean instructions rather than relying on numeric coercion.

IEC-style Structured Text

Build a non-safety run request

VAR
  StartRequest : BOOL;
  StopRequest : BOOL;
  PermissiveOK : BOOL;
  RunCommand : BOOL;
END_VAR

RunCommand := StartRequest AND PermissiveOK AND NOT StopRequest;

RunCommand is recalculated each execution. This example illustrates Boolean logic only; an actual motor circuit needs the approved stop behavior, interlocks and safety design.

Ladder equivalent: Illustrative Logix-style rung: XIC StartRequest, XIC PermissiveOK and XIO StopRequest driving OTE RunCommand. Mnemonics and input polarity vary by platform.

Boundary cases to test

These are mathematical boundaries, not promises about one runtime's failure mode.

Input / operationMathematical resultSafe engineering action
FALSE → TRUE transitionThe BOOL is TRUE after evaluation.Use a documented rising-edge instruction or one-shot when the action must occur once rather than every scan.
Physical input chatters between statesThe program may observe multiple transitions.Apply appropriate hardware filtering or validated debounce logic; BOOL alone provides no filtering.

Conversion guidance

  • Prefer direct Boolean expressions such as IF Ready THEN instead of comparing the value with numeric 1.
  • Use a platform-documented conversion only when an interface explicitly requires 0/1 numeric encoding.
  • Document whether a field signal is active-high or active-low before assigning it to a semantic BOOL tag.
  • Treat edge memory and debounce state as separate logic, not as properties of the BOOL type.

Before using this type

  1. 1Confirm the field signal polarity and de-energized state.
  2. 2Test cold start, communications loss and first-scan initialization.
  3. 3Check whether a one-shot, latch or debounce function is actually required.
  4. 4Verify storage and network mapping rather than assuming one physical bit.

Primary technical sources

These sources support the type ranges and platform notes above. The project's controller, firmware and compiler documentation remains authoritative for execution.

Common Questions

What is BOOL?

BOOL is a PLC Boolean data type whose logical value is TRUE or FALSE. Use it for conditions, commands and digital states; its physical storage allocation and I/O behavior depend on the controller and runtime.

When should I use BOOL?

BOOL is particularly useful in scenarios such as Digital input and output state and Permissives, alarms and sequence conditions. Consider implementing it when you need reliable, efficient solutions for these types of applications.

What should I verify before using BOOL?

Confirm the field signal polarity and de-energized state. Test cold start, communications loss and first-scan initialization. Check whether a one-shot, latch or debounce function is actually required. Verify storage and network mapping rather than assuming one physical bit.

What are related concepts I should learn?

To fully understand BOOL, you should also familiarize yourself with Bit Field, BYTE, and Signed. These concepts work together in industrial automation systems.

Was this helpful?

Let us know if this glossary term helped you understand BOOL better.

Your feedback helps us improve our glossary and create better content for the PLC programming community.

Quick Info

Difficulty
Beginner
Tier
Essential

About Data Types & Variables

Data structures, variable types, and memory organization

Total Terms:30
Difficulty:Beginner to Intermediate

Free PLC simulator

Stop reading, start doing

Write ladder logic in your browser, hit Run, and watch machine scenarios react. A 12-lesson curriculum across 8 PLC dialects — free account, no credit card.

Practice PLCs free →