A+ B+ B− A−: PLC programming exercise
Run two cylinders through the classic four move sequence.
On Start, run one cycle: A out, B out, B back, A back. Every move waits for the reed switch of the move before it.
No card. Nothing to pay. Nothing to cancel.
Official release: 5 December. Top the leaderboard on the day and win 3 months of Pro, plus 2 weeks of Pro to give a friend. 2nd place wins 4 weeks. 3rd place wins 2 weeks. Rules
- Every Coaching lesson, from zero
- Every mission and lesson, as you level up
- A practical test for every title, with a certificate
- Rewind any test, one scan at a time
- Worked solutions when you're stuck
- The code converter, as much as you like
PRO (needs Pro) missionOne cycle, in order
Test 1 of 4StartGreen Start pushbuttonOFFAirOnDump valve 0V2: ON lets the air in, OFF lets it outONExtendAValve 1V1, spring return: ON sends A out, OFF brings it backOFFRunLampOutputOFF- Level
- Applied
- Time
- About 30 min
- Reward
- +350 XP
- Rig
- 3D electro-pneumatics trainer
- Siemens editors
- Ladder (LAD), SCL
- Rockwell editors
- Ladder, Structured Text
- Beckhoff editors
- Structured Text
- Stage
- 33. Pneumatics lab: cylinders, valves and reed switches
A+ B+ B− A−: what your code must do
Think of A as a clamp and B as a punch. The clamp closes (A+), the punch goes out (B+), the punch comes back (B−), the clamp lets go (A−). Keep AirOn ON. Start begins one cycle when the air is up (AirOK) and both cylinders are back (A0 and B0). A goes out: ExtendA ON. At A1, B goes out: ExtendB ON. At B1, B comes back: ExtendB OFF and RetractB ON. At B0, A comes back: ExtendA OFF and RetractB OFF. At A0 the cycle is over. B's valve has two solenoids and remembers its last position: energise ExtendB only to send B out and RetractB only to bring it back, never both together. RunLamp is ON for the whole cycle. One press is one cycle.
- Start
- Needs AirOK, A0 and B0. One press, one cycle.
- Order
- A out, B out, B back, A back.
- Proof
- Each move waits for the switch before it.
- Valve 2V1
- ExtendB and RetractB never ON together.
- How it's checked
- The checks press Start and watch the trainer itself: its reed switches, StrokesA and StrokesB (strokes that reached the end) and BothSolenoids (times both of 2V1's solenoids were ON together).
A+ B+ B− A−: inputs and outputs
Your program reads 6 inputs and sets 5 outputs. 2 more inputs drive the simulation or show readings, for you to test with. The names are the same in every maker’s editor.
A+ B+ B− A−: what the tests check
- The order is A out, B out, B back, A back.
- B never leaves until A is fully out, however slow A is.
- A stays out until B is fully back, however slow B is.
- ExtendB and RetractB are never ON together.
- One press gives one cycle, and both cylinders finish at home.
- Try it Use the buttons below the model and watch the rig respond.
- Test solution Every check runs on your code in one press.
- Rewind PRO (needs Pro) If one fails, step back through it one scan at a time to see why.
Stuck on this mission? Ask the members in the Locker Room.
Where you’d see this on site
Clamp and punch, clamp and drill, grip and lift: the same four moves run in presses, drilling jigs and assembly stations everywhere.
If the punch fires before the clamp has closed, the part moves and is scrap. If the clamp lets go while the punch is still in the part, something bends or breaks.
Most machines that clamp, push, lift or eject do it with air cylinders. A solenoid valve sends air to one side of the piston and lets it out of the other, and a small switch on the barrel tells the controller when the piston has arrived. Colleges teach it on a board like this one, because the same few parts make up almost every pneumatic machine.
- Air supplyFiltered, set to 6 bar
- ValvesOne 5/2 valve a cylinder
- CylindersOut and back on airYou are here
- Reed switchesProve each stroke
On a real site: places, parts and safety
- Assembly machines that clamp a part, then press or drill it
- Packing lines that push, lift and eject cartons
- College and apprentice training workshops
Compressed air is stored energy. Shut the isolator and let the air out before touching pipework: a hose that comes off under pressure whips.
Letting the air out isn't always the safe state. A cylinder holding a load upright drops when the air goes, so real machines are assessed one cylinder at a time.
The sizes, timings and cutaways are teaching choices, not a drawing of any one real installation.
Next on the road
- One car at a timeRaise the arm for a ticket, lower it once the car is clear.Applied · 20 min · +350 XP
- Tall boxes off the lineRemember a box's height and push it at the right moment.Applied · 25 min · +300 XP
- Both hands, every timeWrite two-hand control for a press, with an interlocked guard.Applied · 30 min · +400 XP
- Stop before the palletOpen and close a door that reverses for obstructions.Applied · 20 min · +400 XP