PLC Programming SAPLC ProgrammingSOUTH AFRICA
Menu

exercises · South Africa

PLC Exercises for Beginners: Start-Stop Seal-In

Build a start-stop seal-in PLC exercise with clear input meanings, worked test sequences, fault experiments and a fresh-start extension for home practice.

Illustrated study desk for plc programming exercises for beginners with abstract ladder contacts and a controller
Conceptual learning illustration; not a validated circuit, program screenshot or physical test result.

A start-stop seal-in is a useful first stateful exercise because the current output depends on both today's inputs and the previous result. These PLC programming exercises for beginners use a virtual run indicator to make that dependency visible. You will predict a sequence, build the Boolean rule, compare observations, then change the specification to require a fresh Start action after an interruption.

The distinction matters. A basic seal-in expression does not by itself guarantee a particular restart policy. Nor does a green software indicator prove that a motor is running. This lesson uses named Boolean variables and discrete evaluation steps; it provides no physical wiring assignment or commissioned machine design. Keep your project disconnected from equipment while exploring the cases.

If contacts and coils are unfamiliar, work through ladder logic basics first. If you want to compare this exercise with timers, counters and sequences, the PLC programming examples collection explains the wider progression. Here the objective is narrower: explain exactly why a remembered run request persists, clears or starts again.

The exercise specification

Imagine a training screen with Start, Stop and Permission controls and a single Run indicator. The screen is fictional; the controls represent program values rather than a particular manufacturer's terminals. Write these requirements into your notebook before opening an editor:

  1. Begin each declared fresh exercise with Run false.
  2. With Permission true and Stop not requested, Start sets Run true.
  3. Releasing Start retains Run while the other conditions remain satisfied.
  4. A Stop request clears Run at the next model evaluation, including when Start is also true.
  5. Permission false clears Run at the next evaluation.
  6. The basic version accepts a Start level whenever Permission is true and Stop is false.

Requirement six deliberately allows a held Start to act again after the blocking condition disappears. Do not quietly replace that requirement with “press Start again”. Later you will write a second version for that different behaviour. Keeping the two specifications separate makes the comparison testable.

There is no elapsed-time promise here. One evaluation might be a manual step in a learning tool or one invocation of a routine in a configured runtime. Record which one you used. Avoid labelling an observed step as a millisecond unless the relevant timing evidence supports it.

Define every variable before drawing a rung

VariableType in this exerciseMeaning when true
StartRequestBoolean input valueStart is currently requested
StopRequestBoolean input valueStop is currently requested
PermissionBoolean input valueThe fictional exercise permits Run
RunBoolean stateThe virtual run request is active
RunIndicatorBoolean resultThe displayed command follows the newly calculated Run

These definitions avoid the ambiguous name StopPB. That name alone does not tell a reader whether true means pressed, released, electrically energised or decoded as healthy. Here true unequivocally means Stop requested. A contact that examines NOT StopRequest therefore passes only when that request is false.

If another exercise provides StopHealthy, with true meaning no stop request, translate the input meaning explicitly. Under the simplified assumption that these are exact complements, StopHealthy = NOT StopRequest. That is a naming and interpretation exercise. It does not demonstrate broken-wire detection, field-device condition or a safety function.

Use symbolic variables in your first project. Physical addresses are controller-specific configuration details; substituting an address from a different family is not a complete migration procedure. The Siemens learning guide and Allen-Bradley learning guide explain why you should identify the actual software and controller family before following a vendor course.

Conceptual sensor, controller and conveyor illustration for distinguishing signals from program values
Conceptual learning illustration; not a validated circuit, program screenshot or physical test result.

Derive the basic seal-in rule

The expression is:

NextRun = Permission AND NOT StopRequest AND (StartRequest OR PreviousRun)
Run = NextRun
RunIndicator = NextRun

The parenthesised group has two alternatives. Start can establish the request, or the previous Run state can preserve it. Permission and the absence of Stop apply to the whole group. That arrangement gives Stop priority over both the start path and the holding path.

To sketch ladder, place the Permission condition and the not-Stop condition in series with a parallel group containing Start and the Run holding contact. The two parallel paths rejoin before the Run coil. There must be no alternate holding path around Permission or the not-Stop condition. Check the complete path from the left rail to the coil, rather than relying on the visual appearance of a familiar symbol.

Start by testing the expression without the holding alternative. With only Start in that group, releasing Start clears Run. Then add the previous Run alternative and repeat the same sequence. This small comparison isolates what the seal-in contributes. Changing several contacts and adding a lamp simultaneously makes a first failure harder to explain.

For this lesson, there is one writer to Run. Another assignment later in the same routine could replace the result you just inspected. Rockwell's Output Energize instruction reference documents rung-condition assignment and warns about overwritten operands for the listed controllers. Consult the reference for your chosen instruction rather than assuming all coil types have the same behaviour.

Work through the complete basic trace

Initial Run is false. Apply one row, evaluate once, record the result, and only then apply the next row. Here 1 means true and 0 means false. The Expected Run column is the newly calculated value; it becomes Previous Run on the following row.

StepStartStopPermissionExpected RunReason
10010No start and nothing held
21011Start establishes the request
30011Previous Run holds it
41110Stop wins over Start
50010Releasing Stop alone does not start
61011A new Start level is accepted
71000Permission loss clears the request
81011Held Start is accepted on recovery
90011Holding continues after release
100110Stop clears the held state

Step eight is the important counterexample to a blanket “no automatic restart” description. Permission returns while Start remains true, so the specified basic rule returns true. A false initial Run value cannot prevent this when the Start level is already true.

Do not erase this row because the result surprises you. Keep the prediction, the actual result and the expression in your record. If your program stays false instead, investigate whether the editor has edge-triggered controls, an additional startup condition or another writer. A difference can reveal an assumption in the tool as well as an error in your implementation.

Illustrated learning desk with a notebook and laptop for planning Boolean logic test cases
Conceptual learning illustration; not a validated circuit, program screenshot or physical test result.

A structured text sketch and its limits

For a runtime where these Boolean assignments execute in the displayed order, the basic sketch is:

Run := Permission AND NOT StopRequest AND (StartRequest OR Run);
RunIndicator := Run;

The right-hand side of the first assignment reads the prior value of Run; the assignment then stores the new result. The following line reads that new result. Declare the variables and initial state in the syntax and configuration required by your environment. This snippet has not been presented as a compiled project for every IEC development system.

A clearer paper model can use separate PreviousRun and NextRun columns, as the trace does. That prevents you from accidentally mixing the old and new values when explaining one evaluation. Once the sequence is understood, compare your actual ladder and structured text versions using the same inputs and starting state.

If you move the indicator assignment before the Run assignment, a sequential immediate-assignment model can display the old Run value for that evaluation. The ladder logic simulator guide works through assignment-order examples in more detail. In this exercise keep indication after the state update and label it as command indication, not motor feedback.

Change the requirement: require a fresh Start edge

Now create a separate project revision. The revised requirement is: after Permission is lost or Stop is requested, release Start and then make a new false-to-true Start transition while the exercise is permitted. A Start transition during a blocked evaluation must not be saved for later acceptance.

For this specific model, remember the previous Start input as well as Run:

RisingStart = StartRequest AND NOT PreviousStart
NextRun = Permission AND NOT StopRequest AND (RisingStart OR PreviousRun)
PreviousStart = StartRequest
Run = NextRun
RunIndicator = NextRun

Update PreviousStart on every evaluation, including blocked evaluations. Otherwise a Start held during a stop could appear to be a new edge when the blocking condition clears. This ordering is part of the model, not a cosmetic choice.

At the beginning of a newly opened exercise, sample the current Start value into PreviousStart and set Run false before normal evaluations. If Start is already held, that initial sample prevents treating it as a fresh edge. This is an explicit initialisation policy for the model; translating it into a controller's startup routine requires checking that controller's execution and retention rules.

For the following sequence, initialise both Start and PreviousStart false and Run false:

StepStartStopPermissionExpected RunWhat the case checks
11011A permitted rising edge starts
21000Permission loss clears Run
31010A held input is not a new edge
40010Release prepares another edge
51011A fresh permitted edge starts
61110Stop still has priority
71010Releasing Stop does not invent an edge
80010Start is released again
91011Another fresh edge is accepted

Also test a rising Start while Permission is false. It must leave Run false, update PreviousStart true and remain false when Permission subsequently returns with Start still held. These two evaluations distinguish the stated policy from an implementation that accidentally queues blocked requests.

This extension is still a software learning model. It is not a restart interlock design for a real machine, an emergency-stop implementation or a validation of any safety performance level. Its educational value is that a requirement becomes a measurable state transition.

Two illustrated learners reviewing a controller example beside a guarded training conveyor
Conceptual learning illustration; not a validated circuit, program screenshot or physical test result.

Faults to introduce deliberately in your virtual copy

Save a known version, then change one thing at a time. Predict which row will fail before running the changed program. Restore the known version between experiments so one error does not hide another.

Put the holding path outside Stop. In expression form, change the rule to (Permission AND NOT StopRequest AND StartRequest) OR PreviousRun. Once Run is true, Stop cannot clear the remembered state through this expression. Step four of the basic trace exposes the error. Explain the Boolean reason rather than merely saying the rung looks wrong.

Remove the holding path. Replace the final group with StartRequest alone. Step three now clears Run. This failure identifies the missing memory behaviour without involving timers or input mapping.

Invert the wrong meaning. Use StopRequest where the rule requires its negation. Starting with Stop false can then fail. Review the variable definition before changing a physical-contact label; a software Boolean name and an electrical contact drawing describe different parts of a system.

Freeze PreviousStart while blocked. In the edge version, skip updating it when Permission is false. Apply a rising Start while blocked and then restore Permission with Start held. The altered model can accept a delayed edge. Keep this two-step counterexample alongside the corrected trace.

Give Run a second writer. In a disconnected scratch project, add a later assignment that clears Run. Observe whether your tool shows the intermediate value or the final value. Remove that assignment and record where the observation was taken. This exercise teaches you to ask which value a watch display actually represents.

Record evidence that another learner can reproduce

A useful submission includes the requirement revision, variable definitions, initial values, program view, input sequence and actual result after each evaluation. Add the tool name and version where available. If a control behaves as a pulse instead of a held Boolean level, document that difference and adjust the test method explicitly.

Keep basic seal-in results separate from fresh-edge results. “All tests passed” means little if the reader cannot tell which policy you implemented. Include at least one deliberately failed version and its smallest counterexample. That shows how you diagnosed a condition instead of collecting only successful screenshots.

For South African evening or distance learners, this work can be split across sessions: predict the basic trace, implement it, investigate a fault, then test the changed restart requirement. There is no promised time to competence. Save both the program and your written results; one does not necessarily preserve the other. The learn PLC at home guide covers a broader practice routine.

For a Johannesburg classroom, Durban apprenticeship study group or Cape Town college project, learners can exchange trace sheets and reproduce each other's results. Those are suggested study settings, not claims about local premises, accreditation or available bookings. The engineering student guide explains how to turn a small reproducible exercise into a clearly bounded portfolio entry.

Illustrated learner comparing program observations with a guarded conveyor training model
Conceptual learning illustration; not a validated circuit, program screenshot or physical test result.

Choose the next exercise from the behaviour you need

Move to jog and latched run practice when you can explain why a held command and a remembered command differ. Before combining them, decide whether Jog is permitted during latched operation and identify the single rule that writes the result. Do not assume two separate coils automatically produce a clear priority.

Choose timer and flashing lamp practice when the next question is about elapsed duration. Declare the timer model and reset conditions before expecting a visual blink to prove timing accuracy. For the larger learning path, online PLC training options explain how exercises fit into a course and what to check before purchasing.

You can inspect the seal-in scenario preview and compare its published objective with this lesson. Check the current access options and supported controls on the destination. Do not assume this article's two revisions, trace tables or fault experiments are automatically graded by that scenario.

If your main difficulty is seeing when values change, review the scan-cycle highlighting feature. Evaluate whether its presentation helps you follow the particular program you are studying. Product access and saved progress are separate questions from whether your written predictions are correct.

Questions beginners ask about seal-in logic

Why does Run stay true after Start is released?

The previous Run value satisfies the holding alternative. Permission must still be true and Stop false. State persists because the rule reads its previous result; the input is not secretly being held by the diagram.

Does a seal-in always reset after a power interruption?

You cannot infer complete restart behaviour from the rung shape alone. Initial values, startup execution, retention, input levels and other assignments matter. In this paper exercise initial Run is explicitly false, yet the basic version starts when Start is already true and the permitting conditions hold.

Are a holding contact and a SET instruction interchangeable?

Do not substitute them without defining the reset and startup behaviour. Different instruction choices and runtime configurations can change when state is written or retained. Compare specified behaviour with test cases, then consult the actual instruction documentation.

Can I use this as a motor starter wiring diagram?

No. The variables are fictional software values and no physical design has been supplied. A command indicator provides no evidence of contactor position, rotation or protective-device performance. Keep that distinction in the title and notes of any submitted project.

Why does the fresh-edge version ignore Start after Permission returns?

It has already recorded the held Start value. Returning Permission does not create a false-to-true transition. Release Start, evaluate that release, and then apply a new permitted rising edge.

Can I complete this without buying a PLC?

The prediction tables and Boolean model require no controller. A suitable simulation environment can help you observe an implementation. CODESYS documents that its simulation mode differs from physical operation: I/O channels and fieldbus communication are not executed as real hardware communication in that mode. Check your chosen tool's corresponding limits and access conditions.

Conceptual PLC learning portfolio with a process sketch, test notes and a laptop showing logic
Conceptual learning illustration; not a validated circuit, program screenshot or physical test result.

What should I ask an AI tutor about this exercise?

Supply the exact expression, initial state and trace row. Ask, “With previous Run true, Start true, Stop true and Permission true, what is NextRun, and which condition decides it?” Then compare the answer with the defined rule. A fluent general explanation cannot replace evaluation of your actual variables.

For the extension, ask the tutor to compare updating PreviousStart on every evaluation with updating it only while permitted. Request a two-step counterexample and calculate it yourself. That turns a broad question about PLC programming into a checkable discussion about one precise state transition.

By PLC Programming SA · Last updated 2026-09-11