Displaying the Loaded Parameter Set in WinCC Unified HMI

David Krause14 min read
HMI / SCADASiemensTutorial / 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

Displaying the Loaded Parameter Set in WinCC Unified HMI

Tracking which parameter set (recipe) is currently active in the PLC is a recurring requirement on SIMATIC WinCC Unified panels. The built-in properties of the Parameter Control (PACO) do not expose a reliable "last loaded ID", so engineers typically combine PACO events, custom load buttons, system functions, and JavaScript to surface the active set on screen. This reference documents a field-proven pattern for TIA Portal V19 with a CPU 1511-1 PN and a MTP1500 Unified Comfort Panel.

Scope: One parameter-set type with approximately five parameter sets, a single operator screen, an S7-1500 PLC, and a Unified Comfort Panel running the V19 runtime. The pattern also applies to larger recipe systems and to WinCC Unified PC Runtime.

1. Problem Statement

The configuration compiles, the parameter sets are written to the panel, and recipes can be loaded to the controller. What does not work out of the box is the operator display: an IO field, symbolic IO field, or text field that shows the identifier (and ideally the human-readable name) of the parameter set that was most recently transferred to the PLC.

Two naive approaches fail in production:

  • Binding a tag to PACO's Current parameter set ID property. This value updates every time the operator browses the recipe list (scroll, search, selection highlight) regardless of whether a load action was issued. The panel reports a different ID than the PLC is actually running on.
  • Subscribing to the Command fired event of the Parameter Control. This event fires on any button press inside PACO — navigation, filter, sort, cancel, rename — not exclusively on the load action. A naive subscriber will store a parameter set ID every time the operator touches the screen.

The fix is to capture and store the parameter set ID yourself, in a tag that the PLC and the HMI both trust, and refresh it on the right trigger using the ReadParameterSetName system function.

2. Reference Architecture

The minimal hardware/software stack required by the pattern:

Component Selection Notes
Engineering TIA Portal V19 (Engineering V19, WinCC Unified V19) Released 2023; runtime projects must be opened in V19 to use the latest PACO event set.
PLC SIMATIC S7-1500 CPU 1511-1 PN (6ES7511-1AK02-0AB0), firmware ≥ V2.9 Any S7-1500 CPU with PROFINET works; the 1511-1 PN is the most common entry-level variant.
HMI MTP1500 Unified Comfort (6AV2128-3KB06-0AX0), 15" multitouch, WinCC Unified V19 runtime Same pattern works on MTP700/MTP1000/MTP1200/MTP1900/MTP2200 Unified Comfort and on the PC Runtime.
Connection HMI tag connection via PROFINET or OPC UA; integrated S7 connection to the CPU 1511-1 PN is the default. Keep the connection name short; it appears in every PACO event tag reference.
Parameter sets One parameter-set type, ~5 parameter sets, single-record Multi-record parameter sets are handled the same way; only the Record ID tag is added.

Refer to the official hardware manuals for the wiring and the supported firmware combinations:

3. Why the Built-In PACO Properties Are Not Sufficient

The Parameter Control object in WinCC Unified exposes a number of useful state properties, but they are browse properties, not load properties. The relevant fields are:

Property / Event Source Updates when Reliable for "loaded set"?
Current parameter set ID PACO state Operator selects, scrolls, filters, or sorts the recipe list No — changes without any load action.
Command fired (event) PACO event Any button press inside PACO (load, save, delete, rename, navigation, cancel, filter) Only as a trigger; you must inspect the command ID.
Parameter set ID (input) Configuration interface Before issuing a load/save Yes — this is the value you told PACO to load.
Job ID (input) Configuration interface Before issuing a load/save Yes — used to correlate asynchronous responses.
Status / Error code PACO state After a load completes (success or failure) Yes — required to confirm the load actually finished.

Consequence: any UI that binds directly to Current parameter set ID will display the operator's selection, not the controller's active set. The two diverge the moment the operator opens the recipe dialog without committing a load.

4. Solution A — Custom Load Button with ReadParameterSetName

The first pattern replaces the PACO's built-in "Load to PLC" button with your own screen button. This gives you full control over when the ID is captured.

4.1 Wiring the configuration interface

  1. Open the Parameter Control's configuration dialog in the HMI screen.
  2. Under Parameter set type, select the parameter-set type that should be loaded from this control.
  3. Wire the following configuration tags:
    • Parameter set ID → HMI tag HMI_ParamSetID_Select (DInt)
    • Job ID → HMI tag HMI_JobID (DInt)
  4. Wire the state side:
    • Current parameter set ID → HMI tag HMI_ParamSetID_Display (DInt) — used by PACO internally; the screen does not bind to it.
    • Status → HMI tag HMI_LoadStatus (DWord)

4.2 Build the custom load button

Place a screen button next to the PACO. Wire its Press event to LoadParameterSet with the configured parameter-set type and the desired parameter set ID. Wire its Release event to a JavaScript action that calls ReadParameterSetName and writes the result into a persistent HMI tag.

4.3 Persist the result

Create two HMI tags that survive navigation, with retentive behaviour if your runtime supports it (Unified panels persist across screen changes, but the tag values are RAM-only by default):

  • HMI_LoadedParamSetID (DInt) — last ID successfully transferred to the PLC.
  • HMI_LoadedParamSetName (WString[64]) — the human-readable name of that set.
If you also need the parameter values themselves on screen, mirror the active set's element list into a structured tag (e.g. HMI_ActiveRecipeElements) and bind the IO fields to its members. ReadParameterSetName only returns the name; the values come from the standard element tags already bound to the parameter set type.

5. Solution B — PACO "Command fired" Event with ID Filter

If you prefer to keep the standard PACO toolbar visible (so operators can use the integrated load/save/delete buttons), use the Command fired event as a trigger and filter the command ID to isolate the actual Load action.

5.1 The Command fired event

The event signature exposes the originating command ID. In V19, the load-recipe command is delivered as a numeric command ID; navigation, search, and sort commands have different IDs. A typical pattern is to keep a small dispatch table:

// Dispatch table for Parameter Control "Command fired" event
// 1 = Load parameter set, 2 = Save parameter set, 3 = Delete,
// 4 = Rename, 10..99 = navigation/filter/sort (ignore for our purpose)
const CMD_LOAD_PARAM_SET = 1;

5.2 Filter and capture

  1. Add a JavaScript function on the screen, for example OnPacoCommandFired(params).
  2. Read params.CommandId. If it equals CMD_LOAD_PARAM_SET, copy the current value of HMI_ParamSetID_Select (the Parameter set ID configuration tag) into HMI_LoadedParamSetID and call HMIRuntime.Recipe.ReadParameterSetName(...) to populate HMI_LoadedParamSetName.
  3. For every other command ID, do nothing. This is what makes the difference between "any button" and "the load button".
The exact command IDs depend on the PACO configuration. Use the runtime trace (Tools → Trace → PACO in the engineering view) to enumerate the IDs that your specific configuration emits. Do not hard-code IDs from another project.

6. Step-by-Step Implementation in TIA Portal V19

  1. Create the parameter-set type. In the project tree, expand Recipes / Parameter sets, add one parameter-set type (e.g. PT_Process) with the elements you want to expose. Configure the storage location to point to the panel (default) or to a network share.
  2. Add parameter sets. Create five parameter sets under PT_Process with descriptive names such as PS_LineA_Default, PS_LineA_HighSpeed, PS_LineA_LowTemp, PS_LineA_Cleaning, PS_LineA_Test.
  3. Place the Parameter Control on the screen. Drag the Parameter Control object from the toolbox onto your main screen. In its properties, bind the parameter-set type to PT_Process.
  4. Wire the configuration tags. As described in section 4.1.
  5. Add the persistent display tags. In the HMI tag table, create HMI_LoadedParamSetID (DInt) and HMI_LoadedParamSetName (WString[64]).
  6. Add the IO field(s) for display. Place an IO field on the screen. Mode = Output. Process value = HMI_LoadedParamSetID. For the name, place a Symbolic IO field or a text field with process tag = HMI_LoadedParamSetName.
  7. Attach the load capture logic. Either use Solution A (custom button) or Solution B (PACO event filter). Use a JavaScript action for the event handler; see section 7 for the snippet.
  8. Compile and download. Compile the HMI and the PLC, download both targets, and restart the panel when prompted.

7. JavaScript Implementation

The following snippet illustrates the runtime side of both solutions. Adapt the tag and command-ID values to your project.

// --------------------------------------------------------------
// WinCC Unified V19 — capture the loaded parameter set ID
// --------------------------------------------------------------
// Persistent HMI tags:
//   HMI_LoadedParamSetID   (DInt)
//   HMI_LoadedParamSetName (WString[64])
// Configuration tags of the Parameter Control:
//   HMI_ParamSetID_Select  (DInt)  — "Parameter set ID" input
//   HMI_JobID              (DInt)  — "Job ID" input
//   HMI_LoadStatus         (DWord) — status output
// --------------------------------------------------------------

// Numeric command ID emitted by PACO for "Load to PLC".
// Determine this by tracing the runtime; do not assume.
var CMD_LOAD_PARAM_SET = 1;

// PACO "Command fired" event handler (Solution B).
function OnPacoCommandFired(params) {
    try {
        if (!params || params.CommandId !== CMD_LOAD_PARAM_SET) {
            return; // ignore navigation, sort, filter, etc.
        }
        var selected = Tags("HMI_ParamSetID_Select").Read();
        Tags("HMI_LoadedParamSetID").Write(selected);

        // Resolve the human-readable name.
        // ReadParameterSetName returns the name of the parameter set
        // currently identified by ParameterSetID in the given type.
        var pst = "PT_Process";
        var psid = selected;
        var lang = UI.Language;
        var name = HMIRuntime.Recipe.ReadParameterSetName(pst, psid, lang);
        if (name !== null && name !== undefined) {
            Tags("HMI_LoadedParamSetName").Write(String(name));
        }
    } catch (e) {
        // Log to the HMI diagnostics; never throw to the panel UI.
        HMIRuntime.Trace("OnPacoCommandFired error: " + e.message);
    }
}

// Press / Release handlers for the custom load button (Solution A).
function OnCustomLoadPress() {
    // Issue the load using the standard system function call.
    // Tag values were already written by the IO field bound to
    // HMI_ParamSetID_Select before this press event.
    HMIRuntime.Recipe.LoadParameterSet("PT_Process",
        Tags("HMI_ParamSetID_Select").Read(),
        Tags("HMI_JobID").Read(),
        /* overwrite */ true);
}

function OnCustomLoadRelease() {
    // On release — fetch the name and persist ID + name.
    var psid = Tags("HMI_ParamSetID_Select").Read();
    Tags("HMI_LoadedParamSetID").Write(psid);
    var name = HMIRuntime.Recipe.ReadParameterSetName(
        "PT_Process", psid, UI.Language);
    if (name) {
        Tags("HMI_LoadedParamSetName").Write(String(name));
    }
}
The exact API surface (e.g. HMIRuntime.Recipe.LoadParameterSet versus the older LoadDataRecord name) depends on the runtime version. Always confirm method names against the WinCC Unified V19 scripting reference. The four-argument form shown above is valid in V19 with overwrite controlled by the trailing boolean.

8. HMI Tag Wiring and PLC Considerations

The PLC side of the pattern is minimal but should not be skipped. Two points matter:

  1. Read-back from the PLC. Even when the HMI reports a successful load, the PLC may not have applied the values if a permissive bit is missing (for example, the machine must be in Ready state). Mirror the parameter set's element tags to the controller and have the PLC acknowledge by writing a 1 to DB_RecipeAck. The HMI can read this bit and only update HMI_LoadedParamSetID when the bit transitions to 1.
  2. Cycle-time budgeting. Loading a parameter set triggers a burst of writes to PLC tags. For large recipes (> 50 elements) on a CPU 1511-1 PN, the load can take 200–600 ms over a standard PROFINET connection. The HMI display should therefore show a transient Loading… state while HMI_LoadStatus reports busy. Use the V19 system function GetParameterSetStatus to drive this animation.

9. Verification and Commissioning Procedure

  1. Open the screen in the HMI runtime (RT on the engineering PC or the panel itself).
  2. Browse the parameter set list. Confirm that HMI_LoadedParamSetID and the on-screen IO field do not change.
  3. Select parameter set 2 and press Load. The IO field should update to 2 and the symbolic IO field should show PS_LineA_HighSpeed (or whichever name set 2 carries).
  4. Open the PLC's online view on the parameter set elements. Confirm that the values match the file (compare byte by byte for the first record).
  5. Browse the list again, scroll, apply a filter, and press Cancel. The IO field must continue to show the last loaded set — not the currently selected row.
  6. Force a PLC stop / run transition. The displayed value should persist; the HMI tag values are stored in the panel's image, not the PLC.
  7. Switch the panel language. ReadParameterSetName honours UI.Language; verify the name updates accordingly.

10. Troubleshooting Matrix

Symptom Likely root cause Fix
IO field shows the currently selected set, not the loaded set. The IO field is bound to PACO's Current parameter set ID state property. Bind the IO field to your own tag (HMI_LoadedParamSetID), not to PACO's state property.
Tag updates on every button press, not only on Load. The JavaScript handler does not filter on the command ID. Compare params.CommandId against the known load command ID and ignore the rest. Trace PACO to discover the actual ID.
Name field stays empty after a successful load. ReadParameterSetName is called before the load completes, or the parameter-set-type name is misspelled. Move the call into the Release event or behind a status change; double-check the parameter-set-type string.
Display shows the old set after a PLC restart. The PLC loads defaults on restart; the HMI tag still holds the old value. Subscribe to Connection status and clear the HMI tag, or run an initial ReadParameterSetName on screen load.
Name is in the wrong language. UI.Language is not the active runtime language when the call is made. Pass the language explicitly (e.g. "en-US") and re-evaluate on language change events.
JavaScript function is not called at all. Event handler not registered, or wrong screen-level event selected. In the screen events list, check that the PACO event is wired to the JavaScript and not to a system function only.
Load completes in the HMI but the PLC values are stale. PLC is not in the correct operating state; permissive missing. Read the parameter set's element tags from the PLC and verify; add a permissive bit and a status word.

11. Best Practices and Caveats

  • Never rely on PACO's Current parameter set ID as the source of truth for the PLC's active recipe. It reflects the operator's selection, not the load state.
  • Always filter on the command ID inside the Command fired event. A handler that runs on every button press is a correctness bug, not a performance issue.
  • Treat the persistent HMI tags (HMI_LoadedParamSetID / HMI_LoadedParamSetName) as a cache. Re-validate against the PLC on critical transitions (cold start, screen change to a recipe-bound screen, language change).
  • If you have multiple parameter-set types, scope the ReadParameterSetName call by type and ID; the function will not resolve names across types.
  • In V19, the parameter-set-type name is case-sensitive in the runtime API. Match the spelling of the engineering view exactly.
  • For multi-record parameter sets, add a Record ID tag in parallel to the Parameter set ID tag and persist both.
  • Keep all parameter set names ASCII-safe where possible; the WString tag will accept Unicode, but PLC-side tools that consume the name may not.
  • If the panel loses the connection to the CPU 1511-1 PN, the IO field will hold its last value. Add a connection-status indicator and clear the field on lost connection to avoid operator confusion.

FAQ

Why does the Parameter Control update "Current parameter set ID" while the operator is just scrolling?

The property reflects the operator's current selection inside the recipe list, not the active recipe in the PLC. It changes on every selection, filter, or navigation event — not only on Load — so it is unreliable for indicating which set is actually running.

Can I bind a Symbolic IO field directly to the Parameter Control's name output?

No. The Parameter Control exposes a numeric ID, not the human-readable name. Use the ReadParameterSetName system function (or the equivalent HMIRuntime.Recipe.ReadParameterSetName JavaScript call) to obtain the name and write it into a WString HMI tag that the Symbolic IO field reads.

How do I distinguish a Load press from any other button inside the Parameter Control?

Subscribe to the Command fired event and inspect params.CommandId. The Load command has a specific numeric ID that differs from navigation, sort, filter, and rename. Use the runtime trace in TIA Portal V19 to enumerate the IDs emitted by your specific PACO configuration.

Does the displayed "loaded" set survive a PLC restart?

The HMI tag persists across PLC restarts because it lives on the panel. However, the PLC will revert to its startup values (or a default parameter set if you have configured one). Re-validate the displayed value against the PLC's element tags on connection-restored events to detect the mismatch.

Is this pattern the same on WinCC Unified PC Runtime?

Yes. The PACO event set, the ReadParameterSetName system function, and the JavaScript API are shared between Unified Comfort Panels and Unified PC Runtime. The only difference is the connection name and the project storage location; the capture logic is identical.

Back to blog