🗂️ The Suspiciously Fun PLC Series · Deep DiveVariable scope:
Variable scope:
who sees what, for how long.
Every variable answers three questions: who can see it, may they write it, and how long does it live? The declaration block decides all three. This module maps the four POU blocks, the in/out interface, globals & the I/O map, constants & scratch variables, and the persistent lifetimes.
Inside a POU
🧠 VAR & the three questions · 🔁 INPUT / OUTPUT / IN_OUT · 🧪 TEMP, STAT & CONSTANT.
Across the project
🌐 globals & I/O mapping · 🔋 RETAIN & PERSISTENT lifetimes.
This expands the Variable-scope chapter from the Platform track into a full module.