Worksheet: PLC timers and counters
Name:Class:Date:
Material: the free PLC timer and counter simulator at examrobotic.com (examrobotic.com/en/tools/plc-timer-counter-simulator). Time: about 40 minutes.
Aim: tell TON, TOF, TP and TONR apart by their timing diagrams, understand that a counter counts edges and choose the right block for each application.
1. Timers
- TON with PT = 3 s. Hold IN for 2 s and let go. Does Q turn on? What happens to ET when you let go?
- TON with PT = 3 s. Hold IN for 6 s. At what second does Q turn on, and when does it turn off?
- TOF with PT = 3 s. Give IN a short tap. How long is Q on?
- TP with PT = 3 s. Give IN a very short tap, then hold IN for 8 s. How long does Q last each time?
- TONR with PT = 5 s. Hold IN for 2 s, let go, and repeat twice more. When does Q turn on? What is needed to start again?
2. Draw the timing diagram
Input IN is 1 from 0 to 2 s and from 4 to 10 s. Draw Q for each block with PT = 3 s. Then check it in the simulator.
| Block | Q (from 0 to 14 s) |
|---|---|
| TON | |
| TOF | |
| TP |
3. Counters
- CTU with PV = 5. Press CU five times. On which press does Q turn on? If you hold CU down for a long time, how much does CV go up?
- CTD with PV = 4. Before touching anything, what is Q? Why? Press LD and count until Q turns on.
4. Which block would you use?
- A fan must keep running for 2 minutes after the motor it cools stops.
- A part only counts as present if the sensor sees it for at least 0.5 s without a break.
- A solenoid valve must blow air for 300 ms every time a part arrives.
- Flag pump maintenance every 500 running hours.
- Close a box once 12 parts have gone in.
Answers (for the teacher)
- No. ET rises to 2 s and goes back to 0 when IN is released.
- Q turns on at 3 s and off when IN is released, at 6 s.
- Q lasts as long as the tap plus 3 s.
- 3 s both times: the pulse does not depend on how long IN lasts.
- At 5 s accumulated, that is, during the third press (after 1 s of it). Only R resets ET.
Timing diagram: TON: Q is 1 from 7 to 10 s (the first 2 s pulse never reaches PT). TOF: Q is 1 from 0 to 13 s (the gap from 2 to 4 s is shorter than PT, and after 10 s it stays on 3 s more). TP: Q is 1 from 0 to 3 s and from 4 to 7 s.
- On the fifth. It only goes up by 1: a counter counts edges, not time.
- Q = 1, because CV is 0 at start-up. After LD, CV = 4 and 4 presses of CD are needed.
- TOF.
- TON (filter).
- TP.
- TONR (or an hour counter built with a TONR).
- CTU with PV = 12 (or a CTD loaded with 12).