Beginner 12 — Carton line (mini-project)
Ready to build this?
Sign up free — no credit card required. This scenario is included in the free tier.
Sign up to play this scenario →Already have an account? Log in
Not ready to sign up? Run a live lab now — no signup →
Briefing
Time to build a small project on your own. This carton line has a START button, a STOP button, a photo-eye (BOX_EYE) that pulses once per box, and a CNT_RESET button. Here is how it must behave. Press START and the conveyor waits 2 seconds before MOTOR comes on (the warning pause before a machine moves). Each box that passes BOX_EYE adds one to the count. After five boxes the carton is full: CARTON_FULL lights and the conveyor stops. STOP stops the line at any time, even during the 2 second wait. CNT_RESET clears the count so the next carton can start. The counter and the CARTON_FULL lamp are already built. Two parts of the starter are declared for you: RUN_REQ, a memory bit for "the line was asked to run", and START_DLY, an on-delay timer. Everything you need you have already used in an earlier lab.
Objectives
- START → MOTOR stays off for about 2 seconds, then runs by itself
- STOP stops the line at any time, including during the 2 second wait
- Five BOX_EYE pulses → CARTON_FULL on and MOTOR off
- CNT_RESET clears the carton, then START runs the line again
Hints
- Work in three small steps: (1) remember that the line was asked to run, (2) wait 2 seconds, (3) let the full carton and STOP end the run. Check after each one.
- START is only a pulse, so RUN_REQ must hold itself on once START is released, the same idea as the seal-in in Beginner 07. STOP must be able to break that hold.
- The timer START_DLY should run while RUN_REQ is on. MOTOR then follows the timer's done output (START_DLY.Q) instead of START, which is what creates the 2 second wait.
- A full carton must end the run too: bring the counter's done output (BOX_CNT.Q) into the rung that holds RUN_REQ on, as a slashed contact, so a full carton cannot restart until CNT_RESET clears it. Equivalent designs (Set/Reset coils) are accepted.
I/O Table
Inputs
STARTMomentary start push-button (NO)
BOOL · %I0.0
STOPMomentary stop push-button
BOOL · %I0.1
BOX_EYEPhoto-eye — pulses once per box
BOOL · %I0.2
CNT_RESETCounter reset push-button (NO)
BOOL · %I0.3
Outputs
MOTORConveyor motor contactor
BOOL · %Q0.0
CARTON_FULLCarton-full indicator lamp
BOOL · %Q0.1
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
- #1START → MOTOR off for 0.5 s, then on after the delay
A START pulse starts a 2 second wait; MOTOR comes on only when it ends
- #2STOP while running → MOTOR off and stays off
STOP ends the run and nothing restarts it
- #3STOP during the 2 s wait → MOTOR never starts
STOP cancels a start that has not finished its delay
- #4Five boxes → CARTON_FULL on, MOTOR off
The counter's done output lights the lamp and ends the run
- #5Three boxes → MOTOR still on, CARTON_FULL off
Fewer than five boxes does not end the run
- #6CNT_RESET after a full carton → lamp off, START runs again
A new carton can begin: reset clears the count, START restarts after the delay
Related scenarios
Ready to build this?
Sign up free — no credit card required. This scenario is included in the free tier.
Sign up to play this scenario →Already have an account? Log in
Not ready to sign up? Run a live lab now — no signup →