Resolving TP900 Comfort Recipe CSV Import to Wrong Data Record

David Krause12 min read
SiemensTIA PortalTroubleshooting
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 Summary

On a Siemens TP900 Comfort panel programmed with TIA Portal, importing two or more .csv recipe data records from a USB stick causes every imported file to be loaded into the first recipe defined in the project. The second (and any subsequent) recipe remains empty even though the operator has clicked the import button from the recipe view of the correct recipe, or the project attempts to script the import using a PLC tag.

This is one of the most common commissioning defects in TIA Portal recipe engineering on Comfort Panels and is caused by a mismatch between the active recipe in the HMI runtime and the recipe selected in the editor when the .csv file is created. The issue is independent of panel firmware: it has been observed on TIA Portal V13 SP1 through V20 and on TP900 Comfort firmware 13.0.x through 17.0.x.

Before changing the project, capture the following: TIA Portal version, TP900 Comfort image version (see Control Panel > System > About), the recipe names defined in the project, the file names on the USB stick, and the parameter mapping of each recipe element.

Environment and Configuration

Item Value / Note
Engineering SIMATIC TIA Portal (originally V13, currently V20)
HMI device SIMATIC TP900 Comfort (6AV2 124-1JC01-0AX0 family)
Runtime WinCC Comfort / WinCC Advanced (RT Advanced)
Recipes Two or more recipes, each with one or more data records
Source medium USB stick plugged into the TP900 front USB port (X61)
File format Comma-separated .csv, ANSI or UTF-8

The TP900 Comfort stores recipes on the internal flash, with the option of syncing to a plugged USB storage device. Recipe data records can be exported from the panel back to the USB stick and re-imported. Import and export use the same .csv structure, but the import target is determined by what is currently selected in the recipe view, not by the file name on the medium.

Root Cause Analysis

Three independently sufficient root causes are observed in the field. Always check them in the order listed before modifying the project.

Cause 1: The active recipe in the runtime is not the recipe shown in the editor

When the project is downloaded, the recipe view's current recipe pointer and the recipe data block in the runtime are both reset to the first recipe in the Recipes editor. The export therefore always produces Recipe_001.csv, Recipe_002.csv, and so on, but every import operation performed through the standard recipe view button writes the contents of the selected file into the recipe that is currently active in runtime.

If the operator has navigated to the recipe view of "Recipe_2" in the project but the runtime RecipeNumber tag is still pointing at the index of "Recipe_1", the import writes into Recipe_1. Switching the active recipe by tapping the recipe view does not change the runtime index unless the recipe view's Selection property is wired to a tag and the tag is updated by the view itself.

Cause 2: The internal tag used to switch recipes is read-only at the wrong moment

Engineers commonly wire an HMI tag (for example HMI_ActiveRecipe) to the recipe view's "RecipeNumber" property and try to switch the recipe by writing the tag from the PLC. On Comfort Panels the recipe view reads the active recipe number at the moment the import button is pressed; if the tag is updated after the operator opens the file selection dialog, the import will target the previous recipe.

For scripted imports via RecipeView.GetRecipe / SetRecipe or the ImportDataRecords system function, the recipe name must be passed as a string parameter; the integer index alone is not sufficient and may be reinterpreted as a data record number on older runtime builds.

Cause 3: The .csv file does not contain the recipe name header

When exporting a recipe data record from the runtime, TIA Portal writes a header that includes the recipe name and the data record name. If the .csv file was created manually (for example, in Microsoft Excel) and the header was omitted, the import always uses the first recipe in the project. This is the most common cause when a system integrator generates the .csv by exporting a data record from Recipe_1 and then renaming the file in the hope that the new name will redirect the import.

Recipe Data Record Import Architecture

The Comfort Panel runtime distinguishes three concepts that are easily confused:

Concept Where it lives What it controls
Recipe (in editor) Project tree > HMI > Recipes Schema: name, elements, data record names, default values
Data record (in runtime) Internal flash on the panel Concrete values for one set of recipe elements
Active recipe / active data record (in runtime) Recipe view & system tags Pointer that determines which data record is read/written by tags

An import operation always writes into the active recipe at the position of the active data record, overwriting existing values. It does not create a new recipe. The recipe view's import button calls the internal system function ImportDataRecords with the currently active recipe name as the target.

Engineering Workflow: Configuring Recipe-Specific Import

Use the following procedure to make the import target unambiguous. The procedure is valid for TIA Portal V13 SP1 and later; for V20 the dialog captions match the official Siemens documentation at Importing recipe data records (Basic Panels, Panels, Comfort Panels).

  1. In the project tree, open HMI > Recipes and confirm that each recipe has a unique name. The default name "Recipe" with numeric suffixes is allowed but consider renaming for clarity (e.g. Mixer_Setpoint, Heater_Profile).
  2. For each recipe, define at least one data record. Exporting a data record from an empty recipe produces a .csv template with the correct header.
  3. On the HMI screen, place a separate Recipe view for each recipe (do not reuse one view with a recipe name variable). The view's Recipe property must be hard-bound to the recipe name string, not to a tag.
  4. Enable the Import and Export buttons on each recipe view. Operators will then see one import button per recipe, and the runtime target is unambiguous.
  5. If a PLC must trigger the import, expose the import command as a separate function per recipe rather than a single shared function. Each function passes the recipe name string explicitly.

CSV File Structure and Naming Conventions

A recipe .csv exported from the panel contains a fixed header. The first non-comment line is the recipe name; the second non-comment line is the data record name. Subsequent lines are element name / value pairs. A minimal example for a recipe named Mixer_Setpoint with one data record named Default:

Name;Recipe;Data record;Comment
Recipe;Mixer_Setpoint;Default;
VarName;Type;Value;Comment
Setpoint_Temp;REAL;72.5;Degrees C
Setpoint_RPM;INT;1450;Motor speed
Cycle_Time;TIME;00:01:30;Format hh:mm:ss

Notes that prevent the "all data lands in recipe 1" symptom:

  • The Recipe field on line 2 must match exactly the recipe name defined in the project, including case. A typo silently maps the import to the first recipe in alphabetical order.
  • The Data record field on line 2 must match an existing data record name, or the runtime will create a new one with that name.
  • Numeric values are written in C-locale format: decimal point, no thousands separator. German Excel installations that save with a comma decimal separator break the import and the runtime falls back to the default values of recipe 1.
  • The file may be saved as UTF-8 with or without BOM; ANSI is supported on firmware 14.0 and later.
  • Field separator is semicolon on European locale builds and comma on US locale builds. Set this in Runtime settings > Language & font.
If the .csv was generated by an upstream MES or ERP system, always run one round-trip export from the panel, diff the result against the source, and pin the line endings, separator, and decimal symbol in a project standard document.

Runtime Import Methods and Scripts

Three import paths exist on TP900 Comfort. Each has a different way of specifying the target recipe.

Method A: Recipe view button (operator-driven)

The operator selects a recipe view bound to a specific recipe, taps the import icon, browses the USB stick, and selects a .csv. The import uses the recipe of the view as the target. This is the simplest and most reliable method; use it as the baseline for verification.

Method B: PLC-triggered import via system function

On Comfort Panels, ImportDataRecords is callable from a button event or from a PLC job. The function signature is:

ImportDataRecords(RecipeName, FileName, Overwrite)
// RecipeName: WSTRING, must match the recipe name in the project
// FileName:   WSTRING, full path on the plugged storage medium
// Overwrite:  BOOL, TRUE to overwrite an existing data record of the same name

Wire a single button to a function that calls ImportDataRecords("Mixer_Setpoint", "/media/usb/Recipe_001.csv", TRUE) for the first recipe and a second function with "Heater_Profile" for the second. Do not pass the recipe name from a tag unless you have validated that the tag is updated and latched before the function is triggered.

Method C: VBScript on the HMI

For parameterised imports where the file name is built at runtime, use the HMI's VBScript interface:

' Triggered by a button on the recipe view of Mixer_Setpoint
Dim sFile
sFile = "/media/usb/" & SmartTags("SelectedFileName")(1)
HMIRuntime.RecipeView(1).ImportDataRecords sFile, True

Replace the literal index 1 with the recipe view's index in the screen, and confirm that the recipe view itself is bound to the correct recipe in the editor. The script does not override the recipe view's binding.

Verification and Commissioning

  1. With the panel in Transfer mode and the project recompiled, perform a full download including recipes. Confirm that all recipes and their data records are present in the runtime.
  2. Place a USB stick with the two .csv files into the front USB port. Allow 5–10 s for the panel to enumerate the device.
  3. On the recipe view of Recipe_1, tap Import, select Recipe_001.csv, and confirm. The recipe view should display the imported values.
  4. Repeat on the recipe view of Recipe_2 with Recipe_002.csv. If both views show the expected values, the configuration is correct.
  5. Power-cycle the panel to confirm that the imported values persist. Recipes are stored in the internal flash and survive a reboot.

For scripted imports, add a step in which the PLC reads back the imported values via the recipe tags and asserts that the expected value is present at the expected recipe index. A simple SCADA watcher that logs RecipeNumber, DataRecordNumber, and one process-relevant tag at the moment of import is sufficient to localise any timing issue with the internal tag switch.

Common Fault Matrix

Symptom Likely cause Action
All imports land in recipe 1 regardless of which .csv is selected Recipe view bound to a tag that still points at recipe 1 Hard-bind the recipe view to the recipe name string
Second import returns the values of the first .csv Operator opened the import dialog from the first recipe view Place one recipe view per recipe on dedicated screens
Import silently fails and the values revert to defaults Locale mismatch in .csv (comma vs semicolon, decimal symbol) Set Runtime locale to match the .csv generator and re-export
Import works on V13 project, fails after upgrade to V17 or later Header format tightened in newer runtime Re-export the template from the upgraded project and update MES
Scripted import reports "recipe not found" but the recipe exists Trailing whitespace in the recipe name Trim the string in the script and re-check the project recipe name
Import succeeds in simulation, fails on the physical panel USB stick formatted as NTFS or exFAT without 512-byte sectors Reformat the stick as FAT32 with 512-byte sectors

Firmware and Version Compatibility

TIA Portal Panel image Import behaviour
V13 SP1 / V13 SP2 WinCC Comfort 13.0.x Header line optional; missing header implies recipe 1
V14 / V15.1 WinCC Comfort 14.0.x – 15.1.x Header required; BOM tolerated
V16 / V17 WinCC Comfort 16.0.x – 17.0.x UTF-8 mandatory; legacy ANSI .csv import rejected with a system event
V18 / V19 / V20 WinCC Comfort 18.0.x – 20.0.x Adds optional column for engineering units; legacy two-line header still accepted

Cross-reference the Siemens Industry Online Support entry for the Comfort Panel image release notes when upgrading the runtime; the recipe header format has been tightened in every major release since V15.

Engineering Recommendations

  • Treat each recipe as a class with its own UI surface. Sharing one recipe view across recipes is the single most common source of this defect.
  • Generate .csv templates by exporting from the runtime, never by hand-editing an Excel sheet. The export process is the only way to guarantee that the header matches the project schema.
  • Version-control the .csv files in the same repository as the TIA Portal project. A diff between the exported and the committed file surfaces unintended edits.
  • For multi-recipe commissioning, use one USB stick per recipe during the initial load. Once the format is proven, a single stick with one .csv per recipe can be used.
  • Document the locale (decimal symbol, list separator) in the project standard. The TP900 inherits the runtime locale, not the Windows locale of the engineering station.

Why does every imported CSV land in the first recipe on my TP900 Comfort?

The runtime writes the imported values into the recipe that is currently active in the recipe view at the moment the import button is pressed. If the view's Recipe property is bound to a tag that still points at the first recipe, or if the operator opens the import dialog from the wrong view, every file ends up in recipe 1. Hard-bind the recipe view to the recipe name string and add a dedicated import button per recipe.

Does the CSV file name determine the target recipe?

No. The file name is only used to locate the file on the storage medium. The target recipe is determined by the recipe view's binding or by the recipe name parameter passed to ImportDataRecords. Renaming a file does not redirect the import to a different recipe.

What is the exact CSV header required by the Comfort Panel runtime?

Two header lines are required from TIA Portal V14 onward. Line 1 is the literal "Name;Recipe;Data record;Comment" and line 2 carries the recipe name, data record name, and an optional comment. The recipe name on line 2 must match the project recipe exactly, including case. TIA Portal V13 SP1 tolerates a missing header but then always writes into recipe 1.

Can I trigger the import from the PLC instead of the HMI?

Yes. Use the ImportDataRecords system function with three parameters: the recipe name as a WSTRING, the full file path as a WSTRING, and a BOOL overwrite flag. Pass the recipe name as a literal string per recipe; do not read it from a tag unless the tag has been latched before the function is called.

Which USB stick formats are supported on TP900 Comfort?

FAT32 with 512-byte sectors is supported across all Comfort Panel image versions. NTFS and exFAT are supported from image 16.0 onward but are not recommended for recipe transfer because of the 4 GB file size limit on FAT32 that does not apply to typical recipe CSVs. exFAT sticks formatted with 4096-byte sectors are not enumerated by the panel.

Back to blog