Pro
10 min
Lesson 9 — Delayed-Off (TOF)
curriculumlessontimerTOF
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
TOF (Timer OFF-delay) energises its Q output immediately when IN goes true, and keeps it on for PT after IN goes false. Classic application: an automatic door that opens when someone is present and stays open 5 seconds after they leave.
Objectives
- DOOR_OPEN goes true immediately when OCCUPANCY is true
- DOOR_OPEN stays true for 5 s after OCCUPANCY goes false
- DOOR_OPEN goes false 5 s after OCCUPANCY clears
Hints
- Declare: T_DOOR : TOF; Call it: T_DOOR(IN := OCCUPANCY, PT := T#5s);
- TOF.Q is true while IN is true AND for PT after IN falls.
I/O Table
Inputs
OCCUPANCYOccupancy sensor
BOOL · %I0.0
Outputs
DOOR_OPENDoor open output
BOOL · %Q0.0
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
- #1Door opens immediately on occupancy
OCCUPANCY true → DOOR_OPEN true within one scan
- #2Door stays open 2 s after occupancy clears
OCCUPANCY goes false but DOOR_OPEN still true 2 s later
- #3Door closes 5.5 s after occupancy clears
DOOR_OPEN must be false 5.5 s after OCCUPANCY falls
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