Overview
WinCC Unified's parameter set control (the composite widget historically listed under the object name PaControl) provides a tabular editor for parameter sets - the Unified product name for recipes - on Unified Comfort Panels and WinCC Unified PC Runtime. The control binds one selected parameter set type at a time, lets an operator pick or change the active row, edit individual cells, save the result, and trigger imports or exports in TSV format. What the control deliberately does not expose is the currently selected row index, the active element name, or the total number of parameter sets of a given type. There is no system function, tag, or screen-object property that answers "which value is selected for Valve 1 right now?" or "how many rows does this parameter set type contain?". Without those outputs, downstream graphics cannot render a side caption such as "Valve 1 currently selected" or a progress bar plotting "step 3 of 12 elapsed".
The article documents a field-proven workaround that avoids creating a duplicate HMI tag for every element of every parameter set type:
- Replace the implicit PaControl cell display with an explicit recipe screen built from IO Fields, each IO Field bound to an HMI tag that mirrors the corresponding parameter-set element.
- Use the parameter-set selection mechanisms available since V17 and broadened in V18 and V20 to drive the displayed values back into the IO Fields.
- Count the number of parameter sets for a given type by exporting the type to a TSV file and parsing the line count in a small JavaScript routine, then writing the total into an HMI tag consumed by a Bar widget for the progress indicator.
The approach is anchored in the official 'Parameter set types' editor (RT Unified) documentation and the V18-compatible example project for recipe screens on Unified Comfort Panels in Siemens Online Support.
Prerequisites
| Requirement | Minimum | Recommended | Verify by |
|---|---|---|---|
| Engineering tool | TIA Portal V18 + WinCC Unified option installed | TIA Portal V20 | Help > About shows V18.0+ with WinCC Unified installed |
| Runtime target | Unified Comfort Panel MTP700 / MTP1500 / MTP2200 with firmware ≥ V18 | MPC2260 / WinCC Unified PC Runtime V20 | HMI device > Properties > General > Firmware version |
| Parameter set type data | One HMI data type defining every parameter set element | PLC UDT mirrored as HMI data type for live coupling | Project tree shows both PLC data types entry "RecipeUDT" and HMI data types mirror |
| Recipe storage path | Internal flash of the panel (/recipe/) | Network share mapped via the "Read/write parameter set" target parameter | System function "Read parameter set" completes with no error code |
| Scripting runtime | JavaScript enabled (default since V17) | JavaScript + scheduled VBScript combo for cross-validation | Scheduler permits attaching a script to a tag change event |
| Web server access (PC RT only) | HTTP(S) port open for IT integration of the IO field values | HTTPS with self-signed certificate pinned on the engineering station | Browser on engineering station can load https://<HMI>/
|
The PaControl Readback Limitation
Parameter set control is a self-contained composite object. It owns:
- The reference to the assigned parameter set type.
- The operator-facing table (row = parameter set, column = element, cell = value).
- The mode (single / multi-select) and the write-back semantics on save.
- Bound events for Save, Load, Delete, Import, Export, and Status.
It deliberately hides three pieces of state engineers expect from a table widget in WinCC Unified:
- Selected row index - the integer position of the currently active row in the parameter set type. No HMI tag mirrors it.
- Selected element name - the column header that was last touched. Operators can scroll, click, and edit without leaving a public trace outside the control's internal model.
-
Row count of the type - the size of the parameter set list at runtime. There is no
.RowCount,.Count, or analogous property, nor a system function that returns it without exporting the file system.
This is by design: the control is meant to be a black box that owns the editable recipe view. Building side-panel graphics that react to what was selected therefore requires either a different screen layout or an external replica of the data. TIA Portal provides the second option through recipe screens with IO Fields.
Workaround Architecture
The replacement pattern keeps the parameter set control where it earns its keep (the master editing screen) and adds a companion recipe screen built from individual IO Fields that mirror the same elements. Selection state is published by the parameter set type's selection tag, which is updated whenever the operator switches parameter set rows. A JavaScript routine counts the parameter sets in the type by exporting to TSV and parsing.
Operator Action HMI Runtime Visualization
+------------------+ +----------------------------------------+ +-------------------+
| Click row "PS_3" | -> | Selection tag (@PS_SelectedName) | -> | Side caption: |
| in PaControl | | written with "PS_3" | | "PS_3 active" |
+------------------+ | IO Fields re-bind via tag attribute | +-------------------+
| & refetch current element values +-------------------+
| from parameter set memory | -> | Bar widget: |
+--------------------+-----------------------+ | step 3 / 12 |
| +-------------------+
+----------------------+ v
| JS on tag change | -> Reads /recipe/<TypeName>.tsv -> writes @PS_Count
+----------------------+
The screen is "read/write" in the same sense the PaControl was. To preserve the operator experience, place buttons for Save parameter set, Read parameter set, Delete parameter set, Export parameter set, and Import parameter set on the recipe screen, each wired to the corresponding system function from the WinCC Unified toolbox. The IO Fields themselves remain the value entry point.
Configuring a Parameter Set Type
A parameter set type is the data model. It is created in the Parameter set types editor of the HMI device; documentation in TIA Portal V20 documentation describes it as a container whose elements reference either an HMI data type or a PLC data type.
- In the project tree, expand HMI device > Recipes > Parameter set types.
- Double-click Add new parameter set type. Assign a name such as
ValveRecipe. - For Data source, select the HMI data type that defines Valve1...ValveN.
- Confirm elements are populated. If a required element is missing, fix the data type and re-open the editor; the type is regenerated.
- Compile and download. The runtime now exposes Read, Write, and Export system functions targeting
ValveRecipe.
| Field | Value | Notes |
|---|---|---|
| Name | ValveRecipe |
Used as the parameter set type identifier at runtime |
| Data source | HMI data type udt_Recipe
|
Define in HMI data types editor first |
| Storage location | Internal flash / /recipe/
|
Default for Unified Comfort Panels; configurable via Path parameter |
| Selection tag (optional) |
@PS_SelectedName, WString |
Receives the active parameter set name whenever the operator switches rows |
| Update mode | Continuous | Ensures tag writes trigger IO Field refetch in the recipe screen |
Building the Recipe Screen with IO Fields
A recipe screen is a normal HMI screen that contains one IO Field per element of the parameter set type. Because the Process tag property of an IO Field is bound to a single tag, this design assumes there is an HMI tag of the parameter set element's data type (or a compatible scalar) that is updated by the parameter set selection event.
- Right-click Screens > Add new screen. Rename to
RecipeScreen_Valves. - Open the screen in the editor. Drag an IO Field from the toolbox for each parameter set element. Place them in a vertical column; designers typically label each with a Static Text giving the element name (e.g., "Valve 1" beside the IO Field for Valve1).
- For every IO Field, configure Properties > General > Process tag to point at the matching tag, e.g.:
Process tag : HMI_Tags.Valve1 Mode : Input/Output Display format : Decimal (Integer) or String (WString) Output width : 6 (for 16-bit unsigned integer) - For Output value (the active value displayed when the IO Field is not in edit mode), bind to the same tag. WinCC Unified refreshes the displayed text whenever the tag updates because the IO Field listens to tag changes.
- Insert the parameter set control instance on a separate screen or a navigation area so operators can still edit the master recipe; the recipe screen mirrors the selected row only.
Tracking Selection State with HMI Tags
The recipe screen needs to know which row was selected in the parameter set control. Configure a selection tag on the parameter set type - a WString tag that WinCC Unified updates whenever the operator selects or switches a parameter set in the PaControl. The same tag drives dynamic captions and can be referenced by JavaScript.
| HMI Tag | Data type | Direction | Updated by | Consumer |
|---|---|---|---|---|
@PS_SelectedName |
WString [255] | Read | Parameter set type > Selection tag | Static text "Valve 1 currently selected" |
@PS_SelectedIndex |
UInt (32-bit) | Read | JavaScript loop counting matches in TSV | Bar widget current value |
@PS_Count |
UInt (32-bit) | Read | JavaScript after export | Bar widget max value |
Valve1 ... ValveN
|
Per element type | Read/Write | Parameter set memory on selection event | IO Fields on the recipe screen |
To bind the selection tag, open the parameter set type in the editor and set Selection tag to the WString tag. Compile and download to the runtime. The tag receives a write every time the operator picks a different parameter set; the recipe screen's IO Fields then refresh because their process tag values were mirrored by the parameter set memory on the same event.
Counting Parameter Sets via TSV Export
The only public surface that exposes how many parameter sets a parameter set type currently holds is the export. Each parameter set type exports one row per parameter set in TSV format. Counting lines after the header therefore yields the number of parameter sets.
- Trigger Export parameter set on the parameter set type. The exported file's default location is
/recipe/<TypeName>.tsv. The header row carries the element names; each subsequent row carries the values of one parameter set. - Schedule a JavaScript routine to run immediately after export completes. Completion is detected by listening to the
@PS_SelectedNametag change, or by attaching the script to a button event. - Read the TSV file from disk, count rows with content, subtract 1 for the header, write the integer to
@PS_Count. - Bind a Bar widget to
@PS_Countas the maximum and to a "step counter" tag as the current value (step counter incremented by the operator each cycle).
\t). The header line contains element names. A robust counter parses on newline, trims trailing whitespace, and discards an empty final line that some versions append. Verify the header line is exactly one; some legacy writers include a separator row, in which case subtract 2 instead of 1.
JavaScript Implementation
Place the following routine in a WinCC Unified JavaScript scheduled task or attach it to the Clicked event of an Export and count button. Confirm the runtime allows filesystem access for the user role assigned to the script; restrict to role Administrator or higher to comply with WinCC Unified security policies.
// WinCC Unified JavaScript - count parameter sets in TSV export
// Triggered on tag change of @PS_ExportComplete or button "Clicked"
(function () {
try {
// 1. Read which file was last exported (parameter set type name drives filename)
var typeName = Tags("@PS_SelectedType").Read(); // e.g. "ValveRecipe"
var filePath = "/recipe/" + typeName + ".tsv"; // default export path
// 2. Read the file (verify the runtime exposes filesystem APIs to scripts; adapt if not)
var raw = HMIRuntime.FileSystem.ReadFile(filePath, "utf-8");
// 3. Normalise line endings and split
var lines = raw.replace(/\r\n/g, "\n").split("\n");
// 4. Filter empty / whitespace-only lines
var dataLines = lines.filter(function (ln) {
return ln.trim().length > 0;
});
// 5. Subtract the header row (always 1 line on a valid TSV)
var count = dataLines.length - 1;
if (count < 0) { count = 0; }
// 6. Publish to runtime tags
Tags("@PS_Count").Write(count);
Tags("@PS_SelectedIndex").Write(1); // last selected kept at 1 by default
// 7. Trace for diagnostics in the WinCC Unified diagnostic screen
HMIRuntime.Trace("PS count for " + typeName + " = " + count);
} catch (e) {
HMIRuntime.Trace("PS count error: " + e.message);
}
})();
For environments where the filesystem API is not exposed to scripts, replicate the count on the engineering station side: subscribe to Export parameter set completion by configuring the system function to also write a Boolean to @PS_ExportComplete; then use a scheduler that watches this tag change and invokes the same routine via a Server-side script that is permitted filesystem access.
Wiring the Progress Bar
The "step of" indicator is a Bar widget:
- Place a Bar widget on the recipe screen.
- Set Process tag > Value to an HMI tag such as
@PS_StepCounter(incremented by the operator once per recipe run). - Set Process tag > Maximum to
@PS_Count. - Set Process tag > Minimum to
0. - Set Color palette to green below 80 %, yellow 80 - 99 %, red at 100 % for a clear status.
- Bind a numeric output next to the bar to
concat(@PS_StepCounter, " / ", @PS_Count)using a multi-tag text.
| Bar Property | Value | Effect |
|---|---|---|
| Value | @PS_StepCounter |
Bar fills from left to right as the operator cycles through parameter sets |
| Maximum | @PS_Count |
100 % reached when all parameter sets have been processed |
| Color ranges | 0 - 80 % green, 80 - 99 % yellow, 100 % red | Visual feedback at completion |
| Number of segments | 5 | Eases reading on smaller panels |
Verification and Acceptance Test
After compile and download, validate the workaround end to end with the following acceptance test on the engineering station or directly on the panel:
- Open the recipe screen. Confirm every IO Field shows the value of the currently selected parameter set.
- Pick a different row in the parameter set control. Confirm
@PS_SelectedNameupdates within one second and the IO Fields follow. - Press Export and count. Confirm
@PS_Countreports the same number visible as rows in the parameter set control. - Add a new parameter set in the parameter set control. Trigger Export and count again. Confirm the count increments by one.
- Delete a parameter set. Confirm the count decrements.
- Inspect the trace log for the PS count line - it should match the visible row count without error.
Troubleshooting Matrix
| Symptom | Likely Cause | Diagnostic | Remedy |
|---|---|---|---|
| IO Field shows 0 after row change | Process tag not updated by parameter set memory | Trace @PS_SelectedName - does it change? |
Verify the parameter set type has the selection tag set; redeploy |
| @PS_Count is always 0 | TSV file path wrong or filesystem script permissions missing | Check trace log for PS count error | Confirm /recipe/<TypeName>.tsv exists; grant the script role filesystem rights |
| Parameter set control does not exist in V17 / older project | Project predates V17; PaControl object is not available | Help > About TIA Portal | Migrate project to V18 or reimplement the recipe screen with IO Fields only |
| JavaScript does not fire | Tag change subscription not configured on the scheduler | Open Scheduling > Task > Trigger and confirm tag-driven trigger is selected | Re-trigger creation wizard; pick the @PS_ExportComplete tag as trigger tag |
| Bar widget always full | @PS_Count defaulted to a large constant | Online watch table - inspect @PS_Count live value | Force reset by calling the JS routine on tag change |
| Side caption stale | Event-driven refresh vs continuous event sequencing | Watch tag update cycle in diagnostic screen | Force a write to @PS_SelectedName after each row switch |
| Export error 0x8004xxxx | Insufficient storage on target path | Check available flash on the panel diagnostic page | Switch storage to a network share; clear stale parameter sets |
| Round-trip parameter set loses value | Wrong PLC connection or wrong data source UDT | Online > PLC tag monitor on the original UDT | Re-link IO Field process tag to the correct HMI tag mirror; save + download |
Frequently Asked Questions
Does the parameter set control itself expose the selected row index in WinCC Unified V18/V20?
No. The control exposes the active parameter set name through a selection tag you assign, but it does not provide a row index, an element name, or a row count as bindable outputs. Build the IO Field recipe screen and the JavaScript counter described in this article to fill that gap.
What is the smallest practical tag footprint for an N-element parameter set type?
Three tags are enough: a WString @PS_SelectedName, a UInt @PS_Count, and a UInt @PS_StepCounter. The N element tags already exist in the parameter set type's data model; do not duplicate them as HMI tags unless the application mirrors them into separate process tags.
How is parameter set selection propagated to IO Fields across the runtime?
When the operator picks a row in the parameter set control, WinCC Unified writes the selection tag you assigned on the parameter set type. Mirrored element values follow because the parameter set memory refreshes on the same selection event; IO Fields bound to those tags then update via continuous acquisition. To verify, online-watch the selection tag while switching rows.
Can the JavaScript routine be replaced by VBScript?
Yes. WinCC Unified supports both VBScript and JavaScript. The logic is identical; the syntax differences are cosmetic. JavaScript is preferable because of the rich string manipulation built-ins (replace, trim, split), but VBScript (Replace, Trim, Split) covers the same operations.
Where is the V18 demo project for recipe screens hosted?
Siemens Online Support entry 109822799 hosts a V18-compatible demo project that includes a recipe screen with IO Fields configured as described in this article. Pair it with the 'Parameter set types' editor (RT Unified) documentation for the data-model side.