02-11-2014 03:08 AM - edited 02-11-2014 03:10 AM
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?
02-12-2014 09:13 AM
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:
FYI: This example was pulled from the Measurement Studio Help for the PlotWaveforms Method.
Let me know if that helps!
02-13-2014 12:16 AM
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.
02-14-2014 12:02 PM - edited 02-14-2014 12:03 PM
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!