Industrial Engineer · phase 3 of 16 · noun

Routine / Function

Reusable or callable unit of logic that performs a defined operation.

The Explain card

Plain English
A routine is a named piece of logic inside a program, and a function is a callable piece of logic that returns a result. Both exist so you can name a job and call it instead of repeating it.
Example
A Main routine calls an Alarms routine, a Motors routine and a Sequence routine in order every scan. A scaling function is called with raw counts and hands back engineering units.
Why it matters
A routine that is never called never runs, which is the first thing to check when new logic seems dead. Functions keep no memory between calls, so anything that needs to remember goes in a function block instead.
Hook
Name the job once and call it by name.

Word knowledge

How the word is built, where it came from, and what it sits beside in memory.

In a sentence

The PLC calls the Routine each scan to scale the analog pressure input before alarm comparison.

How it is built
  • route root road, way, or course
  • -ine French suffix forms a derived noun
Where it came from
Origin
French routine, formed from route, meaning road or course, and the suffix -ine
Entered the language
1670s
What changed
It moved from a traveled course to an established procedure, then acquired its programming sense in the 20th century.
How it is spelled
Pattern
The letters ou represent the /uː/ sound.
Pattern
The final ine represents the stressed /iːn/ sound common in French-derived words.

Spelled like

  • group
  • soup
  • machine
  • magazine
Broken into chunks
  • rout
    • route
    • routing
  • ine
    • machine
    • magazine
What it sits beside

Same subject

Same shape

  • machine
  • magazine
  • caffeine

IEC 61131-3 program organization units

callable logic units

Where it sits in the deck

Phase 3: PLC Program Organization and Execution

How the logic is arranged and how the scan actually runs it, which is the difference between code that works and code that works every time.