Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

time stamp

Hi,

 

I am very new to digitizers and signal analysis so I don't really know what I'm doing but if you can help I would greatly appreciate it. I am using an NI USB-5133 Digitizer.

 

I am going through the C# examples for the NI-SCOPE that come bundled with the drivers and I am capturing the wave form using this

 

AnalogWaveformCollection<double> waveforms = null;

waveforms = scopeSession.Channels[ScopeTriggerSource.Channel0].Measurement.FetchDouble(timeout, actualRecordLength, waveforms, out waveformInfo);

 

but I would like to be able to plot the amplitude vs the time that it was captured and I have tried to use 

 

waveform.PrecisionTiming.TimeStamp

or

waveform.Samples[i].PrecisionTimeStamp

 

However, both of these operations throw the exception {"The waveform timing does not have a time stamp."}.

I'm not really sure how to obtain the time that each sample is captured?

 

 

 

 

 

 

0 Kudos
Message 1 of 4
(5,645 Views)

Hello jonfrankel001,

 

I believe your issue maybe with how you are trying to plot the waveform. Have you tried using the PlotWaveforms Method?

 

Here is an example: 

 

PlotWaveformC#.png

 

FYI: This example was pulled from the Measurement Studio Help for the PlotWaveforms Method. 

 

Let me know if that helps!

 

Matthew R.
Field Applications & Systems Engineer
National Instruments

Certified-LabVIEW-Developer_rgb.jpg

Certified-TestStand-Developer_rgb.jpg


0 Kudos
Message 2 of 4
(5,621 Views)

Hi Matthew,

 

Thanks for the response.

 

My apologies, I wasn't clear that I am not trying to use the Measurement studio's graphs to plot my acquired data.

 

 I am trying to record the voltage from my device over a period of 5 seconds and then calucate the amount of time between impulses. That is why I was looking into the 

waveform.PrecisionTiming.TimeStamp
or
waveform.Samples[i].PrecisionTimeStamp

 methods.

0 Kudos
Message 3 of 4
(5,612 Views)

 jonfrankel001,

 

I believe you will need to extract the timing information from the ScopeWaveformInfo Structure (waveformInfo).

 

You will probably want to try something like this:

double t0 = waveformInfo[0].AbsoluteInitialX;

double dt = waveformInfo[0].XIncrement;

double N = waveformInfo[0].ActualNumberOfSamples;   

 

Where wavformInfo[0] is the returned array of the ScopeWaveformInfo structure that contains timing and scaling information about each waveform. Note that each index of the array is realted to each channel you are acquiring a waveform from. Therefore, if you only want one channel you would index [0]. 

Also where:

AbsoluteInitialX - Gets the timestamp, in seconds, of the first fetched sample that is comparable between records and acquisitions; all digitizers do not support this field.

ActualNumberOfSamples - Gets the actual number of samples fetched and placed in the waveform array.

XIncrement - Gets the time, in seconds, between points in the acquired waveform.

 

I hope this helps!

Matthew R.
Field Applications & Systems Engineer
National Instruments

Certified-LabVIEW-Developer_rgb.jpg

Certified-TestStand-Developer_rgb.jpg


0 Kudos
Message 4 of 4
(5,587 Views)