Glossary · Automation fundamentals, platforms and components
Function (FC)
Also known as: FC, Function (IEC 61131-3)
German: Funktion (FC)
In IEC 61131-3, a function is a program organization unit that returns a result based only on its inputs and has no memory between calls. "FC" is the abbreviation used in Siemens SIMATIC for this block type.
- Automation components
- Standards
In one sentence
In IEC 61131-3, a function (FC) is a program unit without memory that returns a result from its inputs each time it is called.
Example
A function FC_Scale converts a raw analog value into a temperature in °C; called with the same input, it always returns the same result.
How it applies
- Engineering: Functions suit calculations and conversions. Because they keep no state, they are easy to test and reuse. State that must persist, such as a timer, belongs in a Function block (FB).
- Maintenance: Well-named functions make programs readable; libraries of tested functions reduce errors.
- Documentation: Library documentation should give each function's purpose, inputs, outputs, units and limits. Vendor extensions (for example temporary variables or access to global data) should be noted, because they can break the "no memory" assumption.
Function vs. function block
A function has no instance data and returns the same output for the same inputs. A function block has an instance with internal memory, so the same call can return different results depending on its history. Mixing them up is a common beginner error.