Explainer
Unity Pro system bits %S0 and %S1 for Grafcet startup initialization
Short answer
Unity Pro has no OB100: the hooks are the %S0 cold-restart and %S1 warm-restart system bits. Wire both in parallel on one rung, SET the initial Grafcet step bit and RESET every other step bit; for a native Grafcet chart call INITCHART from the same condition instead.
On this page
There is no OB100 in Unity Pro. The job that organization block does on a STEP 7 CPU - pulling a sequence into its defined start state before the machine moves - is done here by two CPU-owned system bits: %S0, the cold-restart bit, and %S1, the warm-restart bit. Wire both in parallel on one initialization rung, put a SET coil on the initial step bit and RESET coils on every other step bit, and the sequence comes up in its initial step whichever restart the CPU took. If your sequence is a native Grafcet chart instead of ladder-translated steps, call INITCHART from the same condition instead of writing equations. IEC 61131-3 requires every sequential function chart to have exactly one initial step; the rung or the call is what makes that requirement true at restart, and this article works through the two bits, the rung, an eight-step example and the on-CPU test.
What %S0 and %S1 are #
Unity Pro collects its system bits in the %S area, and the first two report restarts. %S0 is the bit the CPU sets for a cold restart; %S1 is the bit it sets for a warm restart. The CPU owns both: it raises the one matching the restart it performs and clears it again on its own schedule, so treat them as restart markers you read, never as flags you write.
There is no organization block in Unity Pro to park startup logic in, and that is the real difference from STEP 7: the restart condition has to enter your ordinary task, and these two bits are the documented way in. On the Siemens side the same warm-restart job is what OB100 does, as this OB100 warm-restart initialization fix for SFC charts shows; and if the STEP 7 toolchain itself is the unfamiliar half, what STEP 7 is in a PLC project sorts out which variant you need.
Cold restart versus warm restart #
A cold restart starts execution over at the first instruction and returns application data to their configured values: process image, internal bits, timers and counters come back at their defaults, which for step bits means cleared. A warm restart is the path the CPU takes to resume after an interruption such as a power dip; it comes back with the data its retention kept, so a step bit can return as a 1 because the interrupted run left it that way. That asymmetry is the design problem: the same sequence can meet RUN either cleared or mid-step, and only initialization logic you wrote makes both cases land in the initial step. The vendor documentation underlines the rule with a runtime-modified setting: that value is not memorized and reverts to its configured value after a warm or a cold restart, so nothing survives a restart unless your design holds it.
| Restart the CPU took | System bit | What your step bits meet at RUN |
|---|---|---|
| Cold restart | %S0 | Configured values across the application, step bits cleared |
| Warm restart | %S1 | Data as retention kept them, step bits anywhere |
| Native Grafcet chart | INITCHART call | Chart activity back at its declared initial step |
The initialization rung in ladder #
Translated-Grafcet practice gives every step one internal BOOL bit, and the initialization rung then needs three things: contacts for %S0 and %S1 in parallel, a SET coil for the initial-step bit, and a RESET coil for every other step bit. Parallel is not a style choice - the CPU picks cold or warm on its own, and a rung keyed to one bit alone leaves the sequence uninitialized after the other restart.
Use SET and RESET coils rather than a plain coil driven by the restart bit: the CPU clears its restart bit on its own schedule, and a step bit tied to it as a coil would follow it back down and drop the sequence out of its initial step. Put the rung ahead of the transition equations so the first full scan evaluates transitions out of a correctly initialized state.
One safety point belongs on this rung: it returns the machine to its initial step at every cold and warm restart, so the initial step must be a state the machine can hold safely with the plant exactly as the power loss left it.
A native Grafcet chart initializes with INITCHART #
If you program the sequence in the Grafcet language itself, skip the rung entirely: the chart engine owns step activity, and SET or RESET coils on ladder copies of the steps never touch it. The vendor FAQ on initializing Grafcet steps under Unity Pro names the two supported tools, the INITCHART function and the SFCCNTRL control block. Drive INITCHART from the same %S0 OR %S1 condition you would have wired into the rung, and the chart re-enters the initial step it declares - the single initial step IEC 61131-3 requires every sequential function chart to define. The Grafcet notation underneath is standardized on its own as IEC 60848, so steps, transitions and the initial step mean the same thing on any compliant tool; the initialization call is what changes between platforms.
Keep first-scan logic out of function blocks #
The Unity Pro block library carries a restriction aimed squarely at startup logic: the blocks do not write their listed output pins during the cold or warm init scan. A function block you expect to evaluate on the restart cycle and hand the initialization onward through its outputs will not do it. Keep initialization as plain ladder or structured text driven by %S0 and %S1, because your own equations run through that scan; if a derived function block wraps the sequence, expose the init rung outside the block instead of hiding it inside.
Worked example: eight steps on %M10 through %M17 #
Take a sequence with eight steps mapped to internal BOOL bits %M10 through %M17, %M10 being the initial step. The rung carries 2 contact instructions (%S0 and %S1 in parallel), 1 SET (%M10) and 7 RESET (%M11 through %M17), 10 instructions in all. The arithmetic to re-run after any design change: RESET count = steps - 1 = 7, total instructions = steps + 2 = 10. Grow the sequence to 10 steps, %M10 through %M19, and the same rung becomes 12 instructions of which 9 are RESETs - the RESET list is the part people forget to extend.
In structured text the identical rung reads:
(* %M10..%M17: BOOL step bits, %M10 = initial step
%S0: cold restart bit, %S1: warm restart bit (set by the CPU) *)
IF %S0 OR %S1 THEN
%M10 := TRUE;
%M11 := FALSE;
%M12 := FALSE;
%M13 := FALSE;
%M14 := FALSE;
%M15 := FALSE;
%M16 := FALSE;
%M17 := FALSE;
END_IF;
The seven FALSE assignments are not decoration. After a cold restart the step bits arrive cleared anyway, but after a warm restart they can hold any pattern the interrupted run left, and a lone SET on %M10 without the seven resets can leave two steps logically active at once, both driving outputs. Every step bit that is not the initial one gets an explicit FALSE under the same restart condition.
Verify both restarts on the CPU #
Transfer the application, then put the CPU through each restart on purpose. For the cold case, order a cold start from the programming software - Unity Pro groups its cold-start and warm-start orders with the other PLC operating commands - and watch the animation table as RUN begins: %M10 reads 1 and %M11 through %M17 read 0. For the warm case, power the CPU down and up so it resumes across a real interruption, and check the same eight bits again. Judge the test by the step bits rather than by hunting the restart bit in the table, because %S0 and %S1 belong to the CPU and it takes them back when it has finished with them. Both restarts must produce the same eight-bit picture; if one does not, the rung is not wired to that restart.
The decision #
For each case:
- Sequence translated to ladder bits: one rung with %S0 and %S1 in parallel, SET on the initial-step bit, RESET on every other step bit, placed ahead of the transition logic - and the RESET list grows with the step count, one fewer than the number of steps.
- Native Grafcet chart: no rung at all; call INITCHART from the same %S0 OR %S1 condition, with SFCCNTRL as the block-based alternative the vendor FAQ names for the same job.
- First-scan logic anywhere in the project: keep it in your own equations, never in a function block, which writes no output pins in the cold or warm init scan.
- Process that must resume mid-sequence after a power dip: %S0 alone, and warm restarts carry the held position - the one deliberate exception.
- STOP-to-RUN: wire both bits so the rung fires whichever restart class the CPU assigns to that transition, and confirm it once against the eight-bit picture above.
Questions asked
Do %S0 and %S1 also fire on a STOP-to-RUN order?
They report a cold restart and a warm restart. Whether your CPU also classifies a plain STOP-to-RUN order as one of those two restarts is a per-CPU fact, not something the system-bit definitions settle. The wiring decision does not change: %S0 and %S1 in parallel fire the rung whichever restart the CPU takes, and one deliberate STOP-to-RUN test on your hardware shows whether the rung fires there too.
When should I use %S0 alone instead of %S0 and %S1 together?
When the process must resume mid-sequence after a power dip rather than return to the initial step. With %S1 wired in, every warm restart wipes the held step position and the sequence starts over even though the CPU preserved the data. Leave %S1 out, keep %S0 so a full cold restart still initializes, and make sure the transition logic can re-enter the initial step cleanly when operators want a deliberate reset.
Why can I not catch %S0 or %S1 at 1 in the animation table?
Because the CPU owns them: it raises the bit that matches the restart it performs and takes it back on its own schedule, usually before a table is open. Judge the test by the result instead - the initial-step bit at 1 and the seven other step bits at 0 as the CPU enters RUN is the proof that the matching restart fired your rung.
What happens if I skip the initialization logic and rely on the CPU startup alone?
After a cold restart every step bit sits at its configured value, so with no rung the sequence has no active step at all, takes no transitions and waits. After a warm restart it is worse: step bits return as retention left them, mid-step with outputs in their last commanded state. Exactly one active initial step is required at start, and only your %S0/%S1 rung or your INITCHART call puts it there on purpose.