Centralizing HMI Tooltips in TIA Portal WinCC: Best Practices
Tooltips in WinCC Comfort/Professional and WinCC RT Advanced/Professional are most often entered as static strings directly on each symbol's Tooltip property. That approach is acceptable for a single screen with a handful of I/O fields, but it scales poorly. Once a project grows past one operator panel, three screens, or one translation round, the tooltip text becomes scattered across dozens of property dialogs and is impossible to find, group, or update without opening every picture.
This reference documents two field-proven methods for centralizing tooltip text inside a TIA Portal project: an internal-tag + global VBScript action approach using SetTagChar, and a Text Library + TextRef internal tag approach. Both remove the need to open the picture editor for text edits and both enable consistent grouping for translator hand-off, code review, and bulk find/replace.
1. Prerequisites
- TIA Portal V15.1 or later (V16+ recommended for stable Unicode handling in WString tags). Earlier versions work but the Unicode behavior described in Section 9 requires V14 SP1 or later.
- WinCC Comfort, WinCC Professional, WinCC RT Advanced, or WinCC RT Professional target.
- HMI tags already configured with the names used in the symbol's Tag property.
- For Method 2: a project with at least one Text Library configured under Project languages > Texts.
- For Method 1: VBScript scripting rights enabled on the runtime (default in Comfort/Professional panels; verify under Runtime settings > Services > Scripts).
HMIRuntime.Tags). The two methods below apply to the Classic WinCC line. WinCC Unified uses the multilingual Text Library natively without a script.2. The Tooltip Centralization Problem
Direct tooltip text on a symbol has three structural disadvantages:
- No central index. A reviewer cannot list "all tooltips mentioning PUMP" without opening every picture.
- No source-controlled text. Changes are made inside the binary HMI database, not in a text file you can diff.
- Translation breakage. Multilingual projects require re-entering every tooltip string per language; an entry missed in one picture silently falls back to the reference language.
Centralizing the tooltip text into either a set of named internal tags or a Text Library entry resolves all three. Both approaches make the tooltip text a discrete, named, greppable object.
3. Method 1 - Internal Tags with a Global VBScript Action
This is the most direct method and requires no Text Library. You declare one internal HMI tag per tooltip, then populate every tag from a single global VBScript action that runs on a trigger.
3.1 Declare Internal Tags
Open HMI Tags > Default tag table (or a dedicated "Tooltips" tag table) and add a WString internal tag per tooltip:
| Tag name | Data type | Length | HMI | PLC |
|---|---|---|---|---|
| DIN_00_00_TT | WString | 254 | Internal | (none) |
| DIN_00_01_TT | WString | 254 | Internal | (none) |
| AIN_03_02_TT | WString | 254 | Internal | (none) |
| MOT_PUMP_01_TT | WString | 254 | Internal | (none) |
WString is preferred over String because it preserves Unicode characters for non-Latin project languages (Chinese, Cyrillic, Arabic). Siemens WinCC Classic limits tooltip text to 254 characters in WString and 16/32-character chunks in legacy String types; staying at or below 250 visible characters keeps every runtime within spec.
3.2 Build a Global Action
Open Scripts > Global Scripts in the project tree and create a new VBScript action. Choose trigger Time and set the interval to a value appropriate for your runtime. For a panel project that boots the script once and never needs updates, use a 1-minute interval with a guard flag:
'------------------------------------------------------
' Centralized tooltip text - master table.
' Edit this file to update tooltip strings site-wide.
'------------------------------------------------------
If SmartTags("TT_INIT_DONE") = False Then
SetTagChar "DIN_00_00_TT", " PUMP NO.1 RUNNING"
SetTagChar "DIN_00_01_TT", " PUMP NO.1 AVAILABLE"
SetTagChar "DIN_00_02_TT", " PUMP NO.1 FAULTED - CHECK SEAL"
SetTagChar "AIN_03_02_TT", " DISCHARGE PRESSURE (BAR)"
SetTagChar "MOT_PUMP_01_TT", " PUMP NO.1 STARTER STATUS"
' Header / chrome
SetTagChar "HDR_USER_TT", " LOGGED IN OPERATOR ID"
SetTagChar "HDR_TIME_TT", " CURRENT PLC TIME (UTC)"
SmartTags("TT_INIT_DONE") = True
End If
3.3 Trigger Configuration
| Use case | Trigger type | Recommended interval |
|---|---|---|
| Static tooltip text (no runtime changes) | Time | 10 s, guarded by TT_INIT_DONE
|
| Dynamic tooltips containing process values | Tag trigger on every involved tag | Event-driven, no interval |
| Operator-driven re-translation hot-swap | Tag trigger on language-change flag | Event-driven |
For dynamic content (e.g., tooltip showing live pump speed), do not poll the tag inside a script - bind the tooltip directly to a tag whose value is set elsewhere. Polling inside a global action at sub-second rates wastes CPU on every Comfort panel.
4. Naming Conventions for Tooltip Tags
The tag name itself is the index. Adopt a prefix discipline early; renaming tags across an entire project after commissioning is expensive.
| Pattern | Meaning | Example |
|---|---|---|
<IO>_<area>_<offset>_TT |
Mirrors the underlying I/O tag | DIN_03_05_TT |
MOT_<equipment>_TT |
Equipment-level tooltip | MOT_PUMP_01_TT |
HDR_<section>_TT |
Screen chrome / header | HDR_TIME_TT |
NAV_<button>_TT |
Navigation buttons | NAV_TREND_TT |
TT_<purpose> |
Singleton tags for global info | TT_INIT_DONE |
Keep the suffix _TT reserved exclusively for tooltip tags. A simple project-wide search for _TT then lists every tooltip in the program.
5. Method 2 - Text Library with TextRef Internal Tags
Method 1 is purely procedural. The WinCC Text Library offers a data-driven alternative that integrates with the project translation workflow.
5.1 Configure the Text Library
- In the project tree, open Languages & Resources > Project texts > Text Library.
- Add a new range called
TOOLTIPS. Use a contiguous ID block, for example10000-10999, to leave room for growth. - Add one entry per tooltip. Each entry takes a unique ID inside the range and one string per project language.
| ID | Reference language (EN) | German (DE) | Comment |
|---|---|---|---|
| 10000 | Pump No.1 running | Pumpe 1 läuft | Status indicator |
| 10001 | Pump No.1 available | Pumpe 1 verfügbar | Availability |
| 10002 | Discharge pressure (bar) | Förderdruck (bar) | Analogue value |
5.2 Declare TextRef Internal Tags
Inside the default tag table, add one TextRef-type internal tag per tooltip. TextRef is a 32-bit tag whose value is the Text Library ID; the runtime resolves the ID into the current-language string.
Name: TT_PUMP_01_RUN
Data type: TextRef
Length: (n/a)
Start value: 10000
HMI: Internal
Set the Start value to the Text Library ID you assigned in step 5.1. The Start value is what the runtime displays before any code runs.
5.3 Bind the Tag to the Symbol Tooltip
- Open the picture that contains the I/O field or symbol.
- Select the symbol, open Properties > Properties > Miscellaneous > Tooltip.
- In the dynamic column, click the wizard and select HMI tag > TT_PUMP_01_RUN.
At runtime, WinCC evaluates the TextRef tag, looks up the ID in the current language's Text Library, and renders the resolved string as the tooltip. No script required.
SetTagChar because no script cycle is involved. On Comfort panels, this difference is negligible; on RT Professional with hundreds of tooltips per screen, TextRef is preferred.6. Method Comparison
| Criterion | Method 1: SetTagChar + Internal Tag | Method 2: TextRef + Text Library |
|---|---|---|
| VBScript required | Yes | No |
| Multilingual workflow | Manual - one literal per language | Native - one ID, many translations |
| Translation export/import | No | Yes - via Texts > Export |
| Source-controllable in GIT/SVN | Yes (the .vb file) | Partial - text table in the project file |
| Dynamic tooltip with live process value | Trivial - compose string in script | Difficult - Text Library IDs are static |
| Comfort panel compatibility | All versions | WinCC V14 SP1+ |
| WinCC Unified | No - SetTagChar not available | Yes - Text Library is native in Unified |
| Startup cost | One global action trigger | None - resolved on demand |
| Re-translation at runtime | Yes - re-fire the global action on language change | Yes - automatic when language switches |
Recommendation: Use Method 2 (TextRef) by default for any project with more than one project language or more than ~50 tooltips. Use Method 1 when tooltips must embed live process values that the Text Library cannot express (e.g., a tooltip showing the last alarm timestamp).
7. Mixing Both Methods
Method 1 and Method 2 can coexist. A common pattern is:
- Static, translatable tooltips: TextRef.
- Dynamic tooltips with embedded values: SetTagChar inside a global action, with the script reading source tags at trigger time and concatenating strings.
- Navigation buttons: TextRef entries, since they never contain process data.
Reserve the _TT suffix for the SetTagChar tags and a different suffix (e.g., _TXT) for TextRef tags so a single project-wide search distinguishes the two categories.
8. Linking the Tag to the Symbol's Tooltip Property
For both methods, the wiring step is identical:
- Select the symbol on the picture.
- Open Properties > Properties > Miscellaneous > Tooltip.
- Click the small lightning-bolt icon in the dynamic column.
- Select the corresponding internal tag (WString tag for Method 1, TextRef tag for Method 2).
- Compile the project.
If the lightning-bolt icon is greyed out, the symbol type does not expose Tooltip as a dynamic property. I/O Field, Button, Symbolic IO Field, and most standard WinCC controls do; some custom ActiveX controls do not. For unsupported controls, Method 1's SetTagChar can still be used to update an adjacent text element that visually approximates the tooltip.
9. Character Limits and Unicode
| Property | Limit | Notes |
|---|---|---|
| Tooltip visible characters (Comfort) | ~250 recommended | Longer strings are truncated or wrapped inconsistently across panel sizes. |
| WString internal tag | 254 chars max | Configured at tag declaration. |
| TextRef internal tag ID | 32-bit signed | IDs are integers, not strings. |
| ~500 chars recommended | Per language, per entry. | |
| SetTagChar input | 254 chars max | Same as the target tag length. |
For non-Latin project languages (Chinese, Japanese, Korean, Cyrillic, Arabic, Hebrew), always use WString tags and TextRef; legacy String types lose characters above 0x7F unless the project codepage matches. In TIA Portal V16+, the script editor saves .vb files as UTF-8 by default - confirm under Options > General > Script editor.
10. Commissioning and Verification
- Compile and download the project to the target panel or RT PC.
- Open the runtime and force a tag update:
- For Method 1: open the HMI tag online monitor and confirm each
*_TTtag holds its expected string. - For Method 2: switch the runtime language via the language switch button and confirm the tooltip text changes accordingly.
- For Method 1: open the HMI tag online monitor and confirm each
- Static text review: export the Text Library (Method 2) or the global action source file (Method 1) and hand to translation.
- Functional review: on each picture, hover every symbol that has a tooltip and confirm the rendered string matches the spec.
- Regression check: if your project also uses Cross-reference, search for the tooltip tags to confirm every picture that consumes them is listed.
*_TT tag. Setting its Output mode to Output and Mode to "Output" makes the field display the resolved tooltip text at runtime. This catches missing or empty tooltip tags before they reach the operator.11. Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
| Tooltip empty at runtime (Method 1) | Global action never fired; trigger interval too long; guard flag set true before SetTagChar completed | Reduce trigger interval to 1 s for first run, confirm TT_INIT_DONE logic, enable script trace |
| Tooltip shows ID number (Method 2) | TextRef ID has no entry in the Text Library, or entry is untranslated in active language | Add the missing ID; ensure every active project language has the translation |
| Tooltip shows "???" or boxes | Codepage mismatch on legacy String tags with non-ASCII characters | Convert tag type to WString; confirm script file encoding is UTF-8 |
| SetTagChar runtime error "Object required" | Tag name typo; tag is not internal; tag does not exist in current HMI tag table | Validate tag exists, is internal, spelling matches exactly (case-sensitive) |
| Tooltip text changes lag behind process value | Global action interval too long, or guard flag preventing re-execution | Use tag trigger instead of time trigger; remove the TT_INIT_DONE guard |
| Some tooltips translated, others not (Method 2) | Text Library entries missing translations for those IDs | Run Texts > Check consistency; export and re-import complete translation file |
| Tooltip truncated mid-word | Underlying tag length shorter than the assigned string | Increase WString length; trim source text to fit |
| Symbol's Tooltip property cannot be dynamized | Symbol type does not expose Tooltip as dynamic property | Replace with a supported control; use adjacent text element updated by SetTagChar |
12. Migrating from Method 1 to Method 2
For projects that grew up on the SetTagChar method and now require translator hand-off, a one-time migration is straightforward:
- List every
*_TTtag and its current string. - For each, create a Text Library entry in the
TOOLTIPSrange and note the new ID. - Create a TextRef internal tag with the new ID as Start value.
- Re-point each symbol's Tooltip dynamic link from the WString tag to the TextRef tag.
- After visual verification, delete the old WString tags and the global action body that wrote them.
The migration is mechanical and does not require screen re-engineering. Keep the old *_TT tags as unused internal for at least one commissioning cycle in case a picture was missed.
13. Related References
For deeper background on the WinCC Text Library and project text management, the official Siemens Industry Online Support entry on tooltip configuration (FAQ ID 30104073) describes the canonical usage of Text Library entries with TextRef tags in WinCC Comfort/Professional projects.
What is the maximum tooltip length in WinCC Comfort/Professional?
The underlying WString internal tag supports up to 254 characters, but visible tooltip rendering on Comfort panels is reliable only up to about 250 characters. Longer strings wrap inconsistently or get clipped depending on panel resolution.
Can I use multiple project languages with the SetTagChar method?
Yes, but you must maintain one literal per language inside the global action and switch the SetTagChar call set when the active language changes. The TextRef + Text Library method handles language switching automatically and is preferred for any project with more than one language.
Why does my SetTagChar tooltip never appear at runtime?
Three common causes: (1) the trigger interval on the global action is too long - reduce it for the first run; (2) the guard flag is set to True before SetTagChar completes - move the flag assignment to the end of the script; (3) the tag name in the SetTagChar call does not match a declared internal tag (names are case-sensitive).
Which method performs better: SetTagChar or TextRef?
TextRef performs better at runtime because the lookup is part of WinCC's built-in text management path and does not consume script execution time. SetTagChar adds VBScript interpreter load proportional to the number of tags assigned per trigger cycle. On RT Professional with hundreds of tooltips, TextRef is the better choice.
Can I use both methods in the same project?
Yes. Use TextRef for static, translatable tooltips and SetTagChar for tooltips that embed live process values (e.g., "Last alarm: 14:32:07"). Use distinct suffixes (_TT for WString tags, _TXT for TextRef tags) so a project-wide search distinguishes them.