Configuring Min/Max Range Display on TIA Portal HMI Keypad

David Krause13 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

Problem Statement: Range Values Missing on the Runtime Keypad

When an operator taps an I/O field on a Siemens Comfort Panel, KTP, or WinCC Runtime Advanced/Professional screen, the numeric or alphanumeric keypad opens for value entry. Engineers frequently want the configured minimum and maximum limits to be displayed on that keypad so the operator can see the valid entry range before typing. By default, the keypad only echoes the current tag value; the configured limits are not surfaced unless they are bound to the correct property of the correct object.

The most common root cause for missing range display is that the engineer is editing the I/O field properties instead of the HMI tag properties. The Range field (Value range from / Value range to) lives on the HMI tag, not on the input control. Once the tag is constrained, WinCC automatically renders those values on the runtime keypad whenever the tag is bound to a configured I/O field.

This article targets SIMATIC WinCC in the TIA Portal (V13 SP1 through V17/V18). The HMI tag range behavior described here applies to the Comfort Panels (TP700–TP2200), KTP Mobile Panels, WinCC Runtime Advanced (PC-based), and WinCC Runtime Professional. The legacy WinCC flexible 2008 SP5 path uses a different property sheet and is documented separately in the WinCC flexible manual on the Siemens Support portal.

Architectural Background: Tag Properties vs. Screen-Object Properties

WinCC TIA Portal separates tag configuration from screen-object configuration. This separation matters for range display:

Object Where to find it Holds range limits? Drives keypad display?
HMI Tag Project tree → HMI Tags → [tag name] Yes — Value range from / Value range to Yes
I/O Field Screen → select field → Properties pane No (only a Process Value and Display Format) Indirect — only via the bound tag
Symbolic IO field Screen → select → Properties → Text list No (list of strings) No — uses dropdown, not numeric keypad

Because the range is a tag-level attribute, every screen object that uses the same tag inherits the same limits and therefore the same keypad behavior. Changing the limit in the tag immediately propagates to every consumer, including the runtime keypad.

Prerequisites

  • SIMATIC TIA Portal V13 SP1, V14, V14 SP1, V15, V15.1, V16, V17, or V18 installed with the matching WinCC component.
  • An HMI device added to the project (Comfort Panel, KTP, or WinCC RT Advanced / Professional target).
  • An HMI tag already created, with a connected PLC tag (e.g. S7-1200/S7-1500 DB member or input word).
  • Project compiled successfully; HMI device and PLC in the same subnet or routed via gateway.
  • For scripted access: WinCC RT Advanced — VBScript; WinCC RT Professional — C / VB script or the WinCC OA-tag API.

Step-by-Step: Configure the HMI Tag Range

  1. Open the HMI Tags editor. In the project tree, expand your HMI device, right-click HMI Tags, and select Show HMI Tags (or simply double-click HMI Tags).
  2. Select the tag that is bound to the I/O field on your screen. If the tag does not exist yet, click Add new in the top toolbar to create one and link it to a PLC variable via the connection editor.
  3. Switch to the Properties tab at the bottom of the HMI tags table (not the Settings column on the right). In TIA V14 and later, the Properties inspection window for the selected tag appears on the right side of the screen.
  4. Expand the Range group. You will see the fields Value range from and Value range to. Both accept constants or symbolic constants.
  5. Enter the lower and upper limits as constants appropriate for the tag data type. Examples:
    • Integer (Int) tag: 0 to 100
    • Real (Float) tag: 0.0 to 100.0
    • Word tag used as percentage: 0 to 27648 (Siemens S7 analog raw range)
    • BCD-coded hour: 0 to 23
  6. Confirm. Press Enter or click outside the field. The value is stored in the tag definition, not in the screen object.
  7. Compile the HMI station (right-click the HMI device → Compile → Software (only)) and download to the panel or start the runtime simulation.
  8. Test on the runtime. Open the screen, tap the I/O field, and the numeric keypad appears with the configured min and max shown in the header. If the value entered by the user is out of range, WinCC rejects the entry and reverts to the previous value (with a system message if alarms are enabled).

Step-by-Step: Confirm the I/O Field is Bound Correctly

  1. Open the screen that contains the I/O field.
  2. Select the I/O field. In the Properties pane, expand General → Process Value.
  3. Confirm the Tag dropdown shows the same HMI tag you just configured. If the field is unbound, drag the tag from the HMI Tag table onto the I/O field, or use the tag picker.
  4. Expand Appearance → Display Format and verify the data type matches the tag (e.g. decimal, signed integer). A mismatch will suppress the range display even when limits are set.
  5. Optionally enable Limits → Display limit values on the I/O field to also show the limits next to the I/O field in the screen background, not just on the keypad.

Reading the Range Limits from a Script

Engineers who want to display the range inside custom dialogs or pass the limits to PLC logic can read them programmatically. The API depends on the runtime flavor.

VBScript in WinCC Runtime Advanced (TIA V13–V17)

WinCC RT Advanced supports a tag-info object that exposes the configured range:

Dim oTag
Set oTag = HmiRuntime.Tags("MyTag")
oTag.Read

' Read configured range from the tag info object
Dim lo, hi
lo = oTag.LowLimit
hi = oTag.HighLimit

SmartTags("MinDisplay") = lo
SmartTags("MaxDisplay") = hi

The LowLimit and HighLimit properties are populated from the HMI tag configuration and are read-only at runtime. For multi-user panels, each client reads its local cache.

C / VB in WinCC Runtime Professional

In WinCC RT Professional, the configured limits are exposed via the tag configuration interface (C# or VB):

// C# example for WinCC Professional
HMITag tag = (HMITag)HMIProject.TagProvider.Find("MyTag");
double min = tag.LimitLow;
double max = tag.LimitHigh;
HMITag.SetTagValue("MinDisplay", min);
HMITag.SetTagValue("MaxDisplay", max);

Legacy WinCC (V7) Compatibility

The classic functions GetTagRangeMin() and GetTagRangeMax() are WinCC (V7) C-script functions, not TIA Portal. In TIA-based panels, use the runtime-API equivalents above. Attempting to call GetTagRangeMin in a TIA V13/V14 VB script returns an empty value because the symbol is not registered.

Version-Specific Notes (V13 SP1, V14, V15, V16, V17, V18)

TIA Version Behavior Notes
V13 SP1 Range field present in HMI Tag → Properties → Range. Oldest branch to expose the runtime keypad range header. No "Display limit values" on the I/O field yet.
V14 / V14 SP1 Range property is exposed under Properties → Value range; UI labels updated to "Value range from / to". Scrolling inspection window now groups settings; engineers may miss the "Range" node if they stay on the Settings column.
V15 / V15.1 Added support for symbolic limits using project constants (PLC tag constants and HMI constants). You can bind the limit to a central constant that is then changed once for all consumers.
V16 Unified Runtime Advanced and Professional API for range read; added LimitLow / LimitHigh on the C# tag interface. Older VBScript LowLimit still works but is marked as deprecated in code help.
V17 / V18 No functional change. Range display is enabled by default. New: "Show limit value on input field" toggle added to Comfort Panel Global Screen settings. Engineers migrating from V14 who do not see the limits should check that "Display limit values" is enabled on the I/O field, not on the HMI tag.

Edge Cases and Common Pitfalls

1. Range configured but not visible on the keypad

  • The tag's data type does not match the entered constants. For example, typing 100.5 into an Int tag silently coerces the upper limit to 100, and the keypad header shows 0 - 100, not 0 - 100.5.
  • The I/O field is configured as Output (display only). Output fields do not show the keypad, so no header is rendered.
  • The HMI tag is configured as an Array element or UDT member and the range is set on the parent, not on the element bound to the I/O field. Range is per-tag, not per-structure.

2. Range set on the wrong tag

If two tags share a name across multiple HMI devices (e.g. HMI_Tag_1 on the panel and a different HMI_Tag_1 on the WinCC RT PC), the range must be configured on the HMI tag that is actually used by the screen in the running target. Inspect the Properties of the in-screen process value to confirm.

3. Symbolic limits not resolving

When using a project constant (e.g. SP_HIGH = 1000) as a limit, the constant must be declared under PLC → PLC tags → User constants or HMI → HMI tags → User constants. Local function-block constants are not visible to the HMI tag editor.

4. Migrated projects from WinCC flexible

WinCC flexible stored the range on the I/O field. After migration to TIA Portal, those limits are copied to the HMI tag, but the I/O field's old range field is read-only. Do not edit the migrated I/O field; edit the HMI tag instead.

5. Touch panel with reduced keypad

On very small panels (KTP400), the runtime keypad is a compact variant. The min/max header is rendered only when both limits are non-zero. If either limit is 0, the header is suppressed to save screen real estate. Set explicit limits even if the desired minimum is zero, by configuring it as a constant 0 in the tag.

Verification Procedure

  1. Compile the HMI project. Warnings about "Tag <X> has an invalid value range" indicate that the lower limit is greater than the upper limit, or the limits overflow the data type.
  2. Start the runtime (RT simulation or panel download).
  3. Navigate to the screen with the configured I/O field.
  4. Tap the I/O field. The runtime keypad must display the configured min on the left and max on the right of the input row.
  5. Enter a value above the max or below the min. The runtime must reject the value and the original value must remain. If a configured alarm is present, an event is generated in the alarm log.
  6. If the keypad does not show the limits, perform the cross-check described in the troubleshooting matrix below.

Troubleshooting Matrix

Symptom Likely Root Cause Remediation
Keypad opens but no min/max shown Range field on HMI tag is empty Open HMI tag → Properties → Range → enter Value range from and to
Keypad shows one of the limits as 0 Limit is below the data type's lower bound and was silently clamped Widen the data type (Int → DInt) or use a higher minimum
Range visible on simulator, not on the physical panel Compiled project not downloaded, or the panel is running an older image Recompile and download to panel; verify version in Panel → System → Information
Limits reset after PLC download PLC download rewrites constants used as limits Use HMI constants for the range, not PLC constants
Limits correct, but entry accepted out of range I/O field configured with Mode = Output in addition to input Switch the I/O field to Input or Input/Output
VBScript LowLimit returns 0 for a configured range Tag is read from PLC and range is set on a different tag in the project Compare the tag name string in the script to the exact HMI tag name; HMI tag names are case-sensitive
Range shows on tag A but not on tag B with the same value Tag B is an external tag with a different driver; range must be set on each external tag Configure the range on the external tag's properties as well
GetTagRangeMin() returns nothing Function is WinCC V7 only, not available in TIA Portal VBScript Use HmiRuntime.Tags("...").LowLimit instead

Performance and Memory Considerations

Configuring range limits on the HMI tag imposes a negligible memory cost (two 64-bit doubles stored in the tag configuration block). At runtime, the limits are read once per tag on tag-internal initialization and cached. There is no measurable performance impact for panels with up to 4,096 tags. For very large projects (> 32,000 tags) where every tag carries range metadata, the on-flash HMI image size grows by approximately 32 bytes per tag; this is rarely a constraint on current Comfort Panel flash sizes (8–24 MB).

Cross-Platform Mapping: S7-1200 / S7-1500 PLC Side

The range displayed on the HMI keypad is purely an HMI-side enforcement. The PLC tag has its own validation. To keep both sides consistent, store the limits in a single PLC data block (e.g. DB_Config) and reference them from the HMI tag configuration as symbolic constants. This avoids the classic mismatch where the HMI accepts 0–100 but the PLC program uses 0–27648 for the same variable, leading to confusing rejections.

// S7-1500 / S7-1200 SCL: single source of truth
DATA_BLOCK "DB_Config"
  STRUCT
    SetPoint_Min : REAL := 0.0;
    SetPoint_Max : REAL := 100.0;
  END_STRUCT;
END_DATA_BLOCK

Then on the HMI tag, set Value range from = DB_Config.SetPoint_Min and Value range to = DB_Config.SetPoint_Max (TIA V15 and later symbolic link).

Summary and Best Practice

  • Always configure the range on the HMI tag, never on the I/O field. The I/O field is a display/entry wrapper; the tag carries the contract.
  • Use a single source of truth (PLC DB or HMI project constant) for the limits, and reference it from the HMI tag to keep HMI and PLC in sync.
  • Validate data types when entering constants to avoid silent coercion.
  • Use the runtime API (LowLimit / HighLimit) for scripted display rather than hard-coding the values in your script.
  • Recompile and re-download the HMI image after every tag-range change; a stale panel image is the single most common cause of "limits don't show" tickets.
  • Document the version. The behavior is consistent from V13 SP1 onward, but UI labels and inspection-window layout differ — a screenshot saved with the project helps the next engineer.

FAQ

Where exactly do I enter the min and max for the keypad display in TIA Portal?

Open the HMI Tags editor, select the tag, and switch to the Properties inspection window. Expand the "Range" group; the "Value range from" and "Value range to" fields drive the keypad header. The I/O field on the screen does not hold these limits.

Why does my keypad not show the configured range?

Most often the range is empty on the HMI tag, or the I/O field is bound to a different tag. Verify that the I/O field's Process Value points to the same tag whose Properties → Range fields you filled in, and that the project was recompiled and downloaded.

Can I read the configured min and max from a VBScript?

Yes. Use HmiRuntime.Tags("MyTag").LowLimit and HmiRuntime.Tags("MyTag").HighLimit in WinCC Runtime Advanced. The legacy WinCC V7 functions GetTagRangeMin() / GetTagRangeMax() are not available in TIA Portal VBScript.

What changed between TIA V13 and V17 regarding range display?

Functionally, little: the range has always been a tag-level property in TIA Portal. The UI evolved: V14 moved the field into the "Value range" group; V15 added symbolic constants; V17 added a global toggle to display limit values on the I/O field. Underlying runtime behavior is identical.

Why does the runtime still accept values outside the configured range?

The range on the HMI tag is an HMI-side guard only. If the I/O field's Mode is set to Output, or if the entry is being written directly through a script that bypasses the I/O field, the range is not enforced. For PLC-side enforcement, add limit checks in the user program (e.g. IF value > MAX THEN value := MAX; END_IF;).

Back to blog