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 index | 0 | 1 | 2 | 3 | 4 | 5 |
| Sample | Sample 0 | Sample 1 | Sample 2 | |||
| Channel | ch1 | ch2 | ch1 | ch2 | ch1 | ch2 |
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 index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| Sample | Sample 0 | Sample 1 | Sample 2 | |||||||||
| Channel Data | ch1 min | ch1 max | ch2 min | ch2 max | ch1 min | ch1 max | ch2 min | ch2 max | ch1 min | ch1 max | ch2 min | ch2 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.