Analog & Scaling:
turn a current into a number you trust.
Digital inputs are easy: a button is on or off. The real world isn't. Temperature, pressure, level, flow and weight are continuous, and they reach the PLC as a tiny electrical signal that means nothing until you give it meaning. A 4–20 mA loop becomes a raw integer, and only after you scale it does that integer become a real 72.4 °C. Get that chain right and you can trust your process data. Get it wrong and every alarm, PID loop and report that uses it is built on a lie. This module walks the whole path: the signal and why it's 4–20 mA, the raw count and what it really is, the two-point scaling math, filtering noise without hiding events, and catching a dead or lying sensor before it makes a decision for you.
Raw counts aren't degrees
📊 the card hands you 13824, not 50 °C. Scaling is the linear map from the card's raw range to your engineering units. It is the single most common piece of analog code, and the one beginners get backwards or off by a bit.
4–20 mA is honest by design
🔌 the loop starts at 4 mA, not 0, on purpose: a real zero reads 4 mA, so 0 mA means something has failed: usually a broken wire, sometimes a dead transmitter or lost loop power. That live zero is a built-in fault signal, as long as you bother to check for it.