Show motor run hours on an HMI from a PLC counter

7 min read · Published November 7, 2026

Let the PLC do the counting: an accumulating timer enabled by the motor run bit times six-minute intervals, each completed interval adds one count to a counter, and the HMI divides the stored value by 10 so 385 counts read as 38.5 hours. A 4-digit counter reaches its 9999-count limit at 999.9 hours, so store the total in an 8-digit wide-range counter and forget the limit.

Run hours belong in the PLC, not on the screen. An HMI numeric object displays whatever register you point it at; it cannot measure anything. The reliable arrangement is a retentive timer enabled by the motor's run bit, an edge that fires once per completed interval, and a counter that stores the total in tenths of an hour. The screen then divides by 10 and reads true hours with one decimal place. This page builds that meter for a compressor or any motor-driven machine: the six-minute interval, the counter capacity decision, the divide-by-10 scaling, and the commissioning checks that make the number safe to write into a maintenance schedule.

Where should motor run hours be counted: in the PLC or on the HMI?

Count the hours in the PLC and let the screen only display them: a numeric display object reads a value, so the total must live in a controller register that survives the motor stopping and restarting many times a day. Point a display at a timer current-value display and you get an interval that restarts at every stop; the lifetime total for maintenance is a different number, and only the controller can hold it.

Four things per motor:

  • one run bit that is on exactly while the motor runs
  • one retentive, or accumulating, timer
  • one counter, wide-range for installed equipment
  • one register for the total, plus a numeric object on the screen

The run bit deserves thirty seconds of thought. The starter coil the PLC commands is on when you told the motor to run; an auxiliary contact on the contactor is on when the motor actually runs. A tripped overload makes the two disagree, and the feedback contact gives the honest number. Pick one, note its address, and use the same bit in every rung.

How long should the run-hour timer interval be?

Set the interval to six minutes, which is exactly one tenth of an hour: the timer runs only while the motor's run bit is on, and every completed interval adds one count that means 0.1 hours of run time.

The arithmetic is fixed. One hour divided by 10 is 6 minutes, and 6 minutes is 360 seconds. The preset follows from the timer's time base: a 0.1-second-base timer takes a preset of 3600 (360 ÷ 0.1), a 1-second-base timer takes 360. A preset number without its time base means nothing, so read the base off the timer instruction in your programming software before you type either value.

Use the retentive form. It accumulates while the run bit is on and holds the partial value when the bit drops, so a motor that stops 4 minutes into an interval finishes that interval on the next start. A non-retentive timer clears at every stop and undercounts every short cycle; across hundreds of starts the missing tenths add up to real hours.

How do you build the run-hour logic step by step?

The whole meter is six rungs of logic: enable the retentive timer with the run bit, fire one edge when the timer finishes, add one count, reset the timer, then map the counter's register to the screen with a divide by 10.

Lock out and tag the motor circuit before you force bits or open the panel to reach the contactor.

  1. Add the retentive timer. Enable input: the run bit. Preset: 3600 on a 0.1-second base, 360 on a 1-second base.
  2. Add an edge detection block on the timer's done bit, so one long done signal becomes exactly one scan of count enable. A done bit wired straight to a counter input adds a count on every scan it stays on; that is the same scan timing that keeps a momentary HMI button bit alive for several scans. The other trap on this rung is an edge pulse that never shows on the screen, which has its own diagnosis.
  3. Take the edge to the counter's up-count input and leave the down-count input off. Scan order and direction details are in the PLC up down counter article.
  4. Reset the timer on the same edge, after the count: edge on, counter adds 1, timer clears, done bit drops, edge off. One finished interval, one count.
  5. Note the counter number and its accumulated register. Some controllers give a wide-range counter two consecutive counter positions, so the next motor's counter skips a number.
  6. Repeat for each motor: one timer, one edge, one counter, one register, all driven by that motor's run bit.

How many hours fit in the counter before it rolls over?

A standard 4-digit counter holds 9999 counts, which is 999.9 run hours, about 41.66 days of accumulated run time; an 8-digit wide-range counter holds 99,999,999 counts, or 9,999,999.9 hours, roughly 1141.5 years, so choose the wide range and the limit disappears.

Both figures assume one count per tenth of an hour. The 4-digit arithmetic: 9999 × 0.1 hours = 999.9 hours; 999.9 ÷ 24 = 41.6625 days of run time. The wide-range arithmetic: 99,999,999 × 0.1 hours = 9,999,999.9 hours; divided by 24 and then by 365, about 1141.5 years.

A 4-digit counter is fine for a trial or a machine that is rebuilt yearly. For anything that stays installed, the wide-range counter removes the migration job and the risk of a total silently pinned at its limit.

Recommendation: Store each motor's total in an 8-digit wide-range counter from day one. A compressor cell that runs 5.5 hours a day passes 999.9 hours in about 182 days (999.9 ÷ 5.5), so a 4-digit counter commissioned in January rolls over before summer. At the same duty the wide-range counter runs about 4981 years before it fills.

How do you show the total as hours on the screen?

Point the screen's numeric object at the counter's accumulated value and divide by 10 with one decimal place: 385 counts then reads 38.5 hours, while a raw count displayed as hours would read ten times too high.

The scaling lives in the numeric object itself: a gain of 0.1 or a divisor of 10, whichever form your HMI software offers, and one decimal in the number format. Label the object with its unit so 38.5 always reads as hours. If the crew prefers hours and minutes to tenths, the same counter value can feed a formatted duration display. The gain-and-decimal treatment is worked through for a different unit under decimal scaling on an HMI numeric display.

Worked example: what does the screen read after one week?

A compressor duty cycle of 5.5 run hours a day for 7 days totals 38.5 hours; the counter holds 385 tenths, and the screen divides by 10 to read 38.5 hours, with every arithmetic step shown below.

The compressor runs 5.5 hours each day across two shifts. Per day: 5.5 hours = 330 minutes; 330 ÷ 6 minutes per interval = 55 counts; 55 counts × 0.1 hours = 5.5 hours, which closes the loop.

Day 2 includes a stop. The motor shuts off 240 seconds into an interval; the retentive timer holds 240. On the next start it needs 120 more seconds: 240 + 120 = 360, one count. Nothing lost, nothing counted twice.

Day Run hours Counts added Counter total Screen shows
1 5.5 55 55 5.5 h
2 5.5 55 110 11.0 h
3 5.5 55 165 16.5 h
4 5.5 55 220 22.0 h
5 5.5 55 275 27.5 h
6 5.5 55 330 33.0 h
7 5.5 55 385 38.5 h

The screen value is always the counter divided by 10: 385 ÷ 10 = 38.5 hours. Maintenance schedules the first service from a number everyone reads the same way.

How do you check the meter before trusting it?

Commission one motor at a time and check three things: one count per completed six-minute interval, 0.1 hours added on the screen per count, and nothing added while the motor is off, including after a controller power cycle.

  1. Motor off, watch the timer's accumulated value for a few minutes: it must sit still.
  2. Run one full interval against a stopwatch. Near the 6-minute mark the counter adds exactly 1, the screen adds 0.1 hours, and the timer restarts from zero.
  3. Stop the motor mid-interval and restart. The interval finishes on the retained partial time and adds exactly 1 count. If the partial time vanished, the timer in the logic is non-retentive; swap the instruction, because every short cycle is undercounting.
  4. Power-cycle the controller. The total must come back. If it clears, the counter's register sits in non-retentive memory; move the total to a retentive register before anyone writes it into a service schedule.
  5. Read each screen object against its own counter register, one motor at a time, to catch a mapping pointed at the wrong compressor.

Questions

What happens to the run hour total when the controller loses power?

The total survives only if the counter's accumulated register sits in the controller's retentive memory range, which you choose when you allocate the register; check the memory map for your model and move it if needed. Test it with a real power cut at commissioning, not with a software restart: pull control power for a minute, power up, and check the last reading is still on the screen. If your controller backs retentive memory with a battery or capacitor, add that cell to the spare-parts list.

How do you zero the run hours after an overhaul?

Record the old reading in the maintenance log first, then write zero to the counter's accumulated register. Most HMI numeric objects can write a value when the operator touches them, or you can put a small write button on a maintenance-only screen. Reset the timer's accumulated value at the same time so a half-finished interval cannot add a stale tenth of an hour to the fresh total.

Why did adding the wide-range counter use up the next counter number too?

On many controllers a wide-range counter needs two consecutive counter positions, one for the counter and one for its accumulated value, so a counter entered at position 2 also occupies position 3 and the next free position is 4. Check the counter allocation table in your programming manual before you number the meters, or the second compressor's counter will collide with the first one's registers.

Can one timer and counter track several motors together?

No. Each motor needs its own timer and counter pair, enabled by that motor's run bit. A shared timer runs whenever any motor runs and stops whenever any motor stops, so the total stops describing any single machine. Two motors need two timers, two counters and two screen objects, all mapped to their own registers.

Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.

Keep reading

Build your signAsk for a quote