A car park counter
Count cars at an entry and an exit with edges, keep the count between 0 and the number of places, show FREE or FULL, and open the barrier for a waiting car only when there is room, with a pulse timer.
You need IF, edges and timers: chapters 1–8 of PLC from zero teach them.
Chapters
How the course works
Structured Text (IEC 61131-3), the language used by industrial engineering environments such as TwinCAT 3 and CODESYS. PLC Studio and the Trainer T8 are VisoTrain’s own training tools. TwinCAT is a registered trademark of Beckhoff Automation GmbH. CODESYS is a registered trademark of CODESYS GmbH. VisoTrain is not affiliated with or endorsed by them.
Syllabus
Level: Beginner+ · Time: about 2 hours · You need: IF, edges and timers (chapters 1–8 of PLC from zero).
You learn: edge detection (R_TRIG), counting with limits, status displays, a pulse timer (TP).
Chapter 1: Count the cars
- A car park in the real world: Say what a car park controller counts, and with which signals.
- Count each car once: Count with rising edges, and show the number.
- Lab in PLC Studio: program this part and pass the automatic tests.
Chapter 2: Full or free
- Limits: FREE or FULL: Keep the count between 0 and 8, and drive the sign.
- Lab in PLC Studio: program this part and pass the automatic tests.
Chapter 3: The entry barrier
- The barrier: a pulse timer: Open the barrier for 4 s for a waiting car, only when there is room.
- Lab in PLC Studio: program this part and pass the automatic tests.
Frequently asked questions
Why does a counter need an edge?
A sensor stays on for many PLC cycles while a car passes. An edge counts only the moment it switches on, so one car counts once.