See The Video Here
When working with programmable logic controllers (PLCs), understanding numeric data types is essential. PLCs rely on various data types to handle information effectively, from simple Boolean states to complex floating-point calculations. This blog explores the building blocks of data units, the key numeric data types, and their practical applications in PLC programming.
Sizing of Data Units
At its core, digital information in a PLC is made up of bits. These bits can be grouped into larger units depending on their function. Here’s an overview:
- Bit: The smallest unit, representing either 1 (on) or 0 (off).
- Nibble: A group of 4 bits.
- Byte: Composed of 8 bits.
- Word: Composed of 16 bits.
- Double Word: Composed of 32 bits.
These units form the foundation for all data types used in PLC programming.

Basic Data Types
The basic (or atomic) data types represent fundamental pieces of information. They include:
1. Boolean
- Size: 1 bit.
- Purpose: Represents two states, 1 (true/on) or 0 (false/off).
- Example Use: Detecting whether a sensor is activated.

2. Unsigned Integers
Unsigned integers represent positive whole numbers.
8-Bit Unsigned Integer:
- Size: 1 byte (8 bits).
- Range: 0 to 255.

16-Bit Unsigned Integer:
- Size: 1 word (16 bits).
- Range: 0 to 65,535.

3. Signed Integers
Signed integers handle both positive and negative whole numbers. When converting signed integers from binary, there is a special arrangement to handle negative as well as positive values. The bit that is most to the left is considered the most significant bit (MSB). The signed integer data type uses the MSB for a special purpose. The MSB is assigned a negative value if that particular bit is set to 1. This gives the format the capability to express negative numbers.
8-Bit Signed Integer:
- Size: 1 byte (8 bits).
- Range: -128 to 127.

16-Bit Signed Integer:
- Size: 1 word (16 bits).
- Range: -32,768 to 32,767.
- The most significant bit (MSB) determines the sign. If the MSB is 1, the number is negative.

32-Bit Signed Integer:
- Size: 1 double word (32 bits).
- Range: -2,147,483,648 to 2,147,483,647.

Floating Point
See The Video Here
Floating-point data types store numbers with decimal places. Consider the Single Precision Floating Point as an example. It occupies a Double Word (32 bits). The way that data is encoded within the 32 bits is very different then what we see with integers. To manage a wide range of numbers with decimal places, the 32 bit structure is divided into 3 subgroups. The subgroups hold different attributes that encode a value. The following is a brief description of the structure of the data type.
1 bit will represent the sign of the number, 0 if positive and 1 if negative.
8 bits are assigned to the purpose of storing an exponent value. An exponent is a component of a number when it is expressed in scientific notation. In this case it is a form of scientific notation that is at Base 2 .
23 bits are assigned to hold compressed details of the number that is known as the Mantissa. The Mantissa is also a component of a number when it is expressed in this Base 2 version of scientific notation.

Single Precision Floating Point
- Size 1 double word ( 32 bits ).
- 1 bit: Sign (0 = positive, 1 = negative).
- 8 bits: Exponent.
- 23 bits: Mantissa.

Floating points are ideal for applications requiring precision, such as temperature or flow rate measurements.
Other Data Types
Structured Data Types
Combinations of the basic, atomic, data types can be grouped together and they are called structures. PLCs utilize these structured data types to handle specific tasks. There are predefined structured data types for timers, counters and file control operations just to name a few.
Consider a Timer Data Type for an Allen Bradley SLC 500 PLC. It is made up of three 16 bit words. Bits 13, 14 and 15 of Word 0 are boolean data type. The booleans are to express the on/off state for the timer Enable, Timer-Timing and Done. Word 1 and Word 2 are signed 16 bit integers containing numeric data for the timer preset and accumulator.

User-Defined Data Types (UDTs)
Some PLCs allow custom structures, enabling programmers to define data types tailored to their application by combining existing ones.
Conclusion
Numeric data types are the backbone of PLC programming, enabling the efficient handling of data for a wide range of applications. Whether you’re toggling a simple boolean state or performing precise floating-point calculations, selecting the right data type ensures your system operates smoothly.
Take time to understand your PLC’s predefined options, and don’t hesitate to explore user-defined types for custom applications. Proper data management is a cornerstone of robust PLC programming.
Coming Soon – More PLC Blogs
Can you write more about it? Your articles are always helpful to me. Thank you! http://www.kayswell.com
Reading this felt like walking through a gallery of ideas, each one framed with care and presented with clarity. Your words have a way of making the abstract feel tangible, of bringing thoughts into sharp focus. I walked away from this