Automation Glossary • PLC Data Block

What Is a PLC Data Block (DB)?

Merobix Engineering • • 6 min read

A data block is an organized region of PLC memory used purely for holding data rather than executable logic. Best known from Siemens S7 controllers, where they are literally called DBs, the same idea appears as structured tag storage in other brands. A data block groups related values - setpoints, recipe parameters, configuration, and the working data of function blocks - into a named, structured container instead of loose scattered addresses. Keeping data in tidy blocks rather than strewn across raw memory is a large part of what makes a substantial control program readable and maintainable years after it was written.

Back to Blog

PLC Data Block in one line: A PLC data block is a dedicated area of controller memory that stores structured data such as setpoints, recipes, configuration, and the internal state of function blocks, as opposed to program logic. Global data blocks hold data any code can access, while instance data blocks hold the private data of a single function block instance.

Organized Memory for Data, Not Logic

In a controller, code and data are different things, and a data block is where structured data lives. Rather than referring to bare memory addresses, you define a data block with named members of specific types - reals, integers, booleans, strings, and nested structures - and the program reads and writes those members by name. This gives data the same clarity that well-named tags give a program: instead of an anonymous address, you have a meaningful path to exactly the value you mean, which makes the code that uses it far easier to read.

The organizing power of a data block comes from grouping. Everything that belongs together sits together: all the tuning constants for a unit in one block, all the parameters of a recipe in another, all the configuration for a piece of equipment in a third. When you need to find or change a value, you go to the block that owns that category of data rather than searching scattered addresses across the whole program. This grouping is what separates a maintainable data model from a pile of loose numbers.

Data blocks also make it natural to define data using custom structures, so a block can hold not just simple values but composed types that mirror real equipment. A block might contain an array of structures, one per well or per stream, each with its own set of named fields. The block becomes a clean, self-describing store for the application's data, and anyone reading the program can understand the data model by looking at how the blocks are laid out, without reverse-engineering it from usage.

Global Versus Instance Data Blocks

A global data block, sometimes called a shared data block, holds data that any part of the program can read and write. This is where you keep values that many pieces of logic need in common: plant-wide setpoints, recipe libraries, configuration that multiple units reference, and general working storage. Because access is open, global blocks are the natural home for shared parameters and for data that has to be visible across the whole application, and they are typically the blocks a SCADA system reads for setpoints and configuration.

An instance data block is different: it holds the private working data of a single function block instance. When you create an instance of a function block, its internal state - the values it must remember between calls - is stored in an instance data block dedicated to that one instance. Ten instances of a pump-control function block have ten instance data blocks, each keeping its own timers, counters, and intermediate values completely separate from the others. This separation is exactly what lets the same block logic run many times without the instances interfering.

The distinction matters when you decide where a value belongs. Data that is genuinely shared - a common setpoint, a recipe, a plant configuration - goes in a global block so everything can reach it. Data that belongs to one instance of a reusable block - the internal memory that makes that particular pump or well behave correctly - belongs in its instance block, private and protected. Putting instance-private data into a global block, or shared data into an instance, muddies the model and reintroduces exactly the tangle that data blocks are meant to prevent.

Keeping a Gas-Plant Program Clean and Maintainable

A gas plant runs on a large body of tuning constants and configuration - controller settings, alarm limits, equipment parameters, unit-specific values - and where those live decides how maintainable the program is. Scattering them through the logic as hard-coded numbers makes every adjustment a hunt through the code and every change risky. Collecting them into well-named data blocks, grouped by unit or by function, turns tuning and reconfiguration into editing values in a known, organized place rather than hunting through rungs.

This organization pays off through the whole life of the plant. When a dehydration unit needs its limits retuned, a compressor its parameters adjusted, or a new recipe loaded, the engineer goes to the data block that owns those values and changes them there, confident that the logic reading the block will pick up the new settings without the code itself being touched. Separating the what - the configuration - from the how - the logic - means routine adjustments do not require modifying tested program code, which lowers the risk of every change.

Data blocks also give a cloud SCADA layer a clean surface to work with. Because setpoints, limits, and configuration are gathered in organized global blocks with meaningful names, a platform like Merobix can read those values to display current settings and, where permitted, write updated setpoints back to a well-defined location rather than poking at scattered addresses. An engineer adjusting a limit from a remote dashboard is changing a named value in a structured block, which is both safer and more transparent than editing anonymous memory. The tidy data model at the controller is what makes clean remote configuration possible in the first place.

Frequently Asked Questions

What is the difference between a global and an instance data block?

A global (shared) data block holds data any part of the program can read or write, which suits plant-wide setpoints, recipes, and configuration that many pieces of logic reference. An instance data block holds the private working data of one specific function block instance, keeping its internal state separate from every other instance. Shared values belong in global blocks; a block instance's private memory belongs in its instance block.

What does a PLC data block store?

A data block stores structured data rather than executable logic - things like setpoints, recipe parameters, equipment configuration, alarm limits, and the internal state that function blocks must remember between calls. The values are defined as named members of specific types, often organized into structures that mirror real equipment. This keeps related data grouped together instead of scattered across raw memory addresses.

How do data blocks make a control program more maintainable?

By collecting tuning constants, limits, and configuration into named, grouped blocks, they separate the plant's data from its logic. Adjusting a setpoint or retuning a unit becomes editing values in a known block rather than hunting for hard-coded numbers in the rungs, so routine changes do not require touching tested program code. The organized structure also gives a SCADA system a clean, well-named place to read and write settings.

From Definitions to a Live Dashboard

Merobix reads your field devices into a cloud SCADA - the real thing behind these terms, live in days from any browser.

Request a Free Demo +1 (903) 307-7300
More in Automation Glossary
User-Defined Data Type  •  Symbolic vs Absolute Addressing  •  Forcing I/O  •  Online Editing  •  Cold / Warm / Hot Restart  •  Clarifier  •  All Automation Glossary →
Free SCADA operator training
Merobix University - 70 video lessons & 261 quiz questions, from first login to compliance reporting. No demo call required.
Start free →