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

Glossary · Automation fundamentals, platforms and components

Pragma

Also known as: Compiler directive

German: Pragma

In IEC 61131-3 programming, a pragma is an instruction to the programming tool or compiler, written in curly braces, that does not change the program's logic semantics but controls how it is compiled, displayed or exported. Pragma content is implementation-specific.

  • Automation components

In one sentence

A pragma is a curly-brace instruction to the PLC compiler or tool, such as hiding a variable or controlling OPC UA symbol export.

Example

A developer adds a pragma above a variable declaration so that the variable is exported to the OPC UA server's symbol set.

How it applies

  • Engineering: Pragmas control conditional compilation, warnings, symbol export, attribute assignment and similar tool behavior. Because their meaning is vendor-specific, code with pragmas is less portable between IEC 61131-3 environments.
  • Review: A pragma can change which variables are visible to external clients, so it matters for access and security reviews. Include pragmas in code reviews, not only the logic.
  • Documentation: Libraries that depend on pragmas should list them and explain their effect, for example which variables they expose through Symbol export. Record the tool version, because pragma support can change between releases.

Pragma vs. comment

Both are enclosed in special delimiters, but a comment (* ... *) is ignored by the compiler, while a pragma { ... } is read and acted on by it.

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!