Glossary Updates12 new terms added to the glossaries · October 2, 2026, 22:44 CEST
AI TechDocKnowledge

Glossary · Automation fundamentals, platforms and components

Constant (programming)

Also known as: VAR CONSTANT

German: Konstante

In programming, a constant is a named value that cannot be changed while the program runs. In IEC 61131-3, constants are declared with the CONSTANT qualifier, for example in a VAR CONSTANT section, or written as literals.

  • Automation components
  • Standards

In one sentence

A constant is a named value that cannot change at runtime; IEC 61131-3 declares it with the CONSTANT qualifier.

Example

The maximum number of cartons per layer is declared as a constant MAX_CARTONS := 12, so the loop and the HMI check use the same value.

How it applies

  • Engineering: Named constants replace magic numbers, make code easier to read and change, and let the compiler catch accidental writes.
  • Maintenance: A constant can only be changed by modifying and downloading the program, which puts it under change control. Values that operators must adjust belong in parameters or recipes instead.
  • Documentation: Programming guidelines should say which values are constants and which are parameters. Software documentation can list key constants with their unit and meaning.

Constant vs. parameter

A constant is fixed in the program. A parameter is a value that can be changed during operation or commissioning, for example via the HMI, without changing the program. Choosing the right one affects who may change a value and how that change is traced.

By knowledge.aitechdoc.world · Published September 26, 2026 · Last reviewed

Source: IEC 61131-3:2013, Programmable controllers — Part 3: Programming languages

Definitions follow the cited standards and specifications. Where a source is a copyrighted publication, such as an ISO, IEC or EN standard, the definition is a close paraphrase, not a verbatim quotation, so as not to infringe copyright. We recommend reading the original publication. The sections “How it applies” are editorial commentary by AI TechDoc Knowledge and are not part of any standard.

Seen a mistake? Send us a note!