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

Glossary · PLC and control programming

In-out variable

Also known as: VAR_IN_OUT, Input-output variable

German: Ein-/Ausgangsvariable

In IEC 61131-3 programming, an in-out variable is a parameter declared with VAR_IN_OUT that is passed by reference, so the called program organization unit can read and modify the caller's variable directly.

  • PLC programming
  • Standards

In one sentence

An in-out variable (VAR_IN_OUT) is passed by reference, so a function block can read and change the caller's variable directly.

Example

A function block that sorts a production queue receives the queue array as VAR_IN_OUT, so it works on the original data instead of a copy.

How it applies

  • Engineering: In-out variables avoid copying large structures and arrays and let a block modify data that belongs to the caller. They must be assigned at every call; the block cannot be called without its in-out parameters.
  • Risk: Because the block writes directly into the caller's data, side effects are harder to see. Coding guidelines often restrict VAR_IN_OUT to large data or to cases where modification is the explicit purpose.
  • Testing: Tests should check the caller's data after the call, not only the block outputs.
  • Documentation: In the block's interface table, mark in-out parameters clearly and state what the block changes. Treat the block interface like any Interface specification: direction, type, unit and meaning for each parameter.

In-out variable vs. input and output variables

An Input variable is copied into the block at the call; an Output variable is copied out after it. An in-out variable is shared: there is only one copy, owned by the caller.

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

Source: IEC 61131-3, 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 Blog and are not part of any standard.

Seen a mistake? Send us a note!