NI-SCOPE .NET Class Library Help

Table of Contents

ScopeChannelMeasurement.Read Method (PrecisionTimeSpan, Int64, AnalogWaveformCollection(Double), ScopeWaveformInfo[])

  • Updated2023-09-06
  • 3 minute(s) read
ScopeChannelMeasurement.Read Method (PrecisionTimeSpan, Int64, AnalogWaveformCollection(Double), ScopeWaveformInfo[])

ScopeChannelMeasurementRead Method (PrecisionTimeSpan, Int64, AnalogWaveformCollectionDouble, ScopeWaveformInfo)

Initiates an acquisition, waits for it to complete, and retrieves the data. This method may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify.

Namespace:  NationalInstruments.ModularInstruments.NIScope
Assembly:  NationalInstruments.ModularInstruments.NIScope.Fx45 (in NationalInstruments.ModularInstruments.NIScope.Fx45.dll) Version: 2023

Syntax

public AnalogWaveformCollection<double> Read(
	PrecisionTimeSpan timeout,
	long numberOfSamples,
	AnalogWaveformCollection<double> waveforms,
	out ScopeWaveformInfo[] waveformInfo
)
Public Function Read ( 
	timeout As PrecisionTimeSpan,
	numberOfSamples As Long,
	waveforms As AnalogWaveformCollection(Of Double),
	<OutAttribute> ByRef waveformInfo As ScopeWaveformInfo()
) As AnalogWaveformCollection(Of Double)

Parameters

timeout
Type: NationalInstrumentsPrecisionTimeSpan
The time to wait for data to be acquired. Using 0 for this parameter tells NI-SCOPE to fetch whatever is currently available. Using -1 for this parameter implies infinite timeout.
numberOfSamples
Type: SystemInt64
The maximum number of samples to fetch for each waveform. If the acquisition finishes with fewer points than requested, some instruments return partial data if the acquisition finished, was aborted, or a timeout of 0 was used. Use –1 for this parameter if you want to fetch all available samples. The method reads the actual record length and attempts to acquire all available samples. If it fails to complete within the timeout period, the method returns an error.
waveforms
Type: NationalInstrumentsAnalogWaveformCollectionDouble
The waveform object whose memory can be reused while creating the output waveform. To allocate memory during the call to this method, set waveforms to . The method will also allocate memory during the call if waveforms is set to a waveform object with zero-sized data or waveforms is set to a waveform object with a different size than that required for the output waveform. For example, if waveforms is set to a waveform object with the same size as that required for this method call, then no new memory is allocated for the output waveform, and instead the memory of the waveform object from waveforms will be reused for the output waveform.
waveformInfo
Type: NationalInstruments.ModularInstruments.NIScopeScopeWaveformInfo
An array of ScopeWaveformInfo objects.

Return Value

Type: AnalogWaveformCollectionDouble
An object of type AnalogWaveformCollectionTData. NI-SCOPE returns this data sequentially, so all record 0 waveforms are first. For example, with a channel list of 0,1, you would have the following index values:

index 0 = record 0, channel 0
index x = record 0, channel 1
index 2x = record 1, channel 0
index 3x = record 1, channel 1

Where x = the record length
Note Note
If you are using this entry point or any of its overloads or async versions to read complex data, then you will either recieve double the number of samples or double the number of records requested depending on the value of FetchInterleavedIQData.

If FetchInterleavedIQData is set to , then the waveforms returned will contain twice the number of samples specified by numberOfSamples. Every two samples represents interleaved IQ data.

If FetchInterleavedIQData is set to , then the waveform collection returned will contain twice the number of records requested. Each pair of records represents one waveform of I data, and one waveform of Q data.

Exceptions

ExceptionCondition
ObjectDisposedExceptionRead(PrecisionTimeSpan, Int64, AnalogWaveformCollectionDouble, ScopeWaveformInfo) was called after the associated NIScope or ScopeDriverUtility object was disposed.
IviCDriverException The underlying NI-SCOPE driver returned an error.

See Also

Log in to get a better experience