Review the AI: One bottle, one count
Check a bottle that stays under the sensor.
An assistant wrote this. It looks right. Test it on the rig before it goes to site. Press Test solution before editing. Run the conveyor (ConveyorOn) until the BottlePresent has seen three bottles. Then turn Done ON and ConveyorOn OFF. Pressing Reset clears the count and Done, so the conveyor runs again.
Free, with no sign-up. Create a free account to keep your progress on every computer.

Held sensor is one bottle
Test 1 of 3BottlePresentBottle at sensorONResetInputOFFDoneCount completeOFF- Level
- Applied
- Time
- About 8 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
- A bottle that sits in front of the sensor counts as one.
- The third bottle turns Done ON and stops the conveyor.
- Reset turns Done OFF and sets the count back to zero.
- 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
An engineer on a drinks line checks bottle-counting code written by an AI assistant. They leave one bottle under the sensor and watch the total.
Code that counts scans instead of bottles can stop the line before a group is complete. Code that looks right still needs testing on the rig.
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