How-to
How to Display PLC CSV Data Logs on an HMI Screen
Short answer
A standard HMI tag driver exchanges tag values with the PLC; it cannot browse the controller memory card or parse its CSV files. For an operator-facing history, log the same tags with the HMI's own sampling and bind the screen's trend or table to that dataset. Display the exact PLC-generated CSV only after transferring it to a PC that can parse it.
On this page
- Can an HMI display the CSV files the PLC writes to its memory card?
- Why does a connected PLC still show nothing from the log files?
- Which display path fits the result you need?
- How do you log the same tags with the HMI's own history function?
- How many records will HMI data sampling produce per day?
- When is moving the CSV file to a PC the right call?
- How do you prove the finished screen works end to end?
- Questions asked
Enable the HMI's own sampling function, bind the screen's trend or table to that logged dataset, and leave the PLC's CSV file to a PC-side viewer: a tag driver cannot browse the controller memory card or parse a CSV. Sized concretely, 8 tags sampled once per second produce 691,200 samples in a 24 h day, so the record count — not the file name — decides your storage and retention. That is not a fault you can fix with a driver setting: a standard HMI tag driver exchanges tag values with the controller, so no tag-bound screen object can use the files on the card as a data source. Below are the decision rule, the setup steps, a storage sizing example and the end-to-end test.
Can an HMI display the CSV files the PLC writes to its memory card? #
No — browsing files on a controller memory card is a filesystem function, and a tag driver provides tag reads and writes only, so there is no object in a standard HMI project that can bind to a CSV stored on the PLC.
Treat this as an architecture decision, not a missing setting. Before promising anything, check the project software's documentation for three capabilities: documented access to files on the controller's memory card, a transfer or import function for CSV content, and a display object that parses rows and columns into a table or historical view. Unless the documentation for your exact HMI model and driver names all three, direct CSV viewing is not an available feature. The recommendation below works on any tag-driving HMI: build the operator's history from the HMI's own sampling, and keep the PLC file for whoever actually needs the archive.
Why does a connected PLC still show nothing from the log files? #
Because two different data chains are in play: a screen object talks to the controller through tag addresses, while a CSV on the memory card needs file transfer, a parser and a type-conversion layer the tag path never provides.
A live display object runs this chain: screen object, HMI tag, communication driver, controller address. The archived file runs a different chain: file viewer, CSV parser, file-transfer service, controller filesystem. A green communication indicator proves only the first chain. Most drivers read controller memory and offer no filesystem operations at all, and the card is not exposed as a browsable network share, so treat card file access as absent unless the vendor documents it.
A CSV is serialized text: rows, delimiters, headers, formatting rules. Before anything can display it, some component must retrieve the file, parse each field, convert text to numeric data types and decide what happens while the PLC keeps appending rows. None of that lives in a tag driver. If a deliberate transfer to the panel's own storage is part of the plan anyway, note that SFTP access to an HMI's storage has its own traps, covered in why HMI SFTP cannot see the SD card data log files.
Which display path fits the result you need? #
Match the data source to the operator's question: live values bind to tags, recent sampled history comes from HMI-native logging, and only an authoritative archive copy justifies moving the CSV to a PC-based viewer.
| Result the operator needs | Data source | Approach | Main limitation |
|---|---|---|---|
| Current process values | Live PLC tags | Bind objects through the existing driver | Nothing recorded before the screen went live |
| Recent trends and sampled records | Tags sampled by the HMI | HMI-native logging plus a tag-bound trend or table | An HMI history, not the PLC's file |
| The exact rows already on the PLC memory card | PLC CSV file | Documented file transfer, then a PC-side CSV viewer | A tag driver alone cannot browse or parse the file |
The middle row is the default answer: it reuses the driver path already in service and gives the operator past samples of the same signals. Do not present HMI-native history as a byte-for-byte copy of the PLC file, because two loggers with different triggers, scan timing, clocks, scaling or startup states record different rows. When exact record identity matters, only the transferred file satisfies it.
How do you log the same tags with the HMI's own history function? #
Build the history inside the HMI project: prove each tag live, add it to the runtime's native logging function, align the trigger and scaling with what the PLC log meant, then bind a trend or table object to the logged dataset rather than to a filename.
- List the logged signals from the PLC program and the existing HMI tag database: controller addresses, data types, scaling and engineering units, not values read back out of the CSV text.
- Prove each tag live. Put temporary numeric objects on a diagnostic screen, change one value through an approved test, and confirm the screen follows it.
- Enable the runtime's native logger. The name changes by platform: EasyBuilder Pro provides the Data Sampling object, Beijer iX provides the Data Logger, and Ignition calls the function Tag History. Where the platform offers a trigger tag instead of a fixed interval — the iX Data Logger does — use it when the PLC log was event-based.
- Align record semantics with the original log: same trigger logic, data types, scaling and timestamp policy. An event-based PLC record and a periodic HMI sample answer different questions on the same tag. Watch data types on binary signals too, because some platforms export bool true from a data log as -1; for why that happens and how to handle it, see why HMI data logs export bool true as -1.
- Add the display object and bind it to the logged dataset, not to a filename. In WinCC Unified, the Trend control displays tag values from the current process or from the log. Include timestamp, engineering value and units so the screen stands on its own.
- Define the empty and startup states: make the screen distinguish no samples yet from a valid zero, and confirm what logging does after an HMI restart or a loss of controller communication.
- Download the project, force controlled value changes, and confirm new records arrive in the expected order.
How many records will HMI data sampling produce per day? #
Multiply tags by sample rate: eight tags sampled once per second produce 691,200 samples in a 24 h day, so size storage and retention from that record count before you commit an interval.
Worked example, with one assumed input. A day is 24 h × 3,600 s/h = 86,400 s, so 8 tags at 1 sample/s produce 8 × 86,400 = 691,200 samples/day. Assume 12 bytes per sample — a 4-byte real value plus an 8-byte timestamp; that size is illustrative, the real record layout is tool-specific, and the project software states the actual value. Then 691,200 samples/day × 12 B/sample = 8,294,400 B, about 8.3 MB/day, and a 128 MB storage budget holds 128 ÷ 8.3 ≈ 15 days. Drop to one sample per 2 s and the same budget stretches: 8 × 43,200 = 345,600 samples/day × 12 B = 4,147,200 B ≈ 4.1 MB/day, and 128 ÷ 4.1 ≈ 31 days.
Retention is a promise to production, so prove it instead of assuming it: verifying HMI historical trend retention before committing sets out that test. Sample rate, record size and overwrite behavior together decide whether the trend survives a long weekend.
When is moving the CSV file to a PC the right call? #
Move the file only when the PLC-generated record itself is authoritative and must be reproduced exactly — quality records, audits, batch reports — and keep HMI-native history as the everyday operator view.
Documented card access does exist on some platforms, but it is an engineering view, not an operator screen. The TIA Portal documentation, for its data logs, names exactly two ways to look at them: the PLC Web server feature, or removing the memory card and reading it in a standard PC card reader. One hard rule if you take the card route: bring the process to a safe, stopped state first, because on many PLCs the program itself lives on that card and pulling it stops the machine. Prove any transfer path with one closed test file before building on it: retrieve the file, parse the header and one data row, display the fields.
When the exact file must be viewable at the machine, that job belongs to viewer or SCADA software running on industrial panel PCs at the operator station. PC-side viewers have their own faults: when the viewer refuses to select or open the datalog file, start from the documented repair for a data log viewer file-selection fault rather than blaming the transfer.
How do you prove the finished screen works end to end? #
Test one layer at a time and demand a visible result at each one: a controller value that changes, an HMI tag that follows it, a record created at the trigger, and a history object that shows the sample with its timestamp.
| Check | Pass condition | A failure points to |
|---|---|---|
| Controller value | The selected PLC address changes under your test | PLC logic, source address or the test setup |
| Live HMI tag | A temporary numeric object follows the controller value | Driver, tag address, data type or link state |
| Record creation | A new sample appears after the configured trigger | Logger enable state, trigger tag or storage setup |
| History object | The sample and its timestamp appear on the target screen | Dataset selection, object binding or time range |
| Restart recovery | Logging resumes with sane timestamps and no false values | Startup state, clock handling or link recovery |
Decision, case by case. The operator needs a readable history of the same signals: build the HMI-native tag-bound trend or table and size it from the example above. Quality or audit needs the exact archived rows: move the CSV through a documented transfer to a PC-side viewer and prove the path with a test file first. A line needs both: run the two loggers as separate records — the HMI trend for the operator, the transferred CSV for the record — and never present one as the other.
Questions asked
Can an HMI macro or script read the PLC memory card directly?
Some HMI runtimes provide file functions, but they operate on the HMI's own storage or on network shares the vendor documents. The controller's memory card is not exposed as a browsable share by the tag driver, and a script still needs documented remote file access plus a CSV parser. Unless the vendor manual lists both for your exact model and driver, the script fails for the same reason the screen object does.
Why does the HMI history have gaps the PLC log does not?
An HMI logger samples only while the panel is powered, running its runtime and communicating with the PLC. Every HMI power-down, project download or link outage leaves a gap, while the PLC-side logger kept writing through all of it. The CSV therefore holds rows the HMI history can never reproduce. If records must survive HMI downtime, they belong in the PLC or in a server-based historian.
Is it worth logging the same tags in both the PLC and the HMI?
Yes, and on a line with quality or audit requirements it is the right architecture. The PLC logger keeps the authoritative archive on its memory card while the HMI logger feeds the operator trend, each with its own trigger and storage budget. Keep the two datasets separate in use: operators read the HMI trend and quality reads the transferred CSV, so nobody mistakes one record for the other.
Whose clock stamps the records in the HMI history?
The HMI's own clock stamps each sample, so it can drift away from the PLC's clock by minutes if the two are never synchronized. Synchronize both clocks before comparing an HMI trend with a PLC CSV side by side, and check whether the runtime stamps each record at sample time or at file-write time, because buffering and communication delays can separate the two moments.