PLC Data Types and Their Sizes with Example | Topiccenter.live

Introduction

Programmable logic controllers (PLCs) are at the core of control systems used in industrial automation. The way a PLC program uses various data types and their respective sizes determines how the stored information, processed data and ultimately the utilized output of the PLC is going to be organized.

This article is a hands-on guide to the data types in PLCs. We tried to keep it as application-oriented as possible and avoided getting into the formalities. Let’s start!

What Are PLC Data Types?

PLC Data types image

PLC data types can be thought of as elemental components that determine the attributes and memory allocation of various types of information. They are not abstract ideas, but instead, they are the actual elements in the PLC that represent the variable and values of the real world. Data types should be well understood when developing any type of program because it will ultimately determine how the PLC will correctly use or misinterpret the values that are used to control the process and machinery it is programmed to manage.

Common Data types in PLC and Their Sizes

1. Boolean

A Boolean data type is the smallest data type that we can use in our PLC programming and it’s represented by 1 bit. It can hold 2 values: TRUE or FALSE or in other words, a logical ON/OFF. 

Size of Boolean Data Type: 1 Bit

Boolean variables are very useful in many basic control applications such as switch states, relay outputs etc. For instance, a digital output of a PLC can be used to interface with relays, where the relay is considered as a simple on/off switch. Similarly, inputs from buttons can be treated as Boolean variables. A button can either be pressed (TRUE or LOGICAL ON) or not (FALSE or LOGICAL OFF).

Example : In Siemens PLC you can assign a Boolean variable address as %M3.0,M3.1.. So on. 

2. Integer (INT)

An Integer is a data type that represents whole numbers in PLC programs; both positive and negative integers.

Size of Integer Data Type: 16 Bit

The 16 bits provide the range of values needed to count, index, and perform basic arithmetic. INTs are widely used for almost all applications in industrial networks. 

They can be used to keep track of production units, relay sensor or switch inputs, and any other application where a simple whole number value is needed.

Example: In Siemens PLC Integer variable is addressed as %MB5. , %MB7 .. etc.

3. Double Integer (DINT):

For bigger numbers or more precision Double Integer is the way to go. 

Size of Double Integer Data Type: 32 Bit

With 32 bits DINTs have plenty of storage for extended counting, high precision measurement and complex calculations. Whether you’re counting time or inventory DINTs are versatile and accurate in PLC programming.

Example: In PLC Double Integer variable is addressed as %MD9,%MD13,... etc.


4. Real (REAL):

In many process applications, control of analog variables like temperature, pressure and flow is critical. Real data types, 32 bit, allow PLCs to handle floating point numbers with decimal precision. From heating systems to chemical dosing, REALs let you control the fine detail.

Size of Real Data Type: 32 Bit

Example: In PLC Real Data Type is addressed as same as Double Integer i.e %MD17,%MD21..etc

5. String:

Numeric are the bread and butter of PLC programming but text is also used in many industrial applications. String data types allow PLCs to handle sequences of characters, text messages, alphanumeric codes and user input. 

Up to 255 characters in size strings are used for communication, documentation and human machine interface in PLC controlled systems.

Size of Real Data Type : Usually 64 Bit.

📘

Also read

Can SCADA work Without PLC | A Practical Guide Latching in PLC.

Selecting the Right Data Type

In PLC programming deciding on the data type, for every variable is a choice that directly affects system performance, memory usage and code efficiency. While it might be tempting to opt for the data type it's important to find a balance between accuracy and resource utilization. 

Factors to keep in mind when selecting a data type include:

Precision Needs: Evaluate the precision and range of values needed for each variable to ensure compatibility with the requirements of the application.

Memory Restrictions: Take into account the PLCs memory resources. Allocate memory wisely to prevent waste and optimize performance.

Speed of Processing: opt for data types that match well with the processing capabilities of the PLC to reduce computation time and response delays.

Summary

In summary, data types and their sizes matter in PLC programming for industrial automation. By using the right data types for each variable and minimizing memory usage, automation engineers can build robust, efficient and scalable control systems for today’s manufacturing world. Now you know the facts and have real world examples, you can tackle data types with confidence and open up new opportunities for innovation and efficiency in industrial automation.

Frequently Asked Questions (FAQs)

Q1.  How many data types are in PLC?

There are several common data types in PLC programming, including Boolean, Integer (INT), Double Integer (DINT), Real (REAL), and String. The exact number can vary depending on the PLC manufacturer.


Q2. Why do PLCs use data types? 

PLCs use data types to store and process different types of information so you can control and monitor your processes better. Data types help to define the size and nature of the data so programming is more organized.

Q3. What is library of PLC data types?

A library of PLC data types is a collection of predefined data types provided by PLC programming environments. This library includes various data types such as Boolean, Integer, Double Integer, Real, and String, and other user defined data types, which are used to define the nature and size of data in PLC programs, facilitating efficient programming and system operation.

📘

Also read

What is Latching in PLC Programming With Example Latching in PLC.


📘

Also read

Are you interested in electronics, Check out our new post on Broadband Amplifiers.

Post a Comment

Previous Post Next Post