You can fetch scalar and array measurements with the Fetch Measurement, Fetch Measurement Stats, and Fetch Array Measurement functions. The channel list and timeout parameters are identical to the waveform functions. However, instead of returning waveforms, these functions return either the specified scalar measurement or the specified array measurement. In LabVIEW, versions exist that fetch either a single measurement or an array of measurements. The C and Visual Basic versions return an array of measurement results, just as the Fetch functions can return an array of waveforms. The order of the returned results is the same as in the Fetch functions. C and Visual Basic users can dynamically declare memory for the measurement results using code such as the following.

Note   The following sample code uses the Actual Meas Wfm Size function to query how many samples are available in the resulting array measurement.

ViConstString channelList = "0,1"; ViReal64 *results; niScope_ActualNumWfms (vi, channelList, &numWfms); results = malloc (sizeof (ViReal64) * numWfms); niScope_FetchMeasurement (vi, channelList, timeout, NISCOPE_VAL_RISE_TIME, results); ViReal64 *measWfm; struct niScope_wfmInfo *measWfmInfo; niScope_ActualMeasWfmSize (vi, NISCOPE_VAL_FFT_AMP_SPECTRUM_DB, &measWfmSize); measWfm = malloc (sizeof (ViReal64) * measWfmSize * numWfms); measWfmInfo = malloc (sizeof (struct niScope_wfmInfo) * numWfms); niScope_FetchArrayMeasurement (vi, channelList, timeout, NISCOPE_VAL_FFT_AMP_SPECTRUM_DB, measWfmSize, measWfm, measWfmInfo);

Steps for Fetching Scalar and Array Data with Fetch Functions

  1. Create a new instrument session using the niScope Initialize VI or the niScope_init function.
  2. Configure the digitizer with NI-SCOPE Configuration functions.
  3. Call the niScope Initiate Acquisition VI or the niScope_InitiateAcquisition function to initiate a waveform acquisition. Data is acquired simultaneously on all enabled channels.
  4. Call the niScope Acquisition Status VI or the niScope_AcquisitionStatus function in a loop to verify whether the acquisition is complete or in progress. Alternatively, you can pass a nonzero timeout value to the Fetch Measurement or the Fetch Array Measurement function.
  5. Call a Fetch Measurement VI or function.