Lesson 8 — Delayed-On (TON)
Ready to build this?
Sign up free — no credit card required. This scenario requires the Pro plan.
Sign up to play this scenario →Already have an account? Log in
Briefing
TON (Timer ON-delay) starts counting when its IN input is true. After the preset time PT elapses, the Q output goes true. If IN goes false before PT, the timer resets. Classic use: a warning lamp that turns on 3 seconds after a conveyor enable.
Objectives
- WARN_LAMP turns on 3 seconds after ENABLE goes true
- WARN_LAMP turns off immediately if ENABLE goes false before 3 s
Hints
- Declare: T_WARN : TON; Call it: T_WARN(IN := ENABLE, PT := T#3s);
- Use T_WARN.Q to drive the lamp: | T_WARN.Q | := WARN_LAMP ;
I/O Table
Inputs
ENABLEConveyor enable input
BOOL · %I0.0
Outputs
WARN_LAMPWarning lamp output
BOOL · %Q0.0
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
- #1Lamp off during 3s delay
ENABLE true, but lamp should still be off before 3 s elapses
- #2Lamp on after 3.2 s
After 3.2 s with ENABLE held, WARN_LAMP must be true
- #3Timer resets when ENABLE goes false
Remove ENABLE before 3 s, wait again — lamp stays off
Related scenarios
Ready to build this?
Sign up free — no credit card required. This scenario requires the Pro plan.
Sign up to play this scenario →Already have an account? Log in