Buffering

When a group of channels share timestamp, sample rate, and channel length properties, a buffer can be used to accumulate and share data between different sections of code. You can use a buffer to decouple one source (producer) of dynamic signals from one or multiple readers (consumers).

Log files, snapshots, data acquisition, and waveform generation VIs can all be sources of dynamic data. Generally, this data can be one or more channels. When the data includes multiple channels, all channels should share the following properties characteristic of simultaneously sampled data:

  1. Timestamp (t0)
  2. Sample rate (Fs = 1/dt)
  3. Channel length

Different buffer interfaces have different attributes; the waveform buffer and the queue share the following attributes: non-deterministic timing, flexible sizing, and flexible access options. Generally, a single writer is used to append new, continuous data to the data already in the buffer. Readers can read subsets of this buffered data as needed for processing in that section of code.

Table 1. Buffer Read Use Cases
Buffer Read Processing
Read next measurement samples Stimulus-response measurements
Read next continuous samples

Filtering

Integration

Statistical level

Continuous level

Fractional-octave analysis

Zoom FFT

Time-varying loudness

Envelope Detection

Tachometer processing

Angular resampling

Save to disk

Read next samples with overlap

Averaged FFT

Tone measurements

Averaged frequency response

Short-time fourier transform (STFT)

Block AC/DC level

Read specific samples at timestamp Subset analysis of waveforms
Read last N samples

Instantaneous frequency

Current speed

Historical chart

Read all samples Block processing when overwriting buffer

In the table above, the read modes are listed from strictest to loosest timing requirements. A unique reader timestamp allows each reader to access the 'next' data without creating a unique copy of all data per waveform buffer reader.