LOGO! 8 Timer to HMI: Converting Total Minutes in TIA Portal

David Krause11 min read
HMI ProgrammingSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

When a Siemens LOGO! 8 off-delay, on-delay, or hour-counter block is wired to a TIA Portal / WinCC HMI tag, the value that lands in the HMI is the total time in the timer's base unit, not a packed hh:mm string. Engineers who treat the raw value as a "hours field" see impossible numbers (for example 535 displayed where 8:55 was expected) and assume the HMI scaling is broken. The actual root cause is that the HMI receives an integer that represents total minutes when the LOGO! timer was configured with an "hours / minutes" time base. The fix is to split the integer into an hours component and a minutes component inside the LOGO! program (or via a UDF) and transfer two separate INT tags to the HMI for display.

This article documents the data-format mechanics behind that mismatch, the arithmetic required to split a minute count back into hours and minutes, the TIA Portal tag configuration, and the WinCC screen elements needed for both display and entry. Two variants are covered: the 16-bit off-delay / on-delay timer that ships an INT, and the 32-bit hour counter that ships a DWord.

LOGO! 8 Timer Output Formats

Every timer block in LOGO! Soft Comfort exposes a parameter named Time that the user enters as a number and a unit suffix (s, m, h). Internally LOGO! always stores the elapsed or remaining time as a count of base units. The base unit is selected by the developer, and it directly dictates what arrives at the HMI tag.

Timer Block Output Tag Type Time Base Selected Raw Value at HMI Tag
On-delay (B004) Word (16-bit signed) Hours / Minutes (h:m) Total minutes since start
Off-delay (B005) Word (16-bit signed) Hours / Minutes (h:m) Total minutes remaining
On/off delay (B006) Word (16-bit signed) Hours / Minutes (h:m) Total minutes remaining
Retentive on-delay (B007) Word (16-bit signed) Hours / Minutes (h:m) Total minutes accumulated
Hour counter (B016) Double word (32-bit) Hours / Minutes Total minutes counted
Weekly / yearly timer Boolean (1 bit) n/a Switch state only

Reference: LOGO! 8 system manual (Siemens Online Support). The numeric "remaining time" exposed by an off-delay block is exactly the same integer that the LOGO! keypad or LOGO! TD would render as hh:mm internally - the human formatting is lost the moment the value crosses the HMI tag boundary.

Engineer field-note: If the LOGO! block is configured with a base of s (seconds), the tag carries total seconds. The split logic described below uses minutes as the working unit because the LOGO! Soft Comfort default for off-delay timers greater than one minute is h:m; switch the divisor to 60 s if your time base is seconds.

Why the HMI Shows "Wrong" Numbers

The classic symptom is: the operator enters 08:55 on the LOGO! display, the timer counts down correctly on the LOGO!, and the HMI process value shows 535 instead of 8:55. That is not a HMI scaling fault - it is the correct transport representation of 8 × 60 + 55 = 535 minutes. The HMI process value field is bound to a 16-bit integer, and 535 is the literal integer that LOGO! wrote into the tag.

The remediation is structural, not cosmetic:

  1. Compute an hours tag and a minutes tag inside the LOGO! program.
  2. Map those two tags to the HMI as separate HMI variables.
  3. Render each variable in its own numeric output field formatted as hours or minutes.

Conversion Mathematics

Given a signed 16-bit integer T_min holding the total minutes remaining:

H = T_min DIV 60      ; integer quotient -> hours
M = T_min MOD 60      ; integer remainder -> minutes (0..59)

For the source example of T_min = 535:

H = 535 DIV 60 = 8
M = 535 MOD 60 = 55

For the hour counter variant (DWord) the same equations apply; the only difference is the wider storage, which permits counts above 32 767 minutes (about 22.4 days) before overflow. For signed Word timers the practical ceiling is 32 767 minutes ≈ 22 days 19 hours 27 minutes, which is why a comment in the original engineering thread warns "This is only possible if the maximum of the minutes is under 32768."

Data Flow Diagram

LOGO! Off-Delay Block B005 Base = h:m Arithmetic H = T DIV 60 M = T MOD 60 HMI Tags Tag_H : INT Tag_M : INT WinCC HMI Out_H Out_M Reference equations T_min = 535 H = 535 DIV 60 = 8 M = 535 MOD 60 = 55 -> Display "08:55" T_min = 1 H = 1 DIV 60 = 0 M = 1 MOD 60 = 1 -> Display "00:01" T_min = 60 H = 60 DIV 60 = 1 M = 60 MOD 60 = 0 -> Display "01:00"

Prerequisites

  • LOGO! 8 controller (6ED1052-xxx08-0BA1 or later 8.FS4 hardware) with Ethernet.
  • LOGO! Soft Comfort V8.x project online with the controller.
  • TIA Portal V15.1 or newer with a WinCC Comfort / Advanced / Professional HMI device added to the same project as the LOGO!.
  • HMI-to-LOGO! connection configured (LOGO! as S7 Ethernet device, HMI area pointer "Coordination" not required for tag polling).
  • For the DWord variant, a Comfort Panel or WinCC Runtime Advanced V15.1+ to handle 32-bit tags without truncation.

Step-by-Step: Splitting Total Minutes in the LOGO! Program

The LOGO! Soft Comfort toolbox includes the Arithmetic block (B018) for division and the Analog MUX / Modulo-style handling through a small ladder combination. Because LOGO! does not expose a native modulo operator in the FBD palette, the standard field-proven recipe uses two arithmetic blocks chained against the same dividend.

  1. Open the LOGO! program in LOGO! Soft Comfort.
  2. Drag an Arithmetic block onto the diagram. Configure:
    • Input 1 (Operand 1) = the timer block output (off-delay remaining time, INT).
    • Operator = DIV.
    • Operand 2 = 60.
    • Output result = named VW_Timer_Hours.
  3. Add a second Arithmetic block:
    • Input 1 = the same timer output.
    • Operator = MOD (exposed via the second dropdown when set to "Arithmetic instruction").
    • Operand 2 = 60.
    • Output result = named VW_Timer_Minutes.
  4. Mark both VW_Timer_Hours and VW_Timer_Minutes as network output so they are visible to the HMI tag list.
  5. Compile with F5 and download to the LOGO! (Tool > Transfer > to LOGO!).
Practical tip: Wrap the two blocks plus a constant block of 60 in a User-Defined Function (UDF) named Split_Min_to_HM. UDFs hide the wiring from the main FBD, and they can be reused across multiple timer channels in the same project. The UDF exposes three terminals: T_min (input), H (output), M (output).

Step-by-Step: Declaring HMI Tags in TIA Portal

  1. In the TIA project tree, expand the LOGO! device and select PLC tags.
  2. Confirm that VW_Timer_Hours and VW_Timer_Minutes exist as INT tags with the desired addresses (default LOGO! V-area addresses).
  3. Switch to the HMI device and open HMI tags.
  4. Create two new tags bound to the LOGO! tags via the connection table:
    HMI Tag Name PLC Tag Data Type Access
    Disp_Timer_H VW_Timer_Hours Int Read
    Disp_Timer_M VW_Timer_Minutes Int Read
    Set_Timer_H VW_Set_Hours Int Read/Write
    Set_Timer_M VW_Set_Minutes Int Read/Write
  5. Set the acquisition mode for read tags to Cyclical continuous with a 1 s update rate.

Step-by-Step: Configuring the WinCC Screen

Four numeric elements are required, exactly as called out in the engineering thread:

  1. Drag an I/O field onto the screen. Bind it to Set_Timer_H. Configure:
    • Mode = Input/Output
    • Format pattern = 999 (three-digit hours field, no leading zero required)
    • Limits = 0 to 99 (or wider for hour counters)
  2. Drag a second I/O field, bind to Set_Timer_M. Format = 99. Limits = 0 to 59. Accept only values < 60 to keep the entry consistent with the modulo.
  3. Drag an Output field, bind to Disp_Timer_H. Set to Output only, format 999.
  4. Drag a second Output field, bind to Disp_Timer_M. Format 99. To match operator expectation, set the property "Display leading zeros" = Yes.
  5. Add a static text element reading ":" between the two output fields for visual grouping.

When the operator presses the green checkmark on the entry fields, the LOGO! program must accept the hours and minutes and compute a single total-minutes value to feed the timer's T input. Add two arithmetic blocks in the LOGO! program:

VW_Set_Total = (VW_Set_Hours * 60) + VW_Set_Minutes

Wire VW_Set_Total into the T parameter of the off-delay block. The HMI write to VW_Set_Hours and VW_Set_Minutes flows through the connection table back to the LOGO! data block.

Hour Counter Variant (DWord)

The hour counter block B016 outputs a 32-bit signed value that can exceed 32 767 minutes. The split logic is identical, but the LOGO! Soft Comfort arithmetic block must be configured to accept a DWord operand and the HMI tags must be of type DInt or Real as required by your WinCC version.

Item INT Variant DWord Variant
Source block B005 / B004 / B007 B016
Source type Word (signed) Double word (signed)
Range 0 .. 32 767 min -2 147 483 648 .. 2 147 483 647 min
Arithmetic operand size Word Double word
HMI tag type Int DInt
WinCC field limits 0 .. 32 767 0 .. 2 147 483 647
Comfort Panel limitation: Earlier Comfort Panels below firmware V14 may display DInt values as 32-bit signed and require explicit format pattern 99999999 to avoid truncation. Always validate on the panel simulator before deployment.

Edge Cases and Limitations

Symptom Root Cause Corrective Action
HMI shows 535 instead of 8:55 Tag is total minutes, not split hh/mm Apply the DIV/MOD split in the LOGO! program
Hours field shows negative number during count-down Off-delay block returns signed value at end of cycle Clamp output via analog threshold or monitor 0 state separately
Counter wraps to 0 after 22 days 16-bit overflow on Word timer Switch to hour-counter block B016 (DWord) or limit max preset
Modulo value above 59 appears Operator entered 75 minutes Enforce I/O field upper limit = 59 in WinCC properties
Display flickers every second Acquisition cycle set to 100 ms Increase update to 1000 ms for human-readable timers
Set field does not write back LOGO! tag not exposed as network output Right-click LOGO! tag in TIA, enable "Accessible from HMI"

Verification and Acceptance Test

  1. Set the off-delay timer to 00:02 on the LOGO! display and verify the HMI shows 00:02 immediately after download.
  2. Start the timer, observe the minutes count down with leading zeros in the HMI minutes field.
  3. When the minutes counter reaches 00, verify the hours field decrements by one (for example from 01:00 to 00:59).
  4. Enter 08:55 via the HMI I/O fields. Confirm the LOGO! timer takes the new preset on the next trigger.
  5. Cycle power to the LOGO! and verify the display recovers after the LOGO! startup delay (~3 s on LOGO! 8).
  6. Open the WinCC online diagnostics (Tools > Online > Tag diagnostics) and confirm both tags are updating without quality code 0xFF (bad).

Reusable UDF Layout (Reference)

The User-Defined Function supplied with the field solution exposes three connectors and three internal blocks:

Inputs:
  T_min : INT      (timer remaining in total minutes)

Internal:
  B1 = Arithmetic(T_min, DIV, 60)        -> H_int
  B2 = Arithmetic(T_min, MOD, 60)        -> M_int

Outputs:
  H : INT
  M : INT

Drop the UDF onto each timer channel and bind H and M to the two corresponding HMI tags. The UDF handles all timer blocks uniformly, so a single design works for on-delay, off-delay, and hour-counter variants as long as the source type matches the UDF input width.

Why does my LOGO! 8 timer show 535 on the HMI instead of 8:55?

Because the LOGO! transfers the total elapsed or remaining time in minutes. A timer set to 8 hours 55 minutes is sent as 8 × 60 + 55 = 535 minutes. Add two arithmetic blocks (DIV by 60 for hours, MOD 60 for minutes) inside the LOGO! program and bind the results to separate HMI tags.

Can I split an hour counter value that is larger than 32 767 minutes?

Yes - the hour counter block B016 outputs a 32-bit signed value and the same DIV/MOD arithmetic works on a DWord operand. Configure the LOGO! arithmetic blocks for Double-word operation and use DInt tags in WinCC.

How do I let the operator enter a time as hh:mm from the HMI?

Place two I/O fields on the screen: one bound to a "set hours" tag, one bound to a "set minutes" tag. Limit the minutes field to 0-59. In the LOGO! program compute T = (Set_Hours × 60) + Set_Minutes and wire the result into the timer block's T input.

Is this a HMI scaling problem?

No. The HMI receives the correct integer transport representation. The split must be performed in the controller because LOGO! does not ship a packed hh:mm data type to the HMI tag interface. Use arithmetic blocks or a UDF for the split.

Do I need LOGO! Soft Comfort or can I do this entirely in TIA Portal?

You can edit the LOGO! program from TIA Portal as long as the LOGO! is added as a device and you have a TIA Portal version that supports LOGO! 8 (V15.1 or later). The HMI configuration is fully inside TIA Portal. For older LOGO! hardware revisions, LOGO! Soft Comfort V8.x is still the most reliable editor.

Back to blog