Bird
Raised Fist0
PLC Programmingscripting~10 mins

Flashing light circuit with timers in PLC Programming - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Flashing light circuit with timers
Start
↓
Timer ON Delay
↓
Light ON
↓
Timer OFF Delay
↓
Light OFF
↓
Repeat Cycle
The flashing light circuit uses two timers to alternate the light ON and OFF states repeatedly.
Execution Sample
PLC Programming
(* Proper PLC code for flasher *)
(* Assume always true input *)
Timer1(IN := NOT Timer2.Q, PT := T#1s);
Light := Timer1.Q;
Timer2(IN := Timer1.Q, PT := T#1s);
This PLC code uses two mutually resetting TON timers: Timer1 starts when Timer2 is not done, turns light ON when done; Timer2 starts when Timer1 done, turns light OFF (by resetting Timer1 effectively). Matches the execution table behavior.
Execution Table
StepTimer1.ElapsedTimer1.QTimer2.ElapsedTimer2.QLightAction
10sFalse0sFalseFalseStart timers, light OFF
20.5sFalse0sFalseFalseTimer1 counting (IN true since NOT Timer2.Q), light OFF
31sTrue0sFalseTrueTimer1 done, light ON, Timer2 starts (IN=Timer1.Q)
41sTrue0.5sFalseTrueTimer2 counting, light ON (Timer1.Q)
51sTrue1sTrueFalseTimer2 done; Timer1 IN=false (NOT Timer2.Q=false), resets elapsed, Q stays until next scan but light off next cycle
60sFalse1sTrueFalseTimer1 reset (IN now false since NOT Timer2.Q=false)
70.5sFalse1sTrueFalseTimer1 counting again
81sTrue1sTrueTrueTimer1 done, light ON, Timer2 IN=true but since Q true, but to reset Timer2 need explicit reset or IN false
91sTrue0sFalseTrueTimer2 reset (typically R_TRIG on Timer1.Q resets Timer2)
101sTrue0.5sFalseTrueTimer2 counting
111sTrue1sTrueFalseTimer2 done, light OFF, reset Timer1
12EndEndEndEndEndCycle repeats indefinitely
💡 Note: Full code would include resets like Timer1(IN := NOT Timer2.Q); Timer2(IN := Timer1.Q); and possibly R_TRIG resets. Table approximates behavior.
Variable Tracker
VariableStartAfter Step 3After Step 5After Step 8After Step 11Final
Timer1.Elapsed0s1s0s1s1sRepeats 0 to 1s
Timer1.QFalseTrueFalseTrueTrueAlternates True/False
Timer2.Elapsed0s0s1s0s1sRepeats 0 to 1s
Timer2.QFalseFalseTrueFalseTrueAlternates True/False
LightFalseTrueFalseTrueFalseFlashes ON/OFF
Key Moments - 3 Insights
Why does the light turn ON when Timer1.Q becomes True?
Light := Timer1.Q; Timer1.Q signals ON delay finished (step 3).
Why is Timer2 reset when Timer1.Q becomes True again (step 8-9)?
To restart OFF delay after light turns ON again; typically via reset input or IN condition.
How does the cycle repeat indefinitely?
Timers trigger each other's start/reset via IN conditions (Timer1.IN = NOT Timer2.Q; Timer2.IN = Timer1.Q), looping states.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 3. What is the value of Light?
ATrue
BFalse
CUndefined
DTimer1.Q
💡 Hint
Check Light column at step 3.
At which step does Timer2.Q become True for the first time?
AStep 8
BStep 3
CStep 5
DStep 11
💡 Hint
Timer2.Q column.
If Timer1 PT increased to 2s, Light ON duration?
AOFF doubles
BON doubles
CON halves
DNo change
💡 Hint
Timer1 controls ON time.
Concept Snapshot
Flashing light: Two TON timers mutually control IN: Timer1.IN=NOT Timer2.Q (ON phase), Light=Timer1.Q, Timer2.IN=Timer1.Q (OFF phase). Cycle: ON 1s, OFF 1s, repeat.
Full Transcript
Flashing light uses cross-coupled timers. Timer1 runs when Timer2 inactive, sets light ON. Triggers Timer2 for OFF delay, which stops Timer1. Repeats for flash. Table/quiz illustrate timing.

Practice

(1/5)
1. What is the main purpose of a timer in a flashing light circuit in PLC programming?
easy
A. To increase the brightness of the light
B. To measure the voltage of the light circuit
C. To create a delay that controls when the light turns on or off
D. To permanently keep the light on

Solution

  1. Step 1: Understand timer function in PLC

    Timers in PLCs are used to create delays or measure time intervals before an action occurs.
  2. Step 2: Apply timer role in flashing light circuit

    In a flashing light circuit, the timer delays turning the light on or off to create the flashing effect.
  3. Final Answer:

    To create a delay that controls when the light turns on or off -> Option C
  4. Quick Check:

    Timer delays control flashing = B [OK]
Hint: Timers delay actions to create flashing effects [OK]
Common Mistakes:
  • Thinking timers increase brightness
  • Confusing timers with voltage measurement
  • Assuming timers keep lights permanently on
2. Which of the following is the correct syntax to start a TON timer named T1 with a preset of 5 seconds in a PLC program?
easy
A. TON T1 (IN=Start, PT=5s);
B. TON(T1, Start, 5);
C. TIMER TON T1 SET 5
D. TON T1(IN:=Start, PT:=T#5s);

Solution

  1. Step 1: Recall standard TON timer syntax in PLC

    The TON timer uses named parameters with := and time format T# for preset time.
  2. Step 2: Match syntax to options

    TON T1(IN:=Start, PT:=T#5s); uses correct parameter names and time format: TON T1(IN:=Start, PT:=T#5s); others are incorrect or incomplete.
  3. Final Answer:

    TON T1(IN:=Start, PT:=T#5s); -> Option D
  4. Quick Check:

    Correct TON syntax uses := and T# time format = D [OK]
Hint: Use := for parameters and T# for time in TON timers [OK]
Common Mistakes:
  • Using parentheses without := for parameters
  • Writing time as plain number without T#
  • Incorrect keyword order or missing parameters
3. Given this PLC ladder logic snippet for a flashing light:
TON T1(IN:=Start, PT:=T#2s);
IF T1.Q THEN Light := NOT Light; T1(IN:=FALSE); END_IF;

What happens to the Light output after 2 seconds of Start being TRUE?
medium
A. Light turns ON and stays ON
B. Light toggles once then stops
C. Light remains OFF permanently
D. Light toggles its state every 2 seconds

Solution

  1. Step 1: Analyze timer and toggle logic

    The timer T1 starts when Start is TRUE. After 2 seconds, T1.Q becomes TRUE, toggling Light once.
  2. Step 2: Check timer reset behavior

    After toggling, T1 is set to FALSE (stopped), so no further toggling occurs.
  3. Final Answer:

    Light toggles once then stops -> Option B
  4. Quick Check:

    Timer reset stops repeated toggling = A [OK]
Hint: Timer reset stops repeated toggling; toggles only once [OK]
Common Mistakes:
  • Assuming continuous toggling without timer reset
  • Thinking light stays ON permanently
  • Ignoring timer reset effect
4. Identify the error in this PLC code snippet for a flashing light:
TON T1(IN:=Start, PT:=T#3s);
IF T1.Q THEN Light := NOT Light; END_IF;
T1(IN:=Start);
medium
A. Timer input IN is assigned after checking T1.Q, causing logic error
B. Timer preset time PT is missing units
C. Light output is not toggled correctly
D. Timer T1 is not declared

Solution

  1. Step 1: Check order of timer input assignment

    The timer input IN must be assigned before checking T1.Q to update timer status correctly.
  2. Step 2: Identify impact of wrong order

    Assigning IN after checking T1.Q means T1.Q is stale, causing incorrect toggling behavior.
  3. Final Answer:

    Timer input IN is assigned after checking T1.Q, causing logic error -> Option A
  4. Quick Check:

    Assign timer input before reading output = A [OK]
Hint: Assign timer input before reading output to avoid stale data [OK]
Common Mistakes:
  • Assigning timer input after reading output
  • Forgetting time units in PT
  • Misunderstanding toggle logic
5. How would you modify a PLC flashing light circuit using a TON timer to make the light flash continuously every 1 second?
hard
A. Use a TON timer with 1 second preset and toggle light when timer done, then reset timer input
B. Use a TON timer with 1 second preset and never reset timer input
C. Use a TON timer with 1 second preset and toggle light only once when Start is TRUE
D. Use a TON timer with 2 second preset and toggle light every 1 second

Solution

  1. Step 1: Understand continuous flashing logic

    To flash continuously, the light must toggle every timer cycle and the timer must restart each cycle.
  2. Step 2: Apply timer reset and toggle

    Toggle light when timer finishes (Q=TRUE), then reset timer input to restart timing for next cycle.
  3. Final Answer:

    Use a TON timer with 1 second preset and toggle light when timer done, then reset timer input -> Option A
  4. Quick Check:

    Toggle + reset timer input = continuous flashing [OK]
Hint: Toggle light and reset timer input each cycle for continuous flash [OK]
Common Mistakes:
  • Not resetting timer input causing no repeat
  • Using wrong preset time for desired flash rate
  • Toggling light only once
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard