02 · Start, stop and seal-in

Practice module 2 of 5 · Ladder + Siemens SCL

Hold a request. Keep stop in control.

Build memory that still obeys a normal stop. Catch the bypass and held-start traps.

20–25 minutesWritten predictions + self-checkNo account required

02 / Memory with explicit recovery

What you will be able to prove

  • Build one-writer start/stop memory and explain its reset priority.
  • Prove held-start behavior instead of assuming it is safe.
  • Specify startup and rearming requirements separately.

Before this module: Module 01: series/parallel logic and scan order.
Core: 20–25 min · Applied lab: 25–35 min. These are planning estimates; work at your pace.

Your deliverable: A state trace, a restart-behavior specification and a tested one-writer rung.

Predict → trace → challenge → explain. The written labs are self-assessed. Use paper or your own compatible simulation. The browser workshop supports a limited training subset; these SCL excerpts are not import-ready or TIA-compiled blocks.

Your next step

Start small. Build from there.

New to this topic? Follow one press and release of Start. Watch how Run remembers the request, then check what StopOK does.

Optional hint: the idea in plain words

A seal-in keeps a request active after Start is released. Read the previous Run value before calculating the new value.

Work in one language first, then compare the other. After the prediction, open step 3 for guidance or step 4 for an independent challenge.

Before you reveal: write your answer and one sentence explaining it. Use a notebook or your own editor. These pages do not execute code, auto-grade answers, or save progress.

01 · WORKED EXAMPLE

A momentary start needs memory.

BOOL inputs: Start and StopOK. StopOK=TRUE means no normal stop is requested. Static BOOL Run, initially FALSE. BOOL output MotorCmd. Use one write to Run and call the block once every scan.

Ladder

--[ StopOK ]--+--[ Start ]--+--( Run )
              |             |
              +--[ Run ]----+

--[ Run ]--------------------( MotorCmd )
LAD network notation; contacts test Boolean values.

SCL

#Run := #StopOK AND (#Start OR #Run);
#MotorCmd := #Run;
SCL function-block body excerpt.

The right-hand Run is its current stored value before this assignment. A Start pulse makes Run TRUE; on the next scan, the Run branch holds it. StopOK=FALSE breaks the entire expression even if Start is TRUE. The following output network reads the updated Run.

02 · PREDICT

Trace the latch, including the awkward case.

Begin with Run=0. Each row is the next scan. Do not reset Run between rows.

Trace the stored Run value
ScanStartStopOKRun after scan?
111?
201?
310?
401?
511?
610?
711?
Reveal the answer and why

Run: 1, 1, 0, 0, 1, 0, 1. Scan 3 proves stop priority. Scan 4 proves that releasing stop with Start=0 does not restart. Scan 7 exposes a limitation: a held Start restarts this simple circuit when StopOK returns. If a fresh deliberate press is required, add a properly designed edge/rearm condition; do not claim the simple seal-in guarantees it.

03 · FINISH THE SOLUTIONReplace StopOK with StopRequest.

Now StopRequest=TRUE means the operator asks to stop. Keep the same behavior. Complete both the contact type and the SCL condition.

Ladder: [ or / ? StopRequest ] in series
        with the complete Start/Run branch.

#Run := ______ AND (#Start OR #Run);
Guided exercise: reason from the tag meaning.
Check the contact and expression

Use a negated [/StopRequest] software test and NOT #StopRequest. The required truth value determines the contact, not the button’s physical appearance or name.

04 · INDEPENDENT VARIANTAdd an overload trip.

Extend the original StopOK circuit with BOOL input OverloadOK. If either permit is FALSE, clear Run. When both return TRUE, Run must stay FALSE unless Start is TRUE. Draw ladder and SCL. Test all permits healthy, each permit dropping alone, both dropping, simultaneous Start/stop, and held Start during recovery.

Compare your independent solution

Ladder

--[ StopOK ]--[ OverloadOK ]--+--[ Start ]--+--( Run )
                              |             |
                              +--[ Run ]----+

--[ Run ]------------------------------( MotorCmd )
LAD network notation; contacts test Boolean values.

SCL

#Run := #StopOK AND #OverloadOK
        AND (#Start OR #Run);
#MotorCmd := #Run;
SCL function-block body excerpt.

Either FALSE permit forces Run and MotorCmd to 0 in that call. Restored permits with Start=0 keep them at 0. Restored permits with Start held at 1 restart: this is the same known limitation, not a fresh-start interlock.

05 · TROUBLESHOOTFind the path that ignores stop.
#Run := (#StopOK AND #Start) OR #Run;
Faulty seal-in expression.

Run is already TRUE. StopOK becomes FALSE and Start is FALSE. Predict Run, then fix the logic.

Reveal the answer and why

Run stays TRUE because the final OR Run bypasses StopOK. Move the stop condition outside the whole branch: #Run := #StopOK AND (#Start OR #Run);. In ladder, put StopOK before the branch split or repeat it in every branch. Do not add a second Run coil elsewhere to fight the first; use one clearly defined writer.

APPLIED LAB / BUILD • INJECT • PROVE

Applied lab: require release before a new start

Improve the ordinary stop example for a virtual motor. After startup or loss of either permit, a held Start must not restart the motor. The operator must release Start while both permits are healthy, then press it again. This is an educational process-control rule, not a safety-rated restart function.

BOOL inputs: Start, StopOK, OverloadOK. Static BOOL memory: Run=FALSE, Armed=FALSE. BOOL output: MotorCmd. Each has one writer. Execute this body once per cyclic call.

Try your own rung first, then compare the ordered SCL design
IF NOT (#StopOK AND #OverloadOK) THEN
  #Run := FALSE;
  #Armed := FALSE;
ELSIF NOT #Start THEN
  #Armed := TRUE;
ELSIF #Armed THEN
  #Run := TRUE;
  #Armed := FALSE;
END_IF;
#MotorCmd := #Run;

Run intentionally retains its value when healthy and Start is released. Armed is consumed by an accepted press. In Ladder, implement the same priority and memory behavior; do not scatter competing Run coils through the program. Initialize both memory bits FALSE for this exercise. Actual startup/retentivity configuration must be designed separately.

Acceptance checks starting with Run=0, Armed=0
TestRequired evidence
Healthy startup with Start heldMotor remains off until release and new press.
Release, press, releaseRun becomes 1 on press and remains 1 after release.
Start and stop togetherStop wins; Run=0 and Armed=0.
Restore permits while Start stays heldNo restart. A release while healthy rearms the next press.
OverloadOK drops independentlySame clear-and-rearm behavior as StopOK dropping.
Repeat the complete cycle three timesIdentical behavior, not only a successful first cycle.

Fault ticket: it restarts when the permit returns

Compare the simple seal-in above with this new requirement. A working latch is not proof of compliant recovery behavior. Record Start, both permits, Armed and Run on the scan before the stop, during the stop and after recovery. Fix the requirement mismatch, not merely the symptom.

Move on when: you can solve the independent variant in both representations, explain the edge cases, and fix any error without copying. A correct guess is a review item.