The first-scan bit is a special system flag that is true for exactly one program scan - the very first one after a PLC transitions to RUN - and false forever after until the next start. That one-scan window is where a program does its housekeeping: preloading setpoints, initializing counters and registers, clearing latches, and putting outputs into known safe states before normal logic takes over. It goes by different names across brands, but the idea is universal, and in oil and gas it is the difference between an RTU that wakes up in a safe, known condition and one that comes back guessing.
First-Scan Bit in one line: A first-scan bit is a processor-supplied bit that is TRUE only during the first program scan after a PLC enters RUN, then stays FALSE. Programs use that one-scan pulse to initialize values - preloading setpoints, seeding registers, clearing latches, and setting safe default states - so the controller starts from a known condition rather than whatever RAM happened to contain.
When a PLC goes to RUN, its logic begins executing against whatever values are currently in memory, and those values are not always what you want. Non-retentive data may be zero, retentive data may hold a value from before a fault, and some registers may need to be set to a starting condition that the process requires. The first-scan bit exists to give the program a single, guaranteed opportunity to put things right before the process logic runs for real. Anything you gate with the first-scan bit executes once, at startup, and never again until the next transition to RUN.
The one-scan duration is exactly what makes it useful. Because the bit is true for a single scan and then false, logic conditioned on it runs precisely once - it behaves like a built-in power-up one-shot. That is ideal for initialization, which by definition should happen once at startup and not repeat: you want to preload a setpoint on the first scan, but you emphatically do not want to keep forcing it back every scan, because that would prevent the operator from ever changing it. The first-scan bit's single pulse gives you initialization without lockout.
Typical uses cluster around getting to a known starting state. Programs use the first scan to load default setpoints and configuration values, initialize or clear counters and accumulators, reset latched conditions and sequence steps so a process restarts from the beginning rather than mid-sequence, and drive outputs to safe defaults. Some also use it to seed diagnostic data, timestamp the startup, or increment a power-cycle counter. In every case the pattern is the same: do the one-time setup here so the rest of the program can assume a clean, defined starting point.
The concept is universal but the name and mechanism differ by platform, which trips up engineers moving between brands. In Allen-Bradley controllers the first-scan bit is a status bit provided by the processor - historically S:FS in the older SLC and PLC-5 status file, and available as a first-scan status flag in Logix processors - that the program reads directly. You reference it on a rung, and it is true only on that first scan after the processor starts running. It is supplied by the system; you do not create it.
Siemens takes a structurally different route to the same end. Rather than a status bit read in the main routine, Siemens provides a dedicated startup organization block - historically OB100 and related startup OBs - that the operating system executes once when the CPU transitions to RUN, before the cyclic program (OB1) begins. Initialization code goes in that startup block, and it runs one time at startup by design. Some Siemens programs also maintain a FirstScan-style flag in the main program for logic that prefers the bit form, but the native mechanism is the startup OB.
Other platforms offer their own equivalents - a first-scan or first-cycle system flag, a designated cold-start or warm-start routine - but every one solves the same problem: give the program a one-time hook at the moment it starts running. The practical takeaway for anyone porting logic is to map the concept, not the syntax. Code that relied on S:FS in an Allen-Bradley program has to move into the startup OB when it goes to Siemens, and initialization written for a startup routine has to be reconditioned on a first-scan bit when it moves the other way. Missing that mapping is a classic source of a controller that runs but does not initialize the way the original did.
The first-scan bit earns its keep at unmanned wellsites and remote facilities where a controller has to recover from a power event on its own, with no one on site to sort it out. A wellsite RTU that loses power and comes back needs to reach a safe, defined state before it starts acting on the process, and the first scan is where that happens: driving a control valve to a known safe position, clearing any latched shutdown or permissive that should not survive a restart, and defaulting operating modes so the site does not resume in some ambiguous half-state. Getting this right means power blips leave the site safe rather than surprising.
Flow totalizers are the classic oilfield first-scan concern, and they cut both ways. Custody and allocation measurement accumulate volume over time, and how the totalizer behaves on the first scan determines whether that accumulated volume is preserved or wiped. If the total is meant to persist across a power cycle it must live in retentive memory and specifically not be reinitialized on the first scan; if a working register needs to be preloaded from the retained value, that preload belongs in first-scan logic. Confusing the two - clearing a total that should have carried over, or failing to reload a working value - produces lost or double-counted volume, which is a real revenue and reconciliation problem in the field.
The safe interplay between the first-scan bit and retentive memory is what makes an RTU dependable after an outage. First-scan logic decides what gets forced to a default on startup, and the retentive settings decide what survives untouched; the two together define the controller's power-up behavior. A well-designed remote RTU uses the first scan to guarantee safety-critical defaults while deliberately leaving retained production totals and settings alone, so it comes back both safe and honest about what it measured. Because these sites can go long stretches without a visit, that one-scan startup logic is often the only thing standing between a routine power blip and a site that comes back wrong.
It is used for one-time initialization at startup: preloading setpoints and configuration, initializing or clearing counters and registers, resetting latches and sequence steps, and driving outputs to safe defaults. Because it is true for only the first scan after the PLC enters RUN, logic gated by it runs exactly once, which is ideal for setup that should happen at startup and not repeat. This gives the rest of the program a clean, known starting condition.
In Allen-Bradley it is a processor status bit - historically S:FS in the SLC and PLC-5 status file, and a first-scan status flag in Logix - that the program reads directly on a rung. Siemens instead uses a dedicated startup organization block, historically OB100, that the operating system runs once when the CPU goes to RUN before the cyclic program begins. Both give a one-time startup hook, but one is a bit you read and the other is a routine that runs.
Because an unmanned RTU has to recover safely from a power event by itself. First-scan logic drives valves to a safe position, clears latches that should not survive a restart, and defaults operating modes so the site comes back in a known state rather than an ambiguous one. It also governs how flow totalizers behave on power-up, which determines whether accumulated production volume is correctly preserved or lost.
Merobix reads your field devices into a cloud SCADA - the real thing behind these terms, live in days from any browser.