VirtualBench C Reference Help

MSO Read Considerations

  • Updated2023-09-07
  • 2 minute(s) read

MSO Read Considerations

This section contains information on MSO read functions.

Read Functions

There are three different functions you can use to read from the MSO. If you want to read from both the scope and logic analyzer, use niVB_MSO_ReadAnalogDigitalU64. If you want to read from just the scope, use niVB_MSO_ReadAnalog. If you want to read from just the logic analyzer, use niVB_MSO_ReadDigitalU64.

Scope Data

Scope data is represented as an array of double-precision floating point values interleaved per enabled channel. For example, if you enable both channels, three samples of the data are represented as such:

Array index012345
SampleSample 0Sample 1Sample 2
Channelch1ch2ch1ch2ch1ch2

In peak-detect mode, the minimum and maximum of each channel is represented by an array element. Three samples of data are represented as such:

Array index01234567891011
SampleSample 0Sample 1Sample 2
Channel Datach1 minch1 maxch2 minch2 maxch1 minch1 maxch2 minch2 maxch1 minch1 maxch2 minch2 max

MSO read functions include an output parameter that returns the scope data stride. The data stride is the number of bytes per sample aggregate. In the previous examples, the data stride of the interleaved array is 2, and the data stride of the peak-detect array is 4.

Logic Analyzer Data

Logic analyzer reads returns parallel arrays of data and timing information. The logic analyzer data is represented as a 64-bit integer, with each logic analyzer line corresponding to each bit in the integer. If a line is disabled the value for its bits will always be 0. The logic analyzer timing array indicates the offset of the sample from the initialTimestamp. The units of the timing array are in sample periods. This can be retrieved by calling either niVB_MSO_QueryTiming or, if you have configured the digital timing to be separate from the analog timing, niVB_MSO_QueryAdvancedDigitalTiming. The initialTimestamp is represented as a timestamp.