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

Glossary · Automation fundamentals, platforms and components

Recursion

Also known as: Recursive call

German: Rekursion

In programming, recursion is a technique in which a function or procedure calls itself, directly or indirectly, to solve a problem by reducing it to smaller instances of the same problem until a base case is reached.

  • Automation components

In one sentence

Recursion means a function calls itself to solve smaller instances of a problem; PLC coding guidelines usually restrict it for timing reasons.

Example

A tool script walks through a nested folder of machine variants recursively, while the PLC code that uses the result contains only loops with fixed bounds.

How it applies

  • Engineering: Recursion is natural for tree structures such as nested configurations, bills of material or file systems, and is common in Python tools and IT software.
  • Control code: On PLCs, recursion makes stack use and execution time hard to bound, which can overrun the Scan cycle and trigger the Watchdog. IEC 61131-3 does not intend recursive calls, and many environments reject or restrict them; coding guidelines, especially for safety-related software, usually forbid them.
  • Documentation: Coding guidelines should state whether recursion is permitted and, if so, the maximum depth. Code reviews check this rule.

Recursion vs. iteration

Every recursive algorithm can be written as a loop (iteration), often with an explicit stack. In control software, iteration with fixed bounds is preferred because its time and memory use are predictable.

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

Source: AI TechDoc Knowledge editorial definition, based on common software engineering practice

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!