Bird
Raised Fist0
PLC Programmingscripting~10 mins

Step sequence with timers in PLC Programming - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Step sequence with timers
Start Step 1
↓
Timer 1 ON?
No→Wait
|Yes↓
Move to Step 2
↓
Timer 2 ON?
No→Wait
|Yes↓
Move to Step 3
↓
Sequence Complete
The sequence starts at Step 1, waits for Timer 1 to finish, then moves to Step 2, waits for Timer 2, and finally completes the sequence.
Execution Sample
PLC Programming
step = 1
timer1 = 3  # seconds
timer2 = None  # seconds
if step == 1:
  if timer1 == 0:
    step = 2
    timer2 = 2  # seconds
  else:
    timer1 -= 1
elif step == 2:
  if timer2 == 0:
    step = 3
  else:
    timer2 -= 1
This code simulates a step sequence where each step waits for a timer to reach zero before moving to the next step.
Execution Table
StepCurrent StepTimer1 (sec)Timer2 (sec)ConditionActionNext Step
113N/Atimer1 == 0? FalseWait, decrement timer11
212N/Atimer1 == 0? FalseWait, decrement timer11
311N/Atimer1 == 0? FalseWait, decrement timer11
410N/Atimer1 == 0? TrueMove to Step 22
5202timer2 == 0? FalseWait, decrement timer22
6201timer2 == 0? FalseWait, decrement timer22
7200timer2 == 0? TrueMove to Step 33
8300Sequence completeEnd sequence3
💡 Step 3 reached, sequence complete
Variable Tracker
VariableStartAfter 1After 2After 3After 4After 5After 6After 7Final
step111122233
timer1321000000
timer2N/AN/AN/AN/A21000
Key Moments - 2 Insights
Why does the step not change immediately when the timer starts?
Because the timer counts down each cycle and only when it reaches zero (see rows 1-4 in execution_table) does the step change.
What happens if the timer is not decremented properly?
The step will never advance because the condition timer == 0 will never be true, so the sequence stays stuck (see rows 1-3 where timer1 decrements).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table at Step 4. What is the value of timer1 and what action happens?
Atimer1 is 3, step moves to 2
Btimer1 is 1, step stays at 1
Ctimer1 is 0, step moves to 2
Dtimer1 is 0, step stays at 1
💡 Hint
Check row 4 in execution_table for timer1 and action
At which step does the sequence complete according to the execution table?
AStep 2
BStep 3
CStep 1
DStep 4
💡 Hint
Look at the last row in execution_table where sequence ends
If timer2 started at 4 seconds instead of 2, how would the execution table change?
AMore rows with timer2 decrementing from 4 to 0
BFewer rows because timer2 counts faster
CNo change, timer2 value does not affect steps
DSequence would end earlier
💡 Hint
Refer to timer2 values in execution_table rows 5-7
Concept Snapshot
Step sequence with timers:
- Start at step 1
- Wait for timer1 to reach 0
- Move to step 2
- Wait for timer2 to reach 0
- Move to step 3 (sequence complete)
Timers count down each cycle; step changes only when timer hits zero.
Full Transcript
This visual execution shows a step sequence controlled by timers. The sequence starts at step 1 with timer1 set to 3 seconds. Each cycle, timer1 decreases by 1 until it reaches zero, then the step moves to 2. At step 2, timer2 starts at 2 seconds and counts down similarly. When timer2 reaches zero, the step moves to 3, completing the sequence. Variables step, timer1, and timer2 change over time as shown. Key moments include understanding why steps wait for timers and what happens if timers don't decrement. The quizzes test understanding of timer values and sequence progress.

Practice

(1/5)
1. What is the main purpose of using timers in a step sequence in PLC programming?
easy
A. To wait a set time before moving to the next step
B. To immediately jump to the last step
C. To reset the entire program
D. To skip steps randomly

Solution

  1. Step 1: Understand the role of timers in step sequences

    Timers are used to create delays between steps, ensuring each step runs for a set time.
  2. Step 2: Identify the correct timer function

    The timer waits before allowing the sequence to move to the next step, controlling timing precisely.
  3. Final Answer:

    To wait a set time before moving to the next step -> Option A
  4. Quick Check:

    Timers delay steps = A [OK]
Hint: Timers pause steps to control sequence timing [OK]
Common Mistakes:
  • Thinking timers skip steps
  • Assuming timers reset the program
  • Believing timers jump to last step
2. Which of the following is the correct way to start a timer in a PLC step sequence?
easy
A. StartTimer(T1, 5s)
B. TimerStart T1 5
C. TON T1, 5s
D. T1 = Timer(5)

Solution

  1. Step 1: Recognize standard PLC timer syntax

    In many PLC languages, the TON (Timer ON Delay) instruction is used with a timer name and preset time.
  2. Step 2: Compare options to standard syntax

    TON T1, 5s uses 'TON T1, 5s' which matches common PLC timer start syntax.
  3. Final Answer:

    TON T1, 5s -> Option C
  4. Quick Check:

    TON is standard timer start = C [OK]
Hint: Look for TON keyword to start timers [OK]
Common Mistakes:
  • Using incorrect function names
  • Missing TON keyword
  • Wrong timer parameter format
3. Given this step sequence code snippet:
Step 1: Start TON timer T1 for 3 seconds
Step 2: When T1 done, move to Step 2 and start TON timer T2 for 2 seconds
Step 3: When T2 done, move to Step 3

What is the total time before Step 3 starts?
medium
A. 5 seconds
B. 2 seconds
C. 3 seconds
D. Cannot be determined

Solution

  1. Step 1: Add timer durations sequentially

    Step 1 waits 3 seconds, then Step 2 waits 2 seconds before Step 3.
  2. Step 2: Calculate total wait time

    Total time = 3 seconds + 2 seconds = 5 seconds.
  3. Final Answer:

    5 seconds -> Option A
  4. Quick Check:

    3s + 2s = 5s total [OK]
Hint: Add timer durations in sequence for total delay [OK]
Common Mistakes:
  • Only counting one timer duration
  • Confusing timer start with timer done
  • Assuming timers run in parallel
4. You have a step sequence with timers but the sequence moves to the next step immediately without waiting. What is the most likely error?
medium
A. Timer is counting up correctly
B. Timer preset value is set to zero
C. Step sequence is missing
D. PLC power is off

Solution

  1. Step 1: Identify why timer causes no delay

    If the timer preset is zero, it finishes instantly, causing no wait.
  2. Step 2: Check other options

    Counting up correctly means timer works; missing sequence or power off would stop all operation.
  3. Final Answer:

    Timer preset value is set to zero -> Option B
  4. Quick Check:

    Zero preset = no delay [OK]
Hint: Check timer preset is not zero for delay [OK]
Common Mistakes:
  • Ignoring timer preset value
  • Assuming power off causes immediate step
  • Confusing timer counting with preset
5. You want a step sequence that:
1. Starts motor for 4 seconds,
2. Waits 3 seconds with motor off,
3. Then starts motor again.

Which timer setup correctly implements this sequence?
hard
A. Step 1: TON T1, 4s; Step 2: TON T2, 3s; Step 3: Motor ON
B. Step 1: Motor ON; Step 2: TON T1, 4s; Step 3: TON T2, 3s; Step 4: Motor ON
C. Step 1: TON T1, 3s; Step 2: Motor ON; Step 3: TON T2, 4s
D. Step 1: Motor ON and TON T1, 4s; Step 2: Motor OFF and TON T2, 3s; Step 3: Motor ON

Solution

  1. Step 1: Match motor state with timers per step

    Step 1 must run motor ON while timer T1 counts 4 seconds; Step 2 motor OFF with timer T2 for 3 seconds; Step 3 motor ON again.
  2. Step 2: Verify options

    Only Step 1: Motor ON and TON T1, 4s; Step 2: Motor OFF and TON T2, 3s; Step 3: Motor ON correctly pairs motor ON/OFF states with timers in the right steps.
  3. Final Answer:

    Step 1: Motor ON and TON T1, 4s; Step 2: Motor OFF and TON T2, 3s; Step 3: Motor ON -> Option D
  4. Quick Check:

    Motor state matches timers per step = D [OK]
Hint: Pair motor ON/OFF with timers in each step [OK]
Common Mistakes:
  • Not turning motor OFF during wait
  • Mixing timer durations
  • Skipping motor control in steps
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