1. Problem Statement
On a SIMATIC Unified Comfort Panel (MTP700 / MTP1000 / MTP1200 / MTP1500 / MTP1900 / MTP2200) configured with TIA Portal V18 and WinCC Unified V18, an engineer wires a trend control to logged tags, presses the trend control's "Export" toolbar button in Runtime, types a filename (for example, trendExport.csv), and confirms the dialog. The panel responds with "Done" or returns immediately with "Failed" when a full path such as /media/simatic/X64/trendExport.csv is pasted into the name field. The resulting CSV never appears on the USB stick, while a file with the supplied name shows up in an unrelated directory on the panel's internal flash.
This is a documented limitation of the trend control's built-in Export action when the panel runtime (not the WinCC Unified PC Runtime in a browser) is used. The export dialog only honors a file name, not an absolute path, and the panel writes the file to a fixed internal download directory regardless of what the operator types.
2. Root Cause Analysis
The trend control is a screen-context widget. Its Export button invokes an internal WinCC Unified scripting method bound to the screen's download location. On the PC Runtime, that location is the browser's configured download folder; on a Unified Comfort Panel, the same call resolves to the runtime's internal download directory (under /home/industrial/... on the panel filesystem). The Export dialog is not file-system aware and does not enumerate mounted USB partitions (/media/simatic/X64/ or /media/simatic/sd/).
Two failure modes are typically reported in the field:
- Symptom A — silent misroute: Operator sees "Done", finds no CSV on USB. The file is actually written to the panel's internal download path. Cause: dialog accepted the bare filename and dropped it into the default directory.
-
Symptom B — explicit failure: Operator pastes
/media/simatic/X64/trendExport.csv, panel responds "Failed". Cause: the dialog rejects absolute paths because the underlying export API only accepts a leaf filename on this control.
Both behaviors are consistent with the trend control being a "PC-style" widget that was retrofitted to the panel runtime. Unlike the older Comfort Panels (TP/Comfort), which used WinCC Flexible / TIA WinCC Comfort and had a separate Export button honoring user-defined paths, the Unified trend control exposes only the browser-equivalent download flow. The full path-write capability is delegated to either the Data Logger configuration or to a user-supplied JavaScript snippet bound to a custom button.
3. Unified Comfort Panel File-System Reference
Understanding the panel's mount layout is required to choose the right export sink. The Unified Comfort Panel runs a Linux-based runtime (Siemens Linux, not Windows IoT). The relevant paths in TIA V18 / WinCC Unified V18 firmware are:
| Logical Path in Runtime | Physical Destination | Removable? | Use Case |
|---|---|---|---|
/home/industrial/ |
Internal flash, user home | No | Default download location of trend Export button |
/media/simatic/data-storage/ |
Internal SD / flash storage area reserved for project data | No | Default root for Data Logger archives |
/media/simatic/X64/ |
External USB stick (X64 = USB3 Type-A label on MTP1500+) | Yes | User target for offline CSV / archive transfer |
/media/simatic/sd/ |
External SD card slot (where present, e.g. MTP700 / MTP1200) | Yes | Alternative removable target |
/media/simatic/cf/ |
CFast on selected MTP models | Yes | Industrial-grade removable target |
X64, sd, and cf are mount-point names created by the panel's hotplug helper. They are case-sensitive in TIA Portal paths but appear in lowercase on some firmware revisions. Always validate with the on-panel control panel → "Storage media" before scripting.4. Solution A — Remap the Data Logger to USB (Recommended for Continuous Logging)
If your goal is to produce a CSV for offline analysis on a regular schedule, do not use the trend control's Export button at all. Configure a Data Logger in the HMI tags with the storage path set to /media/simatic/X64/My_Archives/TagLogs. This is the documented archive path and is honored by the runtime regardless of trend control state.
- In the TIA Portal project tree, open HMI Tags and select the tags you want logged.
- Open Logs → right-click → Add new log. Choose TagLogging (segmented CSV or SQL variant).
- Under Storage location, select File system (CSV).
- Set the storage path to:
/media/simatic/X64/My_Archives/TagLogs - Under Segment settings, define a segment size (e.g. 1 day) and enable Sequential numbering so segments do not overwrite each other.
- Compile and download to the panel.
- Insert the USB stick. Runtime will create the directory tree on first write. Verify the directory appears via the panel's service menu (Control Panel → Storage media).
190100 in the HMI diagnostic buffer ("Log cannot be written"). Always stop logging before hot-unplug, or use the panel's "Safely remove" entry in Control Panel → Storage media.5. Solution B — Use a JavaScript Snippet to Export to USB (Recommended for On-Demand Trend Export)
When the operator must trigger an export on demand and the file must land directly on the USB stick, replace the trend control's Export button with a custom button wired to a WinCC Unified JavaScript snippet. The snippet reads the trend buffer via the trend control's API, formats it as CSV, and writes it through the panel's FileSystem scripting interface to /media/simatic/X64/.
Steps:
- In the WinCC Unified screen, add a Button to the same screen as the trend control.
- In the button's Events → Click, add a Run script action.
- Create a new JavaScript file (e.g.
ExportTrendToUSB.js) under HMI → Scripts. - Implement the script using the
HMIRuntimeandFileSystemnamespaces:
// ExportTrendToUSB.js
// Triggered by a button on the trend screen
// Writes a CSV of the configured trend tags to /media/simatic/X64/
(function () {
var fs = HMIRuntime.FileSystem;
var destDir = "/media/simatic/X64/TrendExports";
var fileName = "Trend_" + HMIRuntime.DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".csv";
var fullPath = destDir + "/" + fileName;
// Build CSV header
var lines = [];
lines.push("Timestamp;Tag1;Tag2;Tag3");
// Pull current trend snapshot via the trend control's data interface
var trend = Screen.Items("TrendControl1");
var rows = trend.GetTrendData(); // returns array of {t, v1, v2, v3}
for (var i = 0; i < rows.length; i++) {
lines.push(rows[i].t + ";" + rows[i].v1 + ";" + rows[i].v2 + ";" + rows[i].v3);
}
var csv = lines.join("\n");
try {
// Ensure target directory exists
if (!fs.DirectoryExists(destDir)) {
fs.CreateDirectory(destDir);
}
fs.WriteFile(fullPath, csv, "utf-8");
HMIRuntime.Trace("Trend exported: " + fullPath);
} catch (e) {
HMIRuntime.Trace("Export failed: " + e.message);
}
})();
- Compile the HMI project, download to the panel, and run Runtime.
- Press the new button. The trend data is written as
Trend_yyyyMMdd_HHmmss.csvinto the USB stick at the configured mount point.
6. Solution C — Pre-Mount a Network Share on the Panel
If USB availability is intermittent or the customer prefers central collection, the panel runtime can mount a Windows SMB share as /media/simatic/net/<name>/ through the panel's Control Panel → Network drives. Once mounted, the same FileSystem.WriteFile call can target the share path. This is the only path that lets the on-demand trend export use the same code as Solution B while writing to a network location, including direct deposit onto an engineering PC.
Caveats:
- SMB v1 is disabled on current firmware; use SMB v2 / v3 only.
- The panel authenticates with a configured Windows account; permissions on the share must include
Modifyfor the service user. - Disconnect before logout, or the next mount fails with error
190200in the diagnostic buffer.
7. Verifying the Export
After applying either Solution A or Solution B, run this verification sequence on the panel:
- Insert the USB stick and wait for the panel's "Storage media" status icon to settle on green.
- Open Control Panel → Storage media on the panel and confirm
X64shows Ready and the filesystem type (typicallyvfatorexfat). - Trigger the export (logger tick or button press).
- Open the panel's Diagnostics viewer. Filter for
Trend/TagLoggingevents. A successful write produces info event190000; a failed write produces warning190100with reason text. - Use the panel's File browser (in Control Panel) to navigate to
/media/simatic/X64/. The CSV must be present and timestamped within seconds of the export trigger. - Remove the USB stick via Control Panel → "Safely remove". Copy the file to a PC and confirm a header row, expected column count, and a non-zero row count.
8. Firmware / Software Version Compatibility
| Component | Minimum version for Solution B | Notes |
|---|---|---|
| TIA Portal | V18 Update 2 or later | V18.0 introduced the FileSystem namespace; some methods required V18 Update 2 |
| WinCC Unified HMI Engineering | V18 | JavaScript API stable since V17, but Screen.Items(...).GetTrendData() requires V18 |
| Unified Comfort Panel firmware | V18.0.0.0 or later | Older firmware (V17.x) can still run V18 projects but the FileSystem write to X64 may fail with EACCES
|
| MTP700 / MTP1000 / MTP1200 | Firmware >= V18.0.0.0 | USB port label may appear as usb instead of X64 on firmware < V17 |
| MTP1500 / MTP1900 / MTP2200 | Firmware >= V18.0.0.0 | Two USB Type-A ports; first plugged device typically binds to X64, second to X65
|
/media/simatic/X64/ path from JavaScript, and will silently fall back to /home/industrial/.9. Error Code Reference
| Code | Severity | Meaning in context of trend / logger export | Corrective action |
|---|---|---|---|
190000 |
Info | Log segment successfully written | None — informational |
190100 |
Warning | Log segment could not be written (USB removed, full, or read-only) | Reinsert USB, free space, check filesystem |
190200 |
Warning | Network drive unavailable | Verify SMB reachability and credentials |
190300 |
Error | Storage path invalid or not permitted by runtime security policy | Validate path is under /media/simatic/ or a configured network share |
JS-014 |
Error | JavaScript runtime exception in custom script | Check HMIRuntime.Trace output for stack trace |
EACCES |
Error | Filesystem permission denied | Verify USB is formatted writable and not locked |
10. Troubleshooting Matrix
| Symptom | Likely Cause | Resolution |
|---|---|---|
| Export button says "Done" but file missing on USB | Trend control writes to internal download dir, not USB | Apply Solution A or B |
| Export button returns "Failed" with full path in filename | Dialog rejects absolute paths | Apply Solution A or B; do not paste paths into the dialog |
| JavaScript writes succeed but file is empty | Trend buffer not populated before export; trigger before first tick | Wait for at least one logging cycle; verify tag acquisition is active |
| USB stick not detected after insertion | Insufficient current on USB port or unsupported filesystem (e.g. NTFS without exfat helper) | Use FAT32 / exFAT stick; try rear port on MTP1500+ which supplies 1 A |
| CSV shows comma decimal separator instead of point | Regional settings on panel runtime | Configure locale in Control Panel → Regional settings → English (US) for export, or post-process on PC |
| Export works on engineering PC but not on panel | Panel runtime lacks trend control feature license | Check Options → Licenses on panel for Trends & Logs entry |
11. Best Practices
- For continuous process logging, prefer the Data Logger (Solution A) — it survives a power loss because segments are flushed atomically.
- For ad-hoc trend dumps at shift handover, use the JavaScript snippet (Solution B) bound to a clearly labeled button with a confirmation popup.
- Always use a timestamped filename pattern (
yyyyMMdd_HHmmss) to prevent overwrites on hot-plug retries. - Mirror critical logs to both internal SD and a rotating USB stick to avoid data loss when one medium fails.
- Document the export path in the HMI screen's help text so operators know where to retrieve the CSV without engineering intervention.
Where does the trend control Export button save files on a Unified Comfort Panel?
The built-in Export action on the trend control writes to the panel's runtime download path (typically /home/industrial/...). It does not enumerate or honor USB mount points such as /media/simatic/X64/. Configure a Data Logger or use a JavaScript snippet for USB export.
Can I paste an absolute USB path into the trend Export filename field?
No. The trend Export dialog in TIA V18 rejects absolute paths and returns "Failed". Only a bare filename is accepted, and it is dropped into the default download directory. Use a custom JavaScript button that calls HMIRuntime.FileSystem.WriteFile with the full path instead.
Which Unified Comfort Panel USB mount path should I use in my script?
Use /media/simatic/X64/ for USB Type-A sticks on MTP1500 and larger panels, or /media/simatic/sd/ for the SD slot on MTP700 / MTP1200. The mount-point names are case-sensitive. Always verify with Control Panel → Storage media before scripting the export path.
What minimum TIA Portal and panel firmware versions support JavaScript-based trend export to USB?
TIA Portal V18 Update 2 or later together with panel firmware V18.0.0.0 or later. Earlier firmware versions may silently fall back to /home/industrial/ when a script writes to /media/simatic/X64/.
Which diagnostic event codes indicate a failed trend export?
Event 190100 indicates the log segment could not be written (USB removed, full, or read-only). Event 190300 indicates the storage path is invalid or denied by runtime security policy. A successful write produces info event 190000.