Add minutes and seconds to a total time display on a PLC

7 min read · Published November 8, 2026

Convert each step to seconds, sum the steps, then integer-divide the total by 60: the quotient is the minutes and the remainder is the seconds, so 490 s displays as 8 min 10 s. The decimal 8.166666 mixes minutes with a fraction of a minute, which becomes seconds only after multiplying by 60.

Add the steps in seconds and split the total with an integer divide by 60: the quotient is the whole minutes, the remainder is the seconds. A schedule whose steps sum to 490 s is 8 min 10 s, because 8 × 60 = 480 and 490 − 480 = 10. The 8.166666 a real-number divide returns packs minutes and a fraction of a minute into one value, and that fraction turns back into seconds only when you multiply it by 60: 0.166666… × 60 = 10. This page converts each step to seconds, sums the steps, divides once, and maps the two results to two integer fields on the panel, with test values to prove the mapping before it reaches a live screen.

What each wrong total is telling you

  • The total reads 8.166666 or 8.17. The field is being fed the real-number quotient. Everything after the point is a fraction of a minute, and 0.17 × 60 ≈ 10 s, so the digits are right and the label is wrong.
  • The minutes are correct and the seconds field stays empty or echoes the minutes. The divide produced a quotient but nothing picked up the remainder. On a BCD instruction set that remainder lands on the stack, not beside the quotient, and a POP has to fetch it.
  • The total flips negative or jumps on long schedules. The seconds sum has outgrown its register and wrapped; the register width section below gives the limit.
  • Ordinary adds come back as garbage. The entered values are stored BCD while the arithmetic runs binary, or the panel field type does not match the register type feeding it.

Each symptom has a check further down. Work the list in order.

Convert every step to seconds before adding

For each step, build one number:

step_seconds = (minutes * 60) + seconds

then add the step totals. Adding a minutes column and a seconds column separately also works, but the seconds column then runs past a minute and the program has to carry into the minutes column; converting first keeps one unit through the whole sum.

Check the entries as they arrive: a seconds entry belongs inside one minute. A larger entry still totals correctly, but the panel accepted a value the seconds field can never display, so reject it at the entry screen. And when a value already lives in the controller as one elapsed-seconds number, use it directly. A second conversion layer is just one more place to go wrong.

Divide by 60 and keep both results

An integer divide truncates the fractional part of the quotient, and the instructions built for it hand back a remainder alongside: the quotient is the whole minutes, the remainder is the seconds. Where the instruction set offers a MOD or divide-with-remainder form, use it. Where it returns only a quotient, take the seconds by subtraction:

remainder_seconds = total_seconds - (quotient * 60)

Keep rounding instructions out of this step; rounding discards exactly the information the seconds field needs.

Two format points decide whether any of it lands where you expect. Feed each format its own arithmetic: BCD values go to BCD instructions, binary values to binary instructions. And on the BCD instruction sets, a 16-bit BCD divide leaves the quotient in the accumulator and drops the remainder on the first level of the stack, so a POP moves that remainder back into the accumulator. The POP is the step most often skipped, and a skipped POP is the empty seconds field from the symptom list above. This is the same split that guides on converting a decimal time value to minutes and seconds for an HMI display work through.

If the panel is happier with one field, decimal minutes is a different display with one unit, and guides on converting integer seconds to real minutes on a SCADA display cover that format. The rest of this page builds the two-field version.

Example: a 490 second schedule becomes 8 minutes 10 seconds

Inputs. The steps of the schedule, each entered as minutes and seconds on the panel, convert and sum to a total of 490 s. The divisor is 60 s per minute, by the definition of the minute. The sum sits in a register wide enough to hold it.

Rule. Divide the total seconds by 60 with an integer divide. The quotient is the minutes and the remainder is the seconds. Where the divide returns only a quotient, the seconds come from subtracting the whole minutes, multiplied back by 60, from the total.

Arithmetic.

490 ÷ 60 = 8 remainder 10 8 × 60 = 480 490 − 480 = 10

Cross-check through the decimal: 490 ÷ 60 = 8.166666…, and 0.166666… × 60 = 10, which shows the fraction was carrying the seconds all along.

Result. Minutes register 8, seconds register 10.

Decision. Write 8 to the minutes field and 10 to the seconds field. The threshold that proves the mapping is the seconds range: for any non-negative total, the remainder must land between 0 and 59. A remainder outside that range means the divide, the number format or the result location is wrong, so correct the program before touching the panel.

Map the results to the panel fields

The quotient tag feeds the minutes field and the remainder tag feeds the seconds field, as two separate integer values. Keep the types integer from register to field: a REAL field wired to an integer register, or the reverse, scrambles digits like any type mismatch, and where a value has to travel as a REAL, displaying a PLC float stored in two word registers on an HMI shows the mapping it takes.

The field side of the job, the tags, the update rate and the format, is the same one as displaying a PLC countdown timer on a panel. Where the total sits on the screen and how large the text reads is the placement question answered for displaying a PLC counter value where operators can see it. And when the figure also has to be readable away from the panel, a shop-floor notice board running offline slides or your own app can carry the same total; the shop-floor signage category covers those displays.

Test these totals before you download

Total entered Minutes field Seconds field What it proves
0 s 0 0 zero handling
59 s 0 59 the top of the seconds range
60 s 1 0 the carry into minutes
490 s 8 10 quotient and remainder together

Run each value through the program and watch the total, the quotient and the remainder as it passes. Do it on a copy of the program, against a bench or stopped system, before anything downloads to the line: a divide result aimed at the wrong location overwrites whatever register lives there, and on a running line that register may already belong to the recipe.

Keep the sum inside the register

A signed 16-bit register holds −32,768 to +32,767, so the seconds sum wraps once it passes 32,767, which is 9 h 6 min 7 s of accumulated time. The multiply can overflow first: one step entered as 600 min converts to 600 × 60 = 36,000 s, past the top before any summing starts. Put the step conversion and the total in 32-bit registers whenever the schedule can cross that line, and the wrap moves out to a range no recipe reaches.

The fix, in order

  1. Convert each step to seconds: step_seconds = (minutes * 60) + seconds.
  2. Sum the step seconds into one total in a register wide enough for the largest schedule the panel will ever show.
  3. Integer-divide the total by 60. Take the quotient as minutes and the remainder as seconds, with MOD where the instruction set offers it and the subtraction from above where it does not.
  4. On a BCD set, POP the stack remainder into the accumulator before anything maps to the panel.
  5. Feed the quotient to the minutes field and the remainder to the seconds field, both integer.
  6. Run the test table on a program copy in monitor mode, then download.

Recommendation: Convert every step to seconds with (minutes * 60) + seconds, sum the steps, and split the total with an integer divide by 60, so the quotient becomes the minutes field and the remainder becomes the seconds field. Where the divide exposes only a quotient, compute the seconds by subtracting quotient × 60 from the total. Use 32-bit registers for the conversion and the sum whenever the schedule can pass the top of a 16-bit register, and prove the mapping with the four boundary totals before the panel goes live.

Questions

Can I add the minutes column and the seconds column separately?

Yes, but the seconds column then runs past 59 and needs a carry. Sum the seconds entries, integer-divide that sum by 60, add the quotient to the minutes sum, and keep the remainder as the seconds field. Converting every step to seconds first lands on the same total with one divide, and for a 490 s schedule both roads give 8 min 10 s.

Does the integer divide round to the nearest minute?

It truncates, and rounding is exactly what loses the seconds. 490 divided by 60 gives 8 with a remainder of 10 either way, but a total of 570 s divides to 9.5: rounded, the panel would print 10 min and silently drop 30 s. Take the seconds from the remainder or a MOD instruction, and leave the rounding instructions out of the time math.

Why does the total go negative on long schedules?

A signed 16-bit register tops out at 32,767, so a 10 h schedule summing to 36,000 s wraps to 36,000 − 65,536 = −29,536 and the panel prints a nonsense total. Accumulate the step conversions and the sum in 32-bit registers whenever the schedule can pass about 9 h 6 min, and check the minutes-to-seconds multiply with them.

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