The log file already contains the seconds; Excel recognized the timestamp as a date and time and applied a cell format that shows only hours and minutes. Read a few raw lines in a text editor to confirm, then reformat the timestamp column with a custom format such as m/d/yyyy h:mm:ss. Leave the trend graph settings alone unless the raw text itself stops at minutes.
The seconds are almost certainly already in the file. When a trend graph logs to a USB stick and Excel shows the timestamp column as 2/9/2010 1:54, the usual cause sits in the spreadsheet: Excel read the stamp as a date and time value and applied a cell format that shows hours and minutes and drops the seconds. The chart on the panel can plot seconds at the same time, because the chart's X-axis setting and the worksheet's cell format are two separate displays. Read the raw text of the log first to see whether the seconds are on the stick or only hidden on the sheet, then reformat the timestamp column once with a custom date-and-time format that ends in :ss. Leave the logger's settings alone unless the raw text itself stops at minutes.
Why the sheet loses the seconds
A line on the stick reads like this: 2/9/2010 1:54:05,4353.
When Excel opens the file, it recognizes 2/9/2010 1:54:05 as a date and time and stores it as a single value, seconds included. What the cell shows comes from the column's number format, and the default format in this situation keeps month, day, year and h:mm. The cell holds 1:54:05 and shows 1:54.
The X-axis display option on the trend graph is a different layer. It labels the chart on the panel and reaches nothing on the stick. A chart set to a 12-hour clock with no seconds can sit beside a file that carries seconds, and switching the chart to seconds writes nothing new into the file. A chart that plots seconds on screen is not proof that the file carries them; the raw text is the evidence.
Symptoms and what each one points to
- The chart plots seconds on the panel and the Excel column shows 1:54. The cell format hides them; fix it in the spreadsheet.
- The raw text reads 1:54:05 and Excel shows 1:54. The file is correct; the column format is the whole problem.
- Four rows share the stamp 2/9/2010 1:54. Display precision: samples up to 59 s apart fall inside one displayed minute, and the raw text will tell them apart.
- The raw text itself ends at 1:54 with no seconds field. The logger wrote minute precision; check the logging and export settings on the panel, because no spreadsheet format can recover seconds that were never written.
Read the raw text before changing anything
- Copy the log file from the USB stick to the PC and work on the copy, so a spreadsheet save never rewrites the evidence. If the stick is nearly full, confirm how the panel rolls over its oldest files before you trust which rows are newest: HMI USB log drive full: confirm oldest-file rollover first.
- Open the copy in a plain-text editor, the kind that shows the characters as written.
- Read three or four lines from different minutes. A line reading
2/9/2010 1:54:05,4353carries seconds, and the rest of the job happens in Excel. - Note the separator between timestamp and value, and whether the date is month-first or day-first. Both matter when Excel imports and displays the column.
Example: 15-second logging that looks minute-only
A trend graph writes one row every 15 s. Excel shows this on the sheet:
| Excel displays | Value |
|---|---|
| 2/9/2010 1:54 | 4353 |
| 2/9/2010 1:54 | 4353 |
| 2/9/2010 1:54 | 4353 |
| 2/9/2010 1:54 | 4353 |
| 2/9/2010 1:55 | 4353 |
Four rows on one stamp look like a logger fault. The arithmetic says otherwise: a minute holds 60 s, and 60 s ÷ 15 s = 4 rows per minute, so four rows inside 1:54 is exactly what a 15-second interval produces. The fifth row lands 5 s into the next minute.
The same rows in a text editor:
2/9/2010 1:54:05,43532/9/2010 1:54:20,43532/9/2010 1:54:35,43532/9/2010 1:54:50,43532/9/2010 1:55:05,4353
The seconds were in the file all along. Apply m/d/yyyy h:mm:ss to the timestamp column and the sheet reads 1:54:05, 1:54:20, 1:54:35, 1:54:50 and 1:55:05. The logger needed no change; the column format was the entire fault.
Show the seconds again in Excel
- Select the timestamp column in the working copy.
- Open Format Cells from the right-click menu and choose the Custom category.
- Type the pattern
m/d/yyyy h:mm:ssinto the custom entry field and confirm. The codes spell the display: m month, d day, yyyy four-digit year, h hour, mm minute, ss second. The ss at the end is what brings the seconds back. - Apply the format, then read several rows and not only the first cell; pasted edits can leave a column with mixed formats.
The Custom category takes plain time patterns: h:mm for hours and minutes, and h:mm:ss when the seconds join. Match the pattern's date order to the file: a February 9 shown day-first reads 9/2/2010, the same day in another order.
If the column ignores the new format, the cells hold text. Re-import the file, set the timestamp column's type to date and time in the step where the import asks for column types, and apply the format again.
Check the result against the file
- Compare three or four formatted cells with their raw lines, including one pair that crosses a minute boundary, such as 1:54:50 and 1:55:05.
- Include a raw line whose day number is above 12, for example 2/13/2010. If that line refuses to become a date, the file's day and month order disagrees with the region the import used; re-import with the timestamp column's type set explicitly.
- Confirm each value still sits beside its own timestamp. Sorting or re-typing a text column can pull a stamp away from its reading.
- Keep the untouched original on the PC until the workbook is back in routine use.
The formatted column shows the clock the logger wrote. If the stamps wander across a shift while the process value holds steady, check the controller's clock before you compare charts, as in PLC clock drift before you trust timestamps.
When the raw text stops at minutes
Then the sheet has nothing to show and formatting is not a repair. Go back to the panel: check the logging interval and the export settings, capture a fresh file after any change, and read its raw text again before you trust it. One decision rule settles whether you need seconds at all. Rows share a displayed minute only when the logging interval is shorter than 60 s, so an interval of 60 s or longer keeps every stamp unique without them, and any interval below 60 s makes the seconds the only thing that tells consecutive rows apart.
Recommendation: Read the raw text of the log first. When the seconds are in the file, fix the Excel column once with the custom format m/d/yyyy h:mm:ss and leave the trend graph settings untouched. Go back to the logger only when a fresh file's raw text itself stops at minutes, and then set the interval and export options from the panel's documentation and read the new file's raw text again.
Questions
Does the chart's seconds setting change what the log file writes?
No. The chart's X-axis option labels the plot on the panel, and the file's stamps are written when each row is logged, so the two can disagree. A chart set to a 12-hour clock with no seconds can sit next to a file that carries seconds, which is exactly what the screen-versus-sheet symptom looks like. Changing the chart option helps operators read the screen and leaves the stick untouched; the raw text is the place to verify what was written.
When do identical timestamps mean a real logger fault?
When the raw text itself repeats one identical stamp, seconds and all, the logger wrote the same time twice and the logging configuration is the place to look. If the raw text differs in the seconds while Excel shows one stamp, the display collapsed several rows into a single minute and the logger is fine. Judge the logger on the raw text and the sheet on its format.
What pattern keeps leading zeros and day-first order?
Use d/m/yyyy hh:mm:ss when the workbook follows day-first dates. Two-character codes keep leading zeros, so 9:5:0 becomes 09:05:00: dd and mm for the day and month, hh for the hour, ss for the seconds. In a pattern, an m placed right after the hour codes reads as minutes, which is why hh:mm:ss works. Every pattern is display only and never changes the stored timestamp underneath.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.