IMDHMIControls LibraryShop main store

Troubleshooting

Why a DL05 timer sequence runs one cycle at power-up

PLC programming Published 8 min read By IMDHMI controls team

Short answer

Rung 6 starts T2 through a normally closed C1 contact, and C1 is off at idle, so the whole Y0-Y2 chain runs once the moment the DL05 powers up. The fix is a cycle-state bit set by the two-button start and dropped by the final timer, with each interval's preset calculated from the TMR's 0.1 s count.

On this page
  1. Why does the DL05 run one full cycle at power-up?
  2. Why does adding a C0 contact make the cycle need held buttons?
  3. How do you latch the cycle so one start runs to the end?
  4. How do you turn seconds into a K preset on a DL05 timer?
  5. How do the five stages step Y0, Y1 and Y2 through the timers?
  6. How do you test the fix before the solenoids are wired?
  7. What rearms the sequence for the next start?
  8. Questions asked

At power-up your rung 6 is already true: STRN C1 passes power whenever C1 is off, C1 is off at idle, so T2 starts timing the instant the CPU enters RUN and the chain walks Y0, Y1 and Y2 through once with nobody near the machine. Patching it with a button contact only trades the false start for a chain that stops when the operator lets go. The cure is a cycle-state bit, set once by the two-button start, sealed in through its own contact, and dropped by the last timer, so the sequence waits on something that is genuinely false at idle. Here is why each patch failed, the corrected rungs, the preset arithmetic, and the power-cycle test that proves the repair.

Why does the DL05 run one full cycle at power-up? #

Rung 6 opens with a normally closed C1 contact, C1 is off at idle, so the rung is already powered when the CPU enters RUN: T2 times with no start, and every rung behind it steps the chain through Y0, Y1 and Y2 once. Here is the rung as written:

STRN C1
TMR  T2 K20
ANDN T2
OUT  Y0

STRN C1 passes power whenever C1 is zero, and C1 only comes on after a valid two-button event, so at power-up, and at every idle moment since, the condition is satisfied before any start has happened. The TMR box times whenever it sees power, ANDN T2 holds Y0 on during the count, and the rungs that follow key off T2's done bit, so one born-true contact drives the entire sequence. This is the one symbol that changes meaning at power-up: a normally closed contact is true the instant the CPU begins scanning, before anything in the process has occurred, as covered in ladder logic symbols and what each one does in a rung.

Blocking the rung for the first scan only moves the false start; it does not remove it. A normally closed SP0 contact (SP0 is the DL05 first-scan relay) is false for exactly one scan; on scan two the C1-off path is true again and T2 begins timing anyway. The permissive you gate with must be false at idle on every scan, not just the first.

Why does adding a C0 contact make the cycle need held buttons? #

C0 is produced by the live button combination, so it is true only while the qualifying press is still present: the patch kills the startup cycle and immediately creates a second defect, a chain that now needs a held button instead of a stored start. Put a normally open C0 in series in rung 6 and the power-up run disappears, because C0 is false until the buttons are pressed. But C0 follows the buttons: the moment the operator lets go, C0 drops, T2's rung loses power mid-count, the timer resets, and the chain stalls wherever it was. You have traded a sequence that starts by itself for a sequence that stops by itself.

The root mistake is using a level where the logic needs an event. A button-held bit answers whether the buttons are down right now; the chain needs an answer to whether a start has happened. Store the answer once and let the stored bit carry the cycle, and the buttons become free the instant they have done their job.

How do you latch the cycle so one start runs to the end? #

Set a cycle-state bit from the start event and seal it in: C3 comes on when C1 arrives, holds itself through its own contact while the last timer runs, and drops the moment that timer completes, so nothing in the chain is true at idle. Place this rung above the chain it gates:

STR  C1
STR  C3
ANDN T6
ORSTR
OUT  C3

Read it as two branches joined by ORSTR: the top branch turns C3 on when the start event C1 appears; the bottom branch keeps C3 on while C3 is already on and the final timer T6 (the next timer number after T5) has not completed. When T6 finishes, the holding branch opens, C3 drops, and every rung gated on C3 loses power in the same scan. It is the standard start-and-hold seal-in, the same parallel-branch construction you use to program a sealed motor starter rung in STEP 7 ladder, with the stop side replaced by a timer contact.

Rung 6 then changes by one contact:

STR  C3
TMR  T2 K20
ANDN T2
OUT  Y0

C3 cannot be on unless a start happened, so the chain finally has something to wait for. Two conditions on the start bit: C1 must behave as an event, not a surviving level, so if your button rung leaves C1 latched, clear it when the buttons are released, or C3 will re-latch the scan after T6 releases it. And if your chain ends on a different timer than T6, the drop condition in the holding branch is that final timer; the pattern does not change.

How do you turn seconds into a K preset on a DL05 timer? #

On the DL05 the standard TMR counts in 0.1 s steps, so K is a count of tenths of a second: a 2 s stage needs K20 and the 1 s dwell needs K10. The count unit belongs to the timer instruction, not to your sequence, and your own button rung confirms it: the K5 on T0 and T1 is the half-second window that accepts the two presses. Never read a K value as seconds on its own; a preset copied from another program means nothing until it is divided by the count unit of the instruction that will time it.

The arithmetic for this sequence:

  • On-stage: 2.0 s ÷ 0.1 s per count = 20 counts, so the preset is K20.
  • Dwell: 1.0 s ÷ 0.1 s per count = 10 counts, so the preset is K10.

Every stage of the same length gets the same preset. If you later move an interval to a fast timer instruction with a finer count unit, redo the division for that interval, because the preset travels with its instruction. Before the solenoids are connected, watch the timer's current value climb online and confirm each stage switches at the count you calculated.

How do the five stages step Y0, Y1 and Y2 through the timers? #

Give every interval its own timer and drive each output from its own on-stage: T2 times Y0, T3 the first dwell, T4 Y1, T5 the second dwell, and T6 Y2, and when T6 finishes it drops C3 so the whole chain resets itself.

Stage Outputs Time (s) Timer Preset
1 Y0 on, Y1 and Y2 off 2.0 T2 K20
2 all three off 1.0 T3 K10
3 Y1 on, Y0 and Y2 off 2.0 T4 K20
4 all three off 1.0 T5 K10
5 Y2 on, Y0 and Y1 off 2.0 T6 K20

Each timer rung starts from the done bit of the stage before it:

STR  C3
TMR  T2 K20

STR  T2
TMR  T3 K10

STR  T3
TMR  T4 K20

STR  T4
TMR  T5 K10

STR  T5
TMR  T6 K20

And each output is powered by exactly its own on-stage:

STR  C3
ANDN T2
OUT  Y0

STR  T3
ANDN T4
OUT  Y1

STR  T5
ANDN T6
OUT  Y2

Y0 is on from the start until T2 completes, Y1 from T3's completion until T4's, Y2 from T5's until T6's. No output shares a timer with a later dwell, so the online display always shows one live stage and the lamps match the table one for one. When T6 completes, the latch rung drops C3, every stage rung loses power, and the timers return to zero; the chain re-arms without a reset instruction, because a TMR resets whenever its rung condition goes false.

How do you test the fix before the solenoids are wired? #

Power-cycle the PLC five times with the output wiring still disconnected and watch C3 online: it must stay off at idle every time, come on only after a valid two-button start, and drop exactly when the final timer completes. Work through this list with the Y0 to Y2 status lamps as your only actuators:

  1. Switch to RUN with nobody near the buttons and wait longer than one full cycle: Y0, Y1, Y2 and C3 must all stay dark. The old program failed this test on its first power-up.
  2. Press both buttons inside the acceptance window and release them at once; the lamps must step through all five stages and go dark on their own. Releasing the buttons must change nothing.
  3. Power-cycle the PLC at idle and repeat step 1; the uncommanded cycle must not return.
  4. Press one button alone, then both outside the window; nothing may start, and C3 must stay off.
  5. Hold both buttons down through a complete cycle; exactly one cycle runs, because C3 is set by the start event, not by the held level.

This ladder is ordinary sequence control, not a safety function: a two-button start in this program is not a safety-rated two-hand control, so guards, the E-stop and any two-hand device stay in certified hardware outside it. And when the solenoids are connected, give each coil its own suppression, a reverse-biased diode for a DC coil and an MOV for an AC coil, because the turn-off spike, not the steady current, is what damages the output.

What rearms the sequence for the next start? #

The end of a cycle rearms the chain by itself: C3 dropping resets every timer to zero, so the next valid two-button event finds the logic exactly as it stood after download, and no reset rung is needed. Two behaviors still need a decision, and both belong in the latch rung, not scattered through the chain. First, the re-arm rule: the button logic must require both inputs to pass through released before a new start counts, so a button held down at power-up or wedged on produces nothing. Test it by holding one button through a power-cycle; the sequence must stay dark.

Second, a stop or fault partway through the cycle. Put that condition in the holding branch as one more normally closed contact, in series with T6: a fault then drops C3 exactly like normal completion, the outputs de-energize in that scan, the timers reset, and the machine idles with the fault visible. Trigger it once with the outputs disconnected and confirm the chain returns to the same clean idle, ready for a start once the cause is cleared. That is the whole repair: one latch rung, one swapped contact in rung 6, and presets divided from the count unit; everything else in the program can stay as it is.

Questions asked

Why did the original program run correctly after that first power-up cycle?

Because the false start left the chain parked on its completed timers. With every stage already finished, the idle-true path in rung 6 had nothing left to advance, and the next real two-button event reset and restarted the sequence normally. The defect was still in the program the whole time; it had simply already fired once, which is why the machine looked healthy afterward.

How long is one complete cycle?

Add the five intervals: three on-stages of 2.0 s plus two dwells of 1.0 s gives 2.0 + 1.0 + 2.0 + 1.0 + 2.0 = 8.0 s from the start event to idle. When you tune the machine, change one K preset at a time; each interval has its own timer, so one edit moves exactly one stage and the total stays predictable.

Can both off-pauses share one timer?

Not in this chain. A shared timer would have to reset and retime mid-cycle, and its done bit could not tell the rungs which dwell it belonged to, so the step after it would fire at the wrong stage. Timer numbers cost nothing on a DL05; five intervals get five timers, and the online display then shows exactly which stage is live at any moment.

Does every DL05 timer instruction count in tenths of a second?

No. The count unit belongs to the instruction, not the CPU: the standard TMR instruction in these rungs counts 0.1 s per count, while fast timer instructions count in finer steps, so a preset carried between instructions produces a different duration. Redo the division whenever an instruction changes, and confirm the unit in the timer chapter for the instruction you actually used.

Keep reading

  • Troubleshooting

    SLC 5/03 pulse sequence logic will not run

    Your sequence logic is probably fine: the ladder file holding it is never called from File 2, and green highlighting on both OTL and OTU shows the bit's state, not that both rungs execute. Call the file, one-shot I:8.78 with OSR, latch a sequence bit, and clear it only after the last pulse on O:7.4.

    PLC programming

  • Selection guide

    Ladder logic simulator selection by instruction coverage

    Score a ladder logic simulator by instruction coverage, proven with execution rather than animation. Build one test rung per instruction class - on-delay and off-delay timers, a seal-in and a set/reset bit across a restart, an up counter, and math with negative and limit values - and compare observed behavior with the standard's timer definitions. A tool that holds the elapsed value after the timer input drops, or wraps integer overflow silently, is out for sequence work; a tool that passes every class goes on the shortlist.

    PLC programming

  • How-to

    Build a siren pulse count sequence in S7-1200 ladder logic

    Use a positive-edge request to load a target of 3, 2, or 1 pulses, then run a four-state ladder sequence — idle, start, stop, count — that drives Q6.2 (START) and Q6.1 (STOP) from separate states so the two SIMOCODE Pro V commands never overlap. With a 2.0 s on-time and a 1.0 s gap, the three patterns finish in 11.0 s, 7.0 s, and 3.0 s.

    PLC programming

Why an S7-300 CPU and input module flash together at startup