MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › How do you implement a long-duration timer on a Mitsubishi PLC?
HomeModels
Table of contents

On this page

PLC & Programming (100 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

How do you implement a long-duration timer on a Mitsubishi PLC?

A single timer is boxed in by its time base and the 16-bit setpoint limit: a 100 ms type reaches about 3276.7 s, a little under 55 minutes, so a two-hour or eight-hour delay simply cannot be written on one instruction. The accepted engineering route is to use the timer as a pace generator and let a counter count the paces — or, more simply, to let a built-in one-second clock pulse drive the counter, which gives hour-long timing from a single rung.

Why one timer is not long enough

Delay equals time base multiplied by setpoint, and the setpoint is a 16-bit value with a limit of K32767. That caps the 100 ms type at about 3276.7 s and the 10 ms type well below it. There are only three ways past the limit: chain the time in stages, accumulate the paces, or use a different timing resource. Chaining is the least reliable and accumulation is the most common.

Chaining timers in stages

Wire the contact of one timer into the coil circuit of the next; the total delay is the sum of the stages. It is easy to read and easy to explain, but every stage adds its own one-clock-period error, so the error grows with the number of stages, and if any stage loses power the whole chain restarts. Keep it to two or three stages at most; beyond that, switch to the counter method.

Timer feeding a counter: the usual method

Let the timer generate its own pulse train: put its normally-closed contact in series with its own coil, so the coil drops out when the delay expires and picks up again on the next scan, giving a continuous stream of pulses whose period equals the setpoint. The counter counts those pulses, and the total delay is the product of the two setpoints. Example: timer set to K100 on a 100 ms base gives a 10 s pace, and with the counter at K360 the total is 3600 s, one hour.

Ttotal = Tbase × Ktimer × Kcounter

Using a clock pulse with a counter is simpler

Mitsubishi FX PLCs carry their own special internal clock pulses: M8011 at 10 ms, M8012 at 100 ms, M8013 at 1 s and M8014 at 1 minute. Drive a counter from the rising edge of M8013 and each count is one second, with no pulse train to build. A 16-bit counter at the K32767 limit reaches about 9.1 hours, and on the FX3U the 32-bit counters from C200 upward, combined with the one-second pulse, run to a scale of years. This is the version that consumes the fewest points and reads the clearest.

Power failure and cumulative timing

Ordinary timers and counters are cleared by a power failure, which is fine for a single long delay but useless for accumulating running hours. Cumulative timing needs a retentive timer, a retentive counter, or a latched data register incremented once a second. The latched area varies by model — on the FX3U, D200 to D511 is commonly latched — so recheck it when the model or the battery changes. Keeping the count in a data register has a further advantage: the delay can be made settable instead of being capped at the 16-bit limit.

Ways to build a long delay compared

MethodHow it worksDelay reachableResolutionRetentiveResources used
Single 100 ms timerOne instruction, setpoint directlyAbout 3276.7 s100 msNo1 timer
Single 10 ms timerOne instruction, setpoint directlyAbout 327.67 s10 msNo1 timer
Two timers chainedFront stage starts the secondUp to 10 to the power 7 secondsLimited by the front stageNo2 timers
Timer feeding a counterTimer self-resets to make pulsesPace multiplied by countEqual to the paceNo1 timer + 1 counter
Clock pulse + counterM8013 edge drives the countAbout 32767 s1 sNo1 counter
Clock pulse + 32-bit counter32-bit counter adds the second pulseYears1 sNo1 32-bit counter
Second pulse + latched registerRegister incremented every secondDepends on word width and preset1 sYes1 to 2 words
Retentive timerCleared by a reset instruction, not the coilModel dependentModel dependentUsually1 timer
Real-time clock comparisonCompare present time with target timeDays and months1 sHeld by clock batteryClock function plus words
Timing on the HMIHMI macro or script does the timingDepends on the HMITypically secondsHeld in HMI dataNo PLC points

Notes

Once a delay runs past a few minutes, what is being built is usually not precise timing but accumulated process time or an overrun guard. Neither cares about a jitter of a second, so a clock pulse plus counter is enough and there is no reason to stack stages for the look of accuracy. What does deserve attention is the power failure: running hours and maintenance countdowns must live in the latched area, or every outage starts them again from zero. Where the delay has to be adjusted on site, keep it as a value in a data register rather than a constant in the program.

References

The semantics of timer and counter function blocks and the representation of time values follow GB/T 15969.3 and the equivalent international standard IEC 61131-3; requirements for supply interruption, retention and reset are given in GB/T 15969.2 and IEC 61131-2; supply and protection inside the control cabinet follow GB 5226.1 and IEC 60204-1. Where a time monitor forms part of a safety function, its safety-related part must be independent of ordinary timers and implemented to GB/T 16855.1 and ISO 13849-1.

Points to watch

⚠️ Three common traps:
(1) Accumulating running hours in an ordinary counter, so one power failure wipes out months of records and the program gets blamed instead;
(2) Building the self-resetting pulse train but leaving the counter reset out of the rung, so after the first long delay the counter never clears and the next cycle jumps straight to the end;
(3) Implementing a safety-related overrun guard as an ordinary timer, which becomes useless the moment the program stalls in a scan or the timer is reset by mistake.

Any overrun that guards a stop, a guard door or a crushing hazard must go through a separate safety circuit or safety relay and never rely on soft timing in the PLC. Keep a list of the long-delay setpoints and accumulated values and record them before changing the model, the battery or the program. Measure the actual delay before and after any change and file both readings.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL