IMDTouchKnowledge BaseShop main store

Troubleshooting

Fixing an HMI Date and Time Tag That Fails Over S7

HMI and touchscreens Published 8 min read

Short answer

When ordinary tags read and write but a Siemens date and time tag returns a communication error, the driver imported the tag but cannot transfer that data type. Copy the clock into ordinary component variables in PLC logic and read and write those from the HMI. The Ethernet side needs no changes.

On this page
  1. Why does the PLC clock tag fail when every other tag works?
  2. Why did the tag import succeed if the driver cannot use it?
  3. How do I display the PLC clock without the date and time tag?
  4. How do I let operators set the clock from the panel?
  5. Why are variables inside a structure of structures missing after import?
  6. How do I handle data blocks that mix symbolic and absolute access?
  7. What does FunctionBlock.txt do during tag import?
  8. Questions asked

Ordinary tags read and write, the imported tag list shows the PLC's date and time variables, and the moment an object touches one of them the panel reports a communication error. The driver imported the tag but cannot transfer that data type, so the fix is a PLC-side conversion into ordinary component variables, not Ethernet troubleshooting. On the S7-1200 the same import session brings two more limits you will meet: variables inside a structure that contains another structure never appear in the list, and the driver takes one access mode for the whole connection. This article walks the failing clock tag first, then the two import limits, with the mapping file that recovers instance data blocks.

Why does the PLC clock tag fail when every other tag works? #

The driver imported the tag's name but cannot transfer the Siemens date and time data type, so the read fails at runtime while ordinary numeric tags keep working — this is a data-type limit, not a connection fault.

Establish the baseline before touching anything, in this order:

  • Read one ordinary numeric variable from the PLC and watch the value follow the controller.
  • Write one test variable that has no machine consequence and see the value arrive in the PLC monitor.
  • Confirm the controller family matches the device selected in the HMI project. One reported project simulated against an S7-200 over Ethernet while the data-block questions concerned an S7-1200; the access-mode and mapping steps later in this article belong to the S7-1200 branch only.

With ordinary reads and writes working, the connection has its baseline, and changing the IP address, the cable or the timeout will not make a data type transferable. The reading that matters is the declaration of the failing clock variable. On the S7-1200 the time and date family runs from TIME, a 32-bit signed value in milliseconds documented down to -2,147,483,648 ms, through DATE as a 16-bit value and TOD as a 32-bit time-of-day, to DTL, a 12-byte structure holding date and time together. The panel protocol side has no element type matching that structure in this setup — the reported case ran EasyBuilder Pro 4.10.01 — so the driver refuses the read and the refusal surfaces as a communication error. Decision: leave the network configuration alone and change the type the HMI sees.

Why did the tag import succeed if the driver cannot use it? #

Import identifies the variable by its declared name; transfer at runtime depends on the driver's supported type list, and those are two separate checks — the importer found the declaration, while the protocol side has no element type for a date-and-time structure.

The documented workflow explains the gap. You create the program and its tags in the PLC engineering software, download them to the controller, and then import: EasyBuilder connects to the PLC and reads the tag data. What the importer records are names and declarations; whether the runtime can transfer each declaration is a separate check against the driver's supported type list, documented per driver in the vendor's connection guides — separate guides exist for the S7-1200/1500 absolute-addressing and symbolic-addressing drivers. Import success is gate one; type support is gate two, and the clock tag fails only at gate two.

The same guides carry the other import limit worth knowing before you build screens: arrays whose index starts at a non-zero value are not supported on this path. The practical rule after any import is to read one tag of every type you intend to use, in simulation, before drawing objects. Thirty seconds there catches a whole class of mismatch — the same class that makes an HMI write the wrong PLC value above 9 when a tag's type does not match its object. The behavior described here was observed on EasyBuilder Pro 4.10.01; for another version, the supported type list in that version's connection guide is where to confirm before transferring the diagnosis.

How do I display the PLC clock without the date and time tag? #

Copy the clock into ordinary component variables with PLC logic — year, month, day, hour, minute, second as plain integers — and point the HMI objects at those; the communication error disappears because every tag is now a supported type.

In the PLC, declare one ordinary variable per component, using plain integer types the driver already carries, and copy them from the controller clock in logic on a periodic basis. Point the HMI objects at those variables and match each object's numeric format to the declared width and signedness of its component, the same discipline that keeps a counter's current value readable with a signed HMI tag.

Reads taken while the clock advances can mix instants: fields polled across midnight can show 23:59 in one place and 00:00 in the next. Publish a snapshot instead — copy all six components in a single PLC scan and let the HMI read that set, so the fields always belong to one instant.

If you would rather poll one tag than six, pack the time of day as seconds in the PLC. At 14:36:22 the packed value is 14 × 3600 s + 36 × 60 s + 22 s = 50,400 s + 2,160 s + 22 s = 52,582 s. The day tops out at 23 × 3600 s + 59 × 60 s + 59 s = 82,800 s + 3,540 s + 59 s = 86,399 s, which sits far inside the 32-bit signed width the controller itself uses for TIME. Decision: components for a human-readable clock face, the packed value for trends and logs — both are ordinary tags the driver has already proved it can carry.

How do I let operators set the clock from the panel? #

Use editable ordinary variables as a clock-set request, validate the whole request in the PLC, then apply it with the controller's clock-setting instruction — never write clock components directly from the panel one field at a time.

Build the set path as a request, not as direct writes:

  1. Declare editable request variables with the same ordinary types as the display components.
  2. Add a momentary apply bit the operator presses once the fields are entered.
  3. On the rising edge of that bit, validate the whole request in one place: month 1 to 12, day 1 to 31, hour 0 to 23, minute 0 to 59, second 0 to 59, plus calendar consistency — February 30 is refused, not truncated.
  4. Assemble the representation the controller's clock-setting instruction expects and execute it; that instruction's documentation defines the representation.
  5. Latch a status word — applied, or rejected with a reason — and display it beside the entry fields.

Writing the components directly from the panel would turn each field into an independent write, and a rejected or interrupted sequence would leave a half-set clock. One caution belongs here: a clock jump moves every time-based behavior with it, including a day-of-week schedule driven from the HMI clock and the timestamps in your logs, so apply clock changes with the machine in a state where a schedule jump is harmless.

Why are variables inside a structure of structures missing after import? #

The importer exposes members of a structure but not members of a structure that sits inside another structure, so those variables never reach the tag list — flatten the interface or expose them through instance data blocks.

This failure announces itself earlier than the clock error: the tag never reaches the list, so no runtime read is ever attempted. Expand the declaration tree in the PLC engineering software and see where the missing value sits. If it is an ordinary member one structure level down, the importer should have shown it, and the access-mode mismatch in the next section is the likelier cause. If it is a member of a structure nested inside another structure, the importer cannot expose it in this setup, and two ways out exist:

  • Copy the values you need into a flat interface data block with PLC logic, the same pattern as the clock components, when the list is short.
  • When the nesting exists because the data is a function block's instance data, map those instance data blocks into the import with FunctionBlock.txt, covered next.

Decision: a handful of values does not justify reworking declarations — copy them; whole instance data blocks justify the mapping file.

How do I handle data blocks that mix symbolic and absolute access? #

The panel driver takes one access-mode selection for the whole connection, so it cannot serve some data blocks symbolically and others by absolute address — align every DB the HMI must reach to the same access mode.

In the controller's engineering software each data block is set either for standard access, where absolute addressing works, or for optimized access, where only symbolic access does — and a project can legitimately contain both. The panel driver cannot follow that mix: its single access-mode selection covers the whole connection, so the blocks of the other mode fail no matter which mode you pick. Decide by the state of your screens:

  • Keep absolute addressing when existing screens reference numeric DB addresses you cannot redraw.
  • Choose symbolic for a new project; defining a large number of symbolic variables is not the obstacle it might seem.
  • Where logic you must read lives in the other mode, copy the exchange values into one interface data block of the chosen mode.

The access-mode choice corresponds to the driver variant, and each variant's connection guide documents its own supported type list — read the guide for the driver you selected.

What does FunctionBlock.txt do during tag import? #

It defines which data block each function block's instance data lands in before the import runs: with S7-1200 imports, the function-block-to-data-block mapping must be user-defined first, over address ranges 0 to 65535 on both sides.

The file lives in the EasyBuilder Pro installation folder. When tags are imported with S7-1200 selected, the mapping from function block to data block must be defined in it before the import runs: function block addresses run 0 to 65535 and data block addresses run 0 to 65535, and each line maps one pair in the documented form FB200 Map DB10000. Add a line for every function block whose instance data the HMI must see, save the file, and run the import again; the instance data blocks then import under their mapped numbers and their members become ordinary tags. Decision: use the mapping file for instance data, use copies for everything else, and the imported list finally matches what the runtime can transfer.

Questions asked

Does this fix also apply to an S7-200 connection?

The diagnosis transfers to any controller: when ordinary tags exchange values and only the date and time tag fails, the representation is unsupported and a PLC-side copy into ordinary variables is the fix. The symbolic-versus-absolute access mode and the FunctionBlock.txt mapping are S7-1200 specifics, so confirm which controller the HMI device selection actually names before applying those steps.

Can I read the 12-byte DTL structure as raw bytes instead of converting it?

That path is not documented for this driver. The connection guide lists the supported element types, and a byte-wise read of the structure is not among them, so treat it as untested. You would also own the byte-level decoding on the panel side. The PLC-side copy into ordinary variables needs no decoding and keeps the display working after one logic block.

Why does the error also appear in PC simulation, with no cable attached?

Simulation runs the same driver and the same type rules as the physical panel, so an unsupported data type fails locally exactly as it does online. That is useful: it lets you prove the PLC-side conversion, with components reading and writing in simulation, before anyone touches the machine. If the error appears only online, look at the connection instead.

My driver documents 64-bit support, so why can it not carry a 12-byte date and time?

The 64-bit figure is a width limit for numeric element types: the largest single integer the driver transfers. DTL is a 12-byte structure with several members, not an integer, so width was never the constraint. Six ordinary integer tags carry the same information with full documented support.

Keep reading

  • Troubleshooting

    Fixing an HMI Project Upload That Reports Communication Failed

    Treat a failed HMI project upload as three separate branches: the installer's parallel-port dongle driver message is a licensing fault, a "communication failed" report before any progress is a transfer-path mismatch, and a "file system error" after the panel answers is a storage or destination fault. Identify the layer from the message and the moment it appears, fix that layer only, and retest. A dongle fault never blocks the cable, and a successful ping never proves the transfer service is up.

    HMI and touchscreens

  • Troubleshooting

    Fixing Invalid Bit Address Errors When Adding HMI Tags

    When the tag editor throws GUI-024: Invalid Address on a slash-form bit address like IO4/05 after a software upgrade, the fault is in the tag-entry dialog, not in the PLC point. Export the tag database, restore the full bit address in a spreadsheet, re-import, and verify the object against the intended output before the screen returns to service.

    HMI and touchscreens

  • Troubleshooting

    Fixing a PCS 7 OS download that fails with SQL errors

    The transfer fails because the target-side WinCC SQL databases, the CC_* copies, stay attached to SQL Server or sit in RECOVERY_PENDING, so WinCCOM cannot replace them. Close Runtime and all editors, reboot the target, remove the obsolete CC_* databases through the SQL administration layer rather than by deleting .mdf files, delete the stale CC_OM DSN, then run one clean download.

    HMI and touchscreens

Why GP-Pro EX imported tags stay UNDEFINED with an S7-1500