Count bottles as they leave
Count each bottle as it clears the sensor, not as it arrives.
Turn BottlePulse ON for one when BottlePresent goes from ON to OFF. That change is a : the moment a bottle leaves the . Count each pulse into Pieces. At three or more, turn Done ON and ConveyorOn OFF. Reset clears Pieces and Done at once, but must not wipe the sensor's last reading.
Free, with no sign-up. Create a free account to keep your progress on every computer.

Count departures, not arrivals or clear scans
Test 1 of 3BottlePresentBottle at sensorOFFPiecesBottles that have left3 bottlesBottlePulseBottle-leaving pulseOFFDoneCount completeON- Level
- Applied
- Time
- About 10 min
- Reward
- +150 XP
- Rig
- 3D filling line
- Siemens editors
- SCL, LAD
- Rockwell editors
- Structured Text, Ladder
- Course stage
- 5. Count an event once
What the tests check
- BottlePulse is ON for one scan, and only when the sensor goes from ON to OFF.
- Pieces goes up by one for each bottle that leaves. At 3 or more, Done turns ConveyorOn OFF.
- Reset wins over counting, even on the scan a bottle leaves. Letting go of Reset adds no extra pulse.
- Try it Use the buttons below the model and watch the rig respond.
- Test solution Every check runs on your code in one press.
- Replay If one fails, step through it one scan at a time to see why.
Where you’d see this on site
A packing line counts each bottle once it has fully passed a light sensor. A bottle still blocking the beam has not left yet.
Counting bottles as they leave proves they have cleared the station. Counting on arrival could include a bottle still stuck at the sensor.
At a soft-drinks factory, empty bottles arrive on a moving belt. A sensor tells the controller when a bottle is under the filling nozzle. The valve opens, fills the bottle, then closes before the belt moves again. Caps and labels go on before the bottles are packed.
- Empty bottlesThe belt brings them to the nozzle
- Fill each bottleStop it, fill it, then let it moveYou are here
- Add caps and labelsSeal the drink and name the product
- Pack the bottlesPut finished bottles into boxes
On a real site: places, parts and safety
- Soft-drinks factory — filling bottles without spills
- Dairy — putting milk into bottles
- Cleaning-products factory — measuring liquid into containers
- Food packaging line — counting bottles before packing
If the filling valve opens without a bottle under it, liquid spills onto the belt. If the line jams, the valve must not keep filling.
Real conveyors need guards. The power must be safely locked off before anyone clears a blockage. The Stop input here is not an emergency stop.
The sizes, timings and cutaways are teaching choices, not a drawing of any one real installation.
Next in the course
- Give the signal meaningTurn raw sensor counts into a percentage.Applied · 12 min · +200 XP
- Stop the short cyclingTwo switch points. A calmer pump.Applied · 12 min · +200 XP
- The pump chattersLook at the trend before you change the 30% or 70% limits.Applied · 12 min · +200 XP
- A command is not feedbackCheck that the valve really opened.Applied · 12 min · +200 XP