Enter minutes and seconds into an HMI timer preset

6 min read · Published November 8, 2026

A timer with a 0.1 second time base needs its preset in counts: minutes times 600 plus seconds times 10. When the preset lands near half the entry, the panel wrote plain binary into a preset word the timer reads as BCD. Keep the operator's entry in integers, do the math in the PLC, and convert to BCD at the last rung.

Enter the operator's minutes and seconds as plain integers, and let the PLC turn them into timer counts. For a 0.1 second time base the formula is preset counts = minutes × 600 + seconds × 10, so 1 minute 30 seconds becomes 900 counts and times 90.0 seconds on the nose. The presets that arrive near half of what was typed have one cause: on classic ladder-logic families the timer reads its preset word as BCD, and a panel set to write plain binary hands it a word it reads wrong. Keep three things apart and the fault disappears: the operator's entry, the integer count math, and one binary-to-BCD conversion on the rung immediately before the preset word.

What each symptom points to

Put the PLC monitor on the preset word, enter a known value, and each fault names itself.

  • The preset lands near half the entry. The panel object wrote the number as plain binary and the timer read the word as BCD. Either set the object's data format to BCD or convert in the PLC; the example below carries the arithmetic. This is the same format mismatch that leaves an HMI panel showing nonsense numbers from a BCD analog register.
  • Every entry is off by one constant factor. The scale is wrong and the format is fine. A 0.1 second base wants 10 counts per second, a 1 second base wants 1. Read the time base from the timer's documentation and recompute counts per unit from it.
  • Long entries overflow or the timer never reaches the preset. The documented preset maximum is 9999 counts, and on a 0.1 second base that is 999.9 s, or 16 min 39.9 s. Cap the panel entry below the ceiling.
  • An entry such as 1:75 is accepted. The seconds field is missing its 00–59 range check. Reject the entry at the panel and repeat the check in the PLC before the math runs.
  • The preset drifts with nobody touching the panel. A different fault with its own fix, covered in why an HMI timer preset resets to zero.

Turn the entry into timer counts

The timer's documentation states the time base, and the base sets every number that follows. At 0.1 s per count, one second is 10 counts and one minute is 600 counts. With minutes and seconds in two separate words, the preset is:

preset counts = (minutes × 600) + (seconds × 10)

A decimal-minutes entry follows the same rule after you split it: 4.3 minutes is 4 minutes 18 seconds, so it enters the formula as 4 and 18.

When the panel writes the whole entry as one packed MMSS word, split it with an integer divide by 100. The quotient is the minutes, the remainder is the seconds, and a remainder above 59 is a bad entry to reject. Doing that divide on a BCD word has a known trap where digits drop out, walked through in fixing a PLC BCD conversion that loses digits in division. The packed layout is also what the reverse job builds: combining minutes and seconds into one 16-bit BCD word on another PLC family.

Set the ceiling from the timer instruction itself. The classic preset tops out at 9999 counts, which is 999.9 s on a 0.1 second base, so cap the entry at 15 minutes and every legal entry lands at 9000 counts or below.

Example: 1 minute 30 seconds into a 0.1 second timer

The inputs, and where each comes from: the entry is 1 min 30 s, the operator's pick; the time base is 0.1 s per count, from the timer's documentation, confirmed by the presets of 600 that a one-minute entry is expected to produce; the preset ceiling is 9999 counts, from the timer instruction's documented range.

The rule in words: a minute holds 60 s and the base turns every second into 10 counts, so each minute adds 600 counts and each second adds 10.

The arithmetic:

  • minutes: 1 × 600 = 600 counts
  • seconds: 30 × 10 = 300 counts
  • preset: 600 + 300 = 900 counts, and 900 × 0.1 s = 90.0 s

Now the format boundary that produced the half-size presets. A panel set to unsigned integer stores plain binary, and 900 decimal is 0384 in hex. The timer reads that word as BCD, digit by digit: 0384, which is 384 counts and times 38.4 s. The operator asked for 90.0 s and the timer ran 38.4 s, roughly half. Stored as BCD, the same 900 counts sit in the word as 0900 and the timer runs 90.0 s.

Decision: the preset word must hold BCD 0900 for this entry. Get there by setting the panel object's data format to BCD with scaling, or by keeping the entry as unsigned integer and converting binary to BCD on the last rung before the preset. Respect the threshold of 9999 counts: this entry sits at 900, and a cap of 15 minutes, 9000 counts, keeps every entry clear of the ceiling.

Where the conversion belongs

Two arrangements work; pick one and keep it everywhere on the project.

PLC side, the default. Leave every panel object at unsigned integer. Each entry writes to its own intermediate word, one for minutes and one for seconds. Three rungs do the math: multiply the minutes word by 600 into a counts word, multiply the seconds word by 10 into a second counts word, add them and validate. A final rung converts the validated count from binary to BCD and writes the preset word. Holding the whole chain in binary until that last conversion runs quicker than mixing BCD through the math, and it leaves exactly one place to look when a value misbehaves. This is the same division of labor as letting an HMI change a PLC timer preset instead of a constant: the panel owns the entry, the PLC owns the meaning.

Panel side, when the PLC has no spare rungs. Set the numeric entry object's data format to BCD and scale the display so minutes map straight to counts. On a 0.1 second base the factor is 600 counts per display minute, so a scale of 0–9600 raw against 0.0–16.0 display minutes, shown as 3 digits with 1 fractional digit, puts an entry of 1.5 into the word as 900. Watch the raw word for entries of 1.0, 1.5, and 16.0 before the line runs on this setup.

Checks to run before you sign it off

Leave the PLC monitor on three words while you test: the entry words, the counts word, and the preset word.

  1. Enter 1 minute. The counts word reads 600 and the preset word holds BCD 0900, which a binary monitor displays as 2304.
  2. Enter 1 minute 30 seconds. The counts word reads 900 and the preset word holds BCD 0900 by the same route.
  3. Enter 15 minutes. The counts word reads 9000, under the 9999 ceiling.
  4. Run each timer against a stopwatch: 60.0 s, 90.0 s, and 900.0 s.
  5. Watch the remaining time count down on the panel while a timer runs; displaying a PLC countdown timer on an HMI panel covers that view.
  6. Power the panel down and repeat the first two entries cold. The words should land identically.

If a word reads right and the time is still wrong, the time base is not the one you planned around. Measure the base with the stopwatch test at a known preset and recompute counts per second from the base you measured.

Recommendation

Recommendation: Keep every panel object at unsigned integer, write each entry to its own intermediate word, and build the preset in the PLC with minutes × 600 + seconds × 10. Validate the seconds field at 00–59, cap the entry at 15 minutes, and convert binary to BCD on the final rung before the preset word. Choose the panel-side BCD scaling only when the PLC has no room for those rungs, and only after watching the raw word on entries of 1.0, 1.5, and the panel's maximum. Both roads end in the same place: the preset word holds the BCD count and the stopwatch agrees.

Questions

Why do these timer presets use BCD at all?

Each group of 4 bits in a BCD word holds one decimal digit, so 0900 is stored as the digit pattern 0, 9, 0, 0. Classic timer and counter data structures carried BCD because the thumbwheel switches and numeric displays of their era read decimal digits directly, and ladder instruction sets kept the layout for compatibility. That layout is why BCD survives today only where a legacy preset or a thumbwheel-style entry still needs it.

Does the formula change with a different time base?

Yes, and the base sets every number in it. Counts per second equals 1 divided by the base in seconds. A 1 second base carries 1 count per second and 60 per minute, so 1 minute 30 seconds is 90 counts. A 0.01 second base carries 100 counts per second, so the same entry is 9000 counts, just under the 9999 ceiling, and 2 minutes at that base would exceed it. Read the base from the timer's documentation before you pick the scale factors.

Can the operator enter hours the same way?

On a 0.1 second base, no. One hour is 3600 s, which is 36000 counts, far above the 9999 preset ceiling. Move that timer to a 1 second base, where one hour is 3600 counts and fits with room to spare, and scale the panel entry to match. Keep the 0.1 second timer for the short steps and give hours their own accumulated word if the recipe needs both.

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