IMD SolutionComputing LibraryShop main store

Explainer

Logging 10 days of history when a small HMI has no historian

Edge computing and IIoT Published 6 min read

Short answer

No. A panel without a historian stores only the current value in retentive memory, so 10 days of history is either a ring buffer you program in retentive words (960 words for four variables at hourly sampling) or a job for an edge PC that polls the panel and archives timestamped values, the only route for minute-level data.

On this page
  1. Does a small HMI panel without a historian keep any history at all?
  2. How many samples does ten days of history take?
  3. Will the history fit the panel's retentive memory?
  4. How do you build a 10-day ring buffer in the panel program?
  5. When should an edge PC collect the history instead?
  6. How do you prove the history survives a power loss?
  7. Questions asked

A small HMI panel with no historian cannot store a 10-day series on its own: retentive memory keeps only the current value of an operand, never a sequence of values. You have two workable routes. Build a ring buffer of scaled integers in retentive operands inside the panel program, which holds while the sample count times the variable count fits the retention range, 960 words for four variables logged hourly over 10 days. Or mount an edge PC that polls the panel and archives timestamped values, the only route for minute-level history. What follows is the sample-count arithmetic, the capacity check with a worked example, the buffer design, the power-loss test and the decision for each case.

Does a small HMI panel without a historian keep any history at all? #

No. A panel with no trend-archive or data-logger object in its project has nowhere to put a series: the screen shows the live value of an operand, and retentive memory preserves only that last value across a power cycle, never a sequence of values.

Open the project and look for a trend archive, a data-logger object or a file-export function. If the project tree offers none, no configuration switch adds one, and a requirement to show the last ten days will not be met out of the box. A live value is not a stored series; the same gap is why PI shows live values but no trend history when nothing is recording. What the panel does give you is memory you can declare retentive, typically marker bytes, words and double words (MB, MW, MD on many controllers), in the system settings where the retention ranges are entered. The history itself you build.

How many samples does ten days of history take? #

Ten days is 864,000 seconds, so the sample count per variable runs from 864,000 at one-second sampling down to 240 at one-hour sampling; the interval you choose decides everything that follows.

Divide the seconds by the interval:

Sample interval Samples per variable over 10 days
1 second 864,000
10 seconds 86,400
1 minute 14,400
15 minutes 960
1 hour 240

The retentive cost is that count times the number of logged variables, plus a few housekeeping operands: write pointers, a sample counter, a base time. Store one sample per 16-bit word; a 32-bit double word carries the same sample at double the cost.

Will the history fit the panel's retentive memory? #

Multiply the sample count by the number of logged variables and compare the result with the range the retention dialog actually accepts; in the worked example below, four variables at one-minute sampling need 57,600 words and fail, while hourly sampling needs 960 words and passes.

Read the accepted range from the panel's own retention dialog and manual, not from another model's. The example assumes the dialog accepts a 2,048-word range; substitute your panel's figure and rerun both cases.

Case A, one-minute logging of four variables:

  • 10 days × 24 hours × 60 minutes = 14,400 samples per variable
  • 14,400 × 4 variables = 57,600 words, plus about 8 housekeeping words = 57,608 words
  • 57,608 ÷ 2,048 ≈ 28, so the buffer needs twenty-eight times the range: it does not fit.

Case B, hourly logging of the same four variables:

  • 10 days × 24 hours = 240 samples per variable
  • 240 × 4 variables = 960 words, plus the 8 housekeeping words = 968 words
  • 2,048 - 968 = 1,080 words of headroom: it fits, with more than half the range free.

Decision: hourly or slower resolution of a handful of variables fits a retentive buffer. Minute-level resolution lands in the tens of thousands of words, past what a basic panel's retention range holds, so that requirement goes to an edge PC.

How do you build a 10-day ring buffer in the panel program? #

Reserve one contiguous block of N words per variable, where N is the sample count for your interval, keep a retentive write pointer for each block, and let a cyclic trigger at that interval write one sample and advance the pointer with a wrap at N.

Five points make it work:

  • Put every buffer word, every pointer, the sample counter and the base-time operand inside the retention ranges. Leave the pointer out and it resets to zero at power-on, so after every restart the new samples overwrite the oldest end of the buffer.
  • Trigger from a cyclic time source, and confirm the panel has a real-time clock and that it is set; otherwise the interval drifts and any time you reconstruct from it is wrong.
  • On each trigger, write the scaled value into the word the pointer addresses, then add one to the pointer and wrap it to zero when it reaches N. The value lands before the pointer moves on purpose, so a power fail between the two steps never marks a half-written record as the newest.
  • Read history back by offset from the pointer: newest is pointer minus one (wrapped), each older sample one position further back, with the scale factor applied in reverse for display.
  • Scale before storing: multiply the process value by 10 or 100 and store the integer, because a word holds an integer, not a floating-point value.

When should an edge PC collect the history instead? #

Move the logging to an edge PC when you need per-record timestamps, minute-or-faster sampling of several variables, trends an operator scrolls across days, or an exportable file, everything a retentive buffer cannot give you.

Mount an industrial mini PC in the cabinet as the polling and archive host: it reads the panel's tags over the communications link at the interval you actually want and writes timestamped rows to a local store. Storage stops mattering at this scale. The one-minute case that failed in the panel is 57,600 records over that window; at 16 bytes per record (an 8-byte timestamp plus an 8-byte value) that is 57,600 × 16 = 921,600 bytes, about 0.92 MB per 10-day window, and ten years of continuous logging stays near 336 MB. If the box also forwards to a plant or cloud system, give it a store-and-forward buffer so an outage costs no data; buffering MQTT data in Node-RED during an internet outage shows the pattern.

Decision for each case:

  • Hourly resolution, or daily minimum, maximum and average summaries of a handful of variables, with no timestamp per record: the retentive ring buffer in the panel is enough.
  • Minute-or-faster series, timestamps per record, day-long scrolling trends or an audit export: the edge PC polls and archives, and the panel keeps displaying.

How do you prove the history survives a power loss? #

Fill several buffer positions, note the pointer value and two stored samples, remove supply power for at least a minute, restore it, and require the same pointer and samples back with the next sample landing at the pointer position, not at index zero.

Take the machine to a safe state, or run the test on the bench, before you cut power. Then:

  1. Let the program fill several buffer positions and write down the pointer value and two stored samples.
  2. Remove supply power for at least a minute, then restore it.
  3. Read the pointer and the same samples again. Both must match, and the next sample must land at the pointer position, not at index zero.
  4. Download the project again and repeat the power cycle. Programming tools treat retentive areas differently on transfer: one option maintains retentive values in the project file, so a download can push old buffer contents over the live ones, and a factory reset before a download clears the area. A zeroed buffer at this step tells you the transfer, not the power loss, is the hazard, so plan field updates around it.

With that test passed, the decision stands: hourly summaries ride in the panel's retentive buffer, minute-level series ride on the edge PC, and one power cycle proves which.

Questions asked

Can I store floating-point values in the buffer words?

Not directly in a word-oriented buffer. Multiply by a scale factor and store the integer: a 16-bit signed word holds -32,768 to 32,767, so a factor of 10 gives 0.1 resolution over roughly 3,276 either side of zero, and a factor of 100 gives 0.01 resolution over roughly 327. Apply the factor in reverse wherever the value is displayed or exported, and keep it constant for the life of the buffer.

How do I timestamp each sample without storing a time with every record?

Store one retentive base time and a running sample counter, then reconstruct: a record's time equals the base time plus its distance in samples from the newest entry multiplied by the interval, so five positions back at hourly logging means five hours earlier. This works only with a fixed interval and a real-time clock that is actually set, so check one full interval against a reference clock before trusting it.

Why must the sample be written before the pointer advances?

Because a power fail between the two actions then leaves a half-written record that the pointer does not count as valid, and the next sample overwrites it. Reverse the order and a restart can read a record that was only partly stored, which shows up later as one impossible spike in the series with no way to tell which point it is.

Can I shrink the requirement into daily summaries instead of raw samples?

Yes. Keep a running minimum, maximum and sum for each variable in three retentive words and reset them at midnight. Ten days times three words times four variables is 120 words, small enough for almost any retention range. You lose the shape of the series but keep the numbers a shift report or an energy log actually cites.

What happens if the buffer runs past the end of the retention range?

The operands beyond the range are simply not retentive: that part of the history clears at every power-off while the rest survives, so the series comes back with a hole in it. Shrink the interval or the variable count until the buffer, its pointers and the counter sit entirely inside the accepted range, then rerun the power-cycle test.

Keep reading

  • Selection guide

    Choosing an edge data path for periodic records

    For independent periodic samples, Tag Historian with Edge Sync Services is the reliable path and buffers 35 days locally. For one atomic row per collection cycle, use MQTT Transmission records landing in MQTT Recorder. For true transaction groups, license a standard gateway for that node.

    Edge computing and IIoT

  • Troubleshooting

    Event logging in Ignition Edge with one delimited string tag

    Arrays, datasets, UDTs and alarm associated data each break event logging on Edge: arrays split one event into one row per element, dataset history is not stored, and associated data cannot be queried centrally after sync. Historize a single delimited expression string tag in a tag group with rate negative one, trigger it from a tag change script, and parse the stored strings back into columns for tables and reports.

    Edge computing and IIoT

  • Comparison

    Historian-like data logging on a restricted edge network

    On a restricted plant network the approved destination decides the architecture: write directly from Node-RED to the database when that connection is approved, publish MQTT and land it in InfluxDB with Telegraf when only a broker is approved, and capture to local files when nothing outbound is allowed. Whatever the path, prove store-and-forward with an outage test sized from your tag count and write period.

    Edge computing and IIoT

Managing recipes on Ignition Edge without a database