> For the complete documentation index, see [llms.txt](https://docs.enlyze.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enlyze.com/en/variable-mapping/hmi-configuration.md).

# Variable mapping via HMI configuration

Import variables from the configuration of a Siemens HMI device (.fwx / .fwc)

The HMI devices on a machine show exactly the values that matter for operating it. You can take over that selection directly: the **Flex Configuration Extractor** reads every variable used on the HMI screens from the configuration of a Siemens HMI device. You pick the display elements you want, give each one a display name and a unit, and register the variables in the ENLYZE Platform.

This works for the following HMIs:

| Configuration software        | Typical devices                                                                            | File   |
| ----------------------------- | ------------------------------------------------------------------------------------------ | ------ |
| WinCC flexible 2005 / 2008    | MP 177, MP 277, MP 377, TP/OP 177B, TP/OP 277, Mobile Panels, WinCC flexible Runtime on PC | `.fwx` |
| WinCC (TIA Portal) V12 to V17 | Basic Panels, Comfort Panels, WinCC Runtime Advanced on PC                                 | `.fwc` |

{% hint style="warning" %}
**WinCC Unified** (Unified Comfort Panels, Unified PC Runtime), **WinCC Runtime Professional**, and the SCADA systems **WinCC V7 / V8** are not supported. They do not produce a `.fwx` or `.fwc` file. In that case, register the variables via the [STEP 7 project folder](/en/connect/ot-connectivity/supported-industrial-protocols/s7-classic.md#import-variables) or [Variable Discovery](/en/variable-mapping/exploration-discovery.md), or contact us at <support@enlyze.com>.
{% endhint %}

{% hint style="info" %}
**Your file stays on your computer**

The configuration file is read exclusively in your browser. It is neither transferred to ENLYZE nor stored on our servers. Only the variables you select are registered in the ENLYZE Platform.
{% endhint %}

## Identify your HMI device

The order number on the rating plate on the back tells you which file your HMI device uses. It starts with `6AV`, or with `6AG1` for SIPLUS variants for harsh environments (e.g. `6AG1 124` instead of `6AV2 124`).

| Order number starts with | Device family                                                                                      | Configured with                           | File          |
| ------------------------ | -------------------------------------------------------------------------------------------------- | ----------------------------------------- | ------------- |
| `6AV6 64…`               | MP 177, MP 277, MP 377, TP/OP 177B, TP/OP 277, Mobile Panel 177 / 277, 1st generation Basic Panels | WinCC flexible, sometimes also TIA Portal | mostly `.fwx` |
| `6AV2 123`               | 2nd generation Basic Panels                                                                        | TIA Portal                                | `.fwc`        |
| `6AV2 124`               | Comfort Panels                                                                                     | TIA Portal                                | `.fwc`        |
| `6AV2 125`               | 2nd generation Mobile Panels                                                                       | TIA Portal                                | `.fwc`        |
| `6AV2 128`               | Unified Comfort Panels                                                                             | WinCC Unified                             | not supported |

The start screen gives another hint: devices of the WinCC flexible generation show the **Loader**, Comfort Panels show the **Start Center**.

{% hint style="info" %}
The file itself is the definitive answer: a `pdata.fwx` in the `\Flash\Simatic` folder means the project comes from WinCC flexible, a `pdata.fwc` means TIA Portal. Since you copy the entire folder, you do not need to know the generation in advance. The Flex Configuration Extractor handles both files.
{% endhint %}

## Get the configuration file

The configuration file is the compiled runtime project of the HMI device. There are three ways to get it. For existing machines, copying it directly from the HMI device is the standard way, because the engineering project is often not available.

{% tabs %}
{% tab title="From the HMI device (recommended)" %}
On panels running Windows CE (Comfort Panels, MP, TP/OP, and Mobile Panels), the file is always located in the folder `\Flash\Simatic`:

* `pdata.fwc` (TIA Portal)
* `pdata.fwx` (WinCC flexible)

**What you need**

* a USB stick
* a USB keyboard, ideally wireless with a USB dongle and a built-in touchpad (e.g. Logitech K400). It lets you operate Windows directly on the HMI device without relying on the touchscreen.

If the HMI device has only one USB port, use a USB hub.

**Copy the file**

1. Plug the keyboard's USB dongle and the USB stick into the HMI device. The USB port is located on the back of the panel. This typically requires opening the control cabinet the HMI or panel is mounted in.
2. Press the **Windows key** on the keyboard. The Windows desktop of the HMI device appears.
3. Open Explorer and navigate to `\Flash`.
4. Select the **entire** `Simatic` folder and copy it with **Ctrl + C**.
5. Open the USB stick (e.g. `\Storage Card USB`) and paste the folder with **Ctrl + V**.
6. Then switch back to the runtime.

Later, you upload the file `pdata.fwc` or `pdata.fwx` from the copied folder to the Flex Configuration Extractor.

{% hint style="info" %}
You do not need to close the runtime, and the machine keeps running as usual. While the Windows desktop is in the foreground, however, operators cannot see the usual HMI view. Briefly agree on a time with the operators at the machine.
{% endhint %}

{% hint style="info" %}
If the Windows key does not open the Windows desktop, access on the HMI device is locked (e.g. by a Control Panel password). **Basic Panels** never offer access to the file system. In these cases, use the engineering project instead.

A backup of the HMI device (ProSave `.psb`, TIA Portal `.brf`) is not a substitute: the configuration file cannot be taken out of it directly.
{% endhint %}
{% endtab %}

{% tab title="From the engineering project" %}
If you, the machine builder, or your maintenance team have the engineering project, the file is created when the HMI device is compiled. No access to the machine is needed.

**TIA Portal (`.fwc`)**

1. Open the project in TIA Portal.
2. In the project tree, right-click the HMI device and select **Compile** > **Software (rebuild all)**.
3. Open the project folder in the file system. The file `pdata.fwc` is usually located in the subfolder `IM\HMI\...\Generates`. If the project contains several HMI devices, each device has its own subfolder.

**WinCC flexible (`.fwx`)**

1. Open the project in WinCC flexible.
2. Select **Project** > **Compiler** > **Generate**.
3. The `.fwx` file is located in the same folder as the project file (`.hmi`) and is named after the project.

{% hint style="info" %}
If the project is stored as an archive (e.g. `.zap` in TIA Portal), retrieve it first and then compile the HMI device again. Archives usually do not contain the compiled file.
{% endhint %}
{% endtab %}

{% tab title="From a PC or panel PC" %}
If the visualization runs on a PC or panel PC (WinCC flexible Runtime, WinCC Runtime Advanced), the file is stored in the computer's file system. You do not need to close the runtime.

1. Open the **WinCC Runtime Loader** from the Windows Start menu (**Siemens Automation** > **Runtime Systems**).
2. **Settings** shows the path of the loaded configuration file.
3. Copy the file from that path to a USB stick.

If the runtime starts via a shortcut in Autostart, you also find the path in the shortcut's properties. Alternatively, use the Windows search for `*.fwc` or `*.fwx`.
{% endtab %}
{% endtabs %}

{% hint style="success" %}
If none of these ways works, contact us at <support@enlyze.com>. We are happy to help you get the file, on site if needed.
{% endhint %}

## Take over the variables

{% stepper %}
{% step %}

#### Open the Flex Configuration Extractor

In the [ENLYZE Manufacturing Data Platform](https://app.enlyze.com/platform), open the controller's data source and switch to the **Variables** tab.

* **S7 Classic**: click **Import variables** and select **WinCC runtime file (.fwx, .fwc)**.
* **S7+ and OPC UA**: click **WinCC runtime file (.fwx, .fwc)**.

<figure><img src="https://4261006941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSNEuiyRRKwuqtIcaEt45%2Fuploads%2Fgit-blob-ecff63fac98187287a833b2283ba2030e9af458e%2Fvarmapping-hmi-open-extractor-01.png?alt=media" alt="Select relevant variables card with the WinCC runtime file (.fwx, .fwc) button"><figcaption><p>Opening the Flex Configuration Extractor from an S7+ or OPC UA data source</p></figcaption></figure>

The Flex Configuration Extractor opens in a new tab with site, machine, and data source already selected.

Choose the data source of the controller the HMI device talks to. Its connector must match the connection in the HMI project: **SIMATIC S7 300/400** belongs to [S7 Classic](/en/connect/ot-connectivity/supported-industrial-protocols/s7-classic.md), **SIMATIC S7 1200** and **SIMATIC S7 1500** to [S7+](/en/connect/ot-connectivity/supported-industrial-protocols/s7+.md), and **OPC UA** to OPC UA.

{% hint style="info" %}
If the button is not shown, contact us at <support@enlyze.com>. We will enable the Flex Configuration Extractor for your account.
{% endhint %}
{% endstep %}

{% step %}

#### Upload the configuration file

Drag the `.fwx` or `.fwc` file onto **Drop your WinCC runtime file here**, or click it to select the file. The file is read in your browser.

<figure><img src="https://4261006941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSNEuiyRRKwuqtIcaEt45%2Fuploads%2Fgit-blob-302259f74f130463e63df634d0f5abc104a275d0%2Fvarmapping-hmi-upload-01.png?alt=media" alt="Upload step of the Flex Configuration Extractor with the drop zone"><figcaption><p>Uploading the WinCC runtime file</p></figcaption></figure>

Once the file is read, the extractor shows its name and the number of screens. Continue with **Continue to next step: Select screens**.

<figure><img src="https://4261006941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSNEuiyRRKwuqtIcaEt45%2Fuploads%2Fgit-blob-c1406da9fac32f275fe84ecef18b774a7d14fe0e%2Fvarmapping-hmi-upload-02.png?alt=media" alt="Uploaded runtime file with the number of screens, the Load progress file option, and the button to the next step"><figcaption><p>Uploaded WinCC runtime file</p></figcaption></figure>
{% endstep %}

{% step %}

#### Select screens

Under **Select screens**, select the HMI screens that belong to your HMI device. Some projects contain screens for several devices or variants.

<figure><img src="https://4261006941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSNEuiyRRKwuqtIcaEt45%2Fuploads%2Fgit-blob-a39f9304dd3c523d8a8149403c627c4ddb8505b8%2Fvarmapping-hmi-select-screens-01.png?alt=media" alt="Screen selection with thumbnails of all HMI screens, two of them selected"><figcaption><p>Selecting the HMI screens</p></figcaption></figure>
{% endstep %}

{% step %}

#### Select and name variables

The selected screens are shown the way they appear on the HMI device.

* **Click** a display element to select its variable, then enter a **Display name**, a **Unit**, and a **Comment** if needed.
* **Right-click** a selected element to deselect it.
* Use the search to find variables by address or name. **Select all variables from this screen** takes over every variable on a screen.

<figure><img src="https://4261006941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSNEuiyRRKwuqtIcaEt45%2Fuploads%2Fgit-blob-122f7eb70a07a94799494b29b4e70569c992a855%2Fvarmapping-hmi-select-variables-01.png?alt=media" alt="HMI screen with a selected display element, the editor for display name, unit, and comment, and the table of selected variables"><figcaption><p>Selecting and naming variables on the HMI screen</p></figcaption></figure>

**Save progress** saves your work to a file. Use **Load progress file** on the extractor's start page to continue your selection later.
{% endstep %}

{% step %}

#### Send the variables to the ENLYZE Platform

Check your selection under **Review & export** and click **Send variables to ENLYZE platform**.

<figure><img src="https://4261006941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSNEuiyRRKwuqtIcaEt45%2Fuploads%2Fgit-blob-40dcfee4687c2924e9e05fbd8151cccfb7eb2e2e%2Fvarmapping-hmi-review-export-01.png?alt=media" alt="Review &#x26; export table with the selected variables and the Send variables to ENLYZE platform button"><figcaption><p>Checking the selection before sending</p></figcaption></figure>

Choose the state the variables are created with:

* **Evaluating** (recommended): the variables are recorded in the **Exploration** state. You check the values before you activate them.
* **Active**: the variables are recorded right away and available to all services.

Confirm with **Send variables**. The summary shows how many variables were created, updated, or already up to date.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Display elements whose address is only calculated at runtime (e.g. through multiplexing or indirect addressing) cannot be taken over. If you need these values, register them via the STEP 7 project folder or contact support.
{% endhint %}

## Next steps

* [Contextualisation](/en/variable-mapping/contextualisation.md): check variables in the Exploration state and activate them.
* [Variables & time series](/en/concepts/understanding-machine-data/variables-and-time-series.md): what the variable states mean.

If you have any questions, feel free to contact us at <support@enlyze.com>.
