Computing Library › Real Time Systems
Real Time Systems

Real-Time Data Logging

Logging must capture high-rate control and diagnostic data without disturbing the real-time loop it observes, preserving both timing and integrity.

Recording Without Interfering

Real-time data logging captures the stream of measurements, commands, and events a control system produces, for later analysis, debugging, and validation. Its central challenge is that logging must not steal timing from the control it observes. A logging operation that blocks the control loop, or that shares a resource unpredictably, can turn a well-behaved system into one that misses deadlines.

Decoupling from the Critical Path

Kronos motion — control room

The standard technique is to separate the fast producer from the slow consumer with a buffer. The control loop writes samples into a lock-free or double-buffered region in bounded, minimal time, and a lower-priority task or a direct-memory-access engine moves the data to storage in the background. The critical path only ever does a fast, deterministic write; the heavy, variable work of formatting and storing happens where it cannot delay control.

Requirements

Handling High Rates

Fast control and rich diagnostics generate large data volumes. Logging systems handle this with efficient binary formats, compression done off the critical path, and storage bandwidth sized to the sustained rate. When storage cannot keep up indefinitely, ring buffers keep the most recent history, and triggered capture saves a full-rate window around events of interest while logging summaries continuously. This keeps the most valuable data at full fidelity without requiring unlimited bandwidth.

Why It Matters

Logged data is how a system's real behavior is understood and its timing verified. Measured jitter, actual worst-case loop times, and the sequence of events before a fault all come from logs. For an experimental facility such as a fusion machine at the design and simulation stage, faithful high-rate logging is also the record from which physical events are reconstructed and against which models are validated, so its accuracy and completeness are as important as the control it accompanies.