Internals: Sampling

Each sample has a time stamp, which places it on the X-Axis aka Time Axis. For historic samples, the time stamps from the archive are used.

Live samples usually also arrive with a time stamp; one that the control system assigned when the sample was taken. For several reasons, that time stamp might differ by up to a few seconds from the wall clock time when that time stamp arrives at the data browser. There are unpredictable network delays; the front-end computer might be temporarily busy with tasks other than sending network updates; or the sample might simply not change for a long time, and thus no new time stamp is assigned. The latter especially applies to setpoint-type PVs.

The author has so far failed in all attempts of using that original 'live' time stamps when it comes to a scrolling, strip-chart type display. We obviously want to display the 'current' time in the right border of the plot. Assume we scroll, i.e. update that right border 'current' time each second. Also assume that we receive a sample with a time stamp that is 1 second old. So we could display that sample 1 second to the left of the plot edge. If one second later we don't receive another sample, we could either display a 2 second gap, or assume that the sample didn't change, and simply extend the value of the old sample until 'now'. Both options are iffy: If a sample like a setpoint value only changes once a week, and we only plot that old point, the plot will be pretty empty, even though humans would consider that value still 'current'. On the other hand, if we simply extend the last value of e.g. 42, time-stamped long ago, until 'now', consequently draw a line at y=42 to the right border of the plot, and then eventually receive a new value of 43, also for example 1 second old by the time we receive it, the plot will confuse users, because the value at the right edge of the plot for the last few seconds will suddenly jump from 42 to 43.

As a result, the Data Browser handles 'live' data like most other strip-chart type tools: It assigns the current wall clock time whenever taking a sample. This results in a consistent strip-chart display at the right edge of the plot. The downside is a slight inconsistency of maybe a few seconds when later comparing a snapshot of 'live' data with archived data, because the archived data will carry the exact time stamp received with the sample.