Analog Signals: Hello Real World
The Core Idea
An analog input represents a measured amount, such as temperature, level, or pressure, as a number. To use it correctly, the program needs to know what quantity that number represents and which units belong to it.
What you will learn
Why on/off logic cannot describe most of what a controller needs to measure, and what an analog signal is
How a programmable logic controller (PLC) sees and reads a value that lives on a gradient rather than as TRUE or FALSE
How that continuous measurement reaches the controller as a current or voltage signal, and why a 4–20 mA loop starts at 4, not 0
When to store a value as
BOOL,INT, orREAL, and why a scaled integer can hold a fraction too
Why it matters
A yes/no signal cannot tell you how hot, how full, or how fast something is. Numeric measurements let the program and operator make decisions about the amount.
The problem
Everything so far has been binary. A switch is open or closed, a lamp is on or off, a part is present or not — one bit, TRUE or FALSE. On/off logic describes that world perfectly, and a lot of a machine really is on/off.
But most of what a controller must measure is not on or off. How hot is the oven? How full is the tank? How fast is the line running? How much pressure is in the header? None of those have a TRUE/FALSE answer. They have a reading that slides smoothly across a range — 180 °C, 47.5%, 12.4 PSI (pounds per square inch) — and the number between the extremes is exactly the part that matters. These are analog values: continuous quantities that live on a gradient, not at two fixed states.
Controlling a process depends on them. You cannot hold a temperature, fill a tank to a level, or pace a line by knowing only "hot or not." The controller has to see the whole range and act on where the value sits within it. That is what analog signals are for, and the rest of this lesson is about how a PLC reads a value that exists on a gradient.
A controller cannot read a tank or a furnace directly. A transmitter mounted on the equipment measures the quantity and converts it into an electrical signal the PLC's analog input can read. The two most common signals are:
4–20 mA — a current loop. The transmitter sets the current anywhere from 4 mA (its lowest reading) to 20 mA (its highest). This is the workhorse of plant instrumentation.
0–10 V — a voltage signal, common on shorter runs and on drives.
Why 4 mA and not 0
A current loop deliberately starts at 4 mA, not 0. That offset is called a live zero, and it is the quiet genius of the standard. If the lowest valid reading were 0 mA, a reading of 0 could mean two different things: a genuinely empty tank, or a broken wire. By putting the bottom of the range at 4 mA, 0 mA becomes impossible during normal operation — so when the input does read near 0, the PLC knows the loop is broken, not that the tank is empty. You get a free wire-break detector built into the signal itself. A later lesson uses this to raise a bad-signal alarm.
The transmitter and the PLC input are wired in a simple two-wire loop: the same two conductors carry both the direct current (DC) power to the transmitter and the signal current back. The transmitter acts like an adjustable valve on the current, setting it to represent the measurement.
Raw signal versus engineering units
The 4–20 mA on the wire is not what anyone wants to see. An operator wants 47.5%, or 82.3 °C, or 12.4 PSI — the value in its real-world engineering units. So an analog value lives at three stages, each in its own tag:
| Stage | What it is | Example value |
| Raw signal | The electrical reading, or the raw count the analog card produces | 11.6 mA, or 13133 counts on a card that reads 4–20 mA as 0–27648 counts |
| Scaled process value | The signal converted to engineering units | 47.5 % |
| Setpoint / output | A target the operator sets, or a command the PLC sends out | 80.0 % alarm point |
Keeping these as separate tags matters: the raw signal, the scaled reading, the operator's setpoint, and any output command are different numbers with different jobs. Converting the raw signal into engineering units is scaling, and it is the next lesson. This lesson is about the value once it is in the program.
Choosing the data type
Once a measurement is in the program, the tag's data type decides what it can hold.
| Type | Holds | Use it for |
BOOL | ON / OFF (TRUE / FALSE) | A discrete state: a float switch, a pushbutton, a running bit |
INT | Whole numbers only | Counts, steps, a part tally |
REAL | Numbers with a fraction | Any analog value: 47.5 %, 82.3 °C, 11.6 mA |
The simple trap is storing an analog value in an INT and treating it as whole units. An INT has no fraction, so 99.9% read that way becomes 99, and the measurement can never resolve finer than 1%. When you just need a plain number, REAL avoids this entirely.
But an INT is not automatically wrong for analog. A very common technique is a scaled integer with an implied decimal point: you agree that the stored value carries a fixed number of decimal places, so 1000 means 10.00 and 9990 means 99.90. The fraction is still there — it is just held as a factor of ten in a whole number, and the program and the human-machine interface (HMI) divide by the scale when they display or compare it. This is widespread on controllers without native floating-point math, in communications registers, and anywhere REAL math is expensive or unavailable.
The real rule, then, is not "never use INT" but know your scale. A raw count, a scaled integer, and a REAL can all represent the same measurement; what breaks things is reading a value at the wrong scale — treating 1000 as a thousand when it meant 10.00, or comparing a raw count to an engineering-unit setpoint. Use REAL when you want the number to just be the number; use a scaled INT when the platform or the protocol calls for it, and document the implied decimal so everyone divides by the same factor.
Analog is not a separate kind of input/output (I/O) direction — it is a numeric signal that happens to be continuous. Once you hold it where the fraction survives, the rest of the program can compare it, scale it, trend it, alarm on it, and control with it. Those are the lessons that follow; this one is about seeing the value clearly in the first place.
Common mistakes
Reading a value at the wrong scale. If a tag holds
1000to mean10.00, code that treats it as a plain1000is off by a factor of 100. Know the scale of every analog tag — plain number, raw count, or implied decimal — and convert before you compare or display it.Assuming 0 means empty. On a 4–20 mA loop, a reading near 0 means a broken loop, not a zero measurement. The live zero is a feature; do not scale it away.
Treating the raw signal as the process value.
11.6 mAis not47.5%. Scale the raw signal into engineering units before comparing or displaying it.
Platform notes
Analog input modules name the raw value differently across platforms — you may see it as a channel word, an input count, or an already-scaled REAL, depending on the module and how it is configured. Some modules scale to engineering units in the module configuration, so your program receives a REAL directly; others hand you raw counts and expect the program to scale them (the next lesson). Either way, the ideas here hold: there is a raw signal, an engineering-unit value, and a data type that must be able to hold the fraction.
Key takeaways
The big idea: a non-binary measurement reaches the PLC as a raw electrical value (a current or voltage), and the program must apply logic to turn that raw value into an engineering unit. The signal is not the number you want; you calculate the number from it.
A 4–20 mA loop carries a live zero — 4 mA is the bottom of the range, so a reading near 0 is a broken wire, not a real measurement. That built-in open-circuit detection is why 4–20 mA is the plant standard over 0–20 mA.
Hold the value where its fraction survives (a
REAL, or a scaled integer with a known decimal), and never read a tag at the wrong scale.
Enable JavaScript to run the embedded simulator and complete the interactive exercises.