High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I configure the NI-5112 digitizer for time interval measurement?

I have successfully done a basic waveform capture/measurement with my new NI-5112 digitizer
using CVI 6.0 and the niscope.fp.
Now I want to put a signal into channel 0, another signal into channel 1 and measure the time interval between an edge (rising or falling TBD) of one signal and an edge of the second signal.
Which "READ" configuration from the list best relates to time-interval measurements?
 
Scott Youngren
Test Engineer
scott.youngren@ngc.com
 
0 Kudos
Message 1 of 5
(7,145 Views)
Hello Scott:
 
 I did a application using Visual Basic with NI-5112. Maybe it can help you ....
 
            A sample structure of program:
   'Initialize Scope
 niScope_init("DAQ::1, NISCOPE_VAL_FALSE, NISCOPE_VAL_FALSE, vi)
 niScope_ConfigureAcquisition(vi, NISCOPE_VAL_NORMAL)
 
   'Configure Vertical for each channel
 niScope_ConfigureVertical(vi, "0", ....
 niScope_ConfigureVertical(vi, "1", ....
 
   'Configure Channel Characteristics for each channel
 niScope_ConfigureChanCharacteristics(vi, "0", ....
 niScope_ConfigureChanCharacteristics(vi, "1", ....
 
   'Configure Horizontal timing
 niScope_ConfigureHorizontalTiming(vi, ....  
 
   'Define Trigger
 niScope_ConfigureTriggerEdge(vi, "0" or "1" or "VAL_EXTERNAL", ...
 
   'Initiate Acquisition
 niScope_InitiateAcquisition(vi);
 
   'Retrieve Record Length
 niScope_ActualRecordLength(vi, actualRecordLength);
 
   'Make an array for waveforms, size must be RecordLength * 2
 Redim waveform( 0 to (actualRecordLength * 2) - 1)
 
   'Fecth de acquisition
 niScope_Fetch(vi, "0,1", TimeOut, actualRecordLength, waveform(0), wfmInfo(0))
 
   'You must fetch all channels together to make sure that the acquisition moment is the same
   'Where:
   '    TimeOut  - must be higher than (RecordLenght / SampleRate) + time for trigger
   '     waveform - array with channels acquisition
   '                 For example, if actualRecordLength is 25000  
   '                 from item 0     to 24999 => Samples for CH0
   '                 from item 25000 to 49999 => Samples for CH1
   '
   '     wfmInfo  - array with timing information for each channel
   '     wfminfo(0).relativeInitialX = The start time acquisition for CH0
   '     wfminfo(1).relativeInitialX = The start time acquisition for CH1
   '     wfminfo(0).xincrement = time increment for each item of waveform array for CH0
   '     wfminfo(1).xincrement = time increment for each item of waveform array for CH1
   Now you can made a algorithm to search edge transitions for each channel into waveform array
   Something like search for 2 positions at rising edge:
    1st - when signal pass over 10% of total range
    2nd - next item when the signal pass over 90% of total range
    The time of each item can be calculated as: relativeInitialX + (item * xincrement)
    You can make a interpolation to search the time for 50% of total range
    With time values of each channel you can calculate the difference between them.
Bye.
0 Kudos
Message 2 of 5
(7,133 Views)

Marcelo

Thanks for the great info. I'll give this a try (in CVI). I'm just beginning to learn how to make the 5112 work.

 

Scott Youngren

0 Kudos
Message 3 of 5
(7,126 Views)
Who can give me a LabVIEW example please?I'm not familiar with CVI!
0 Kudos
Message 4 of 5
(7,121 Views)
An easier way is to use the NI-SCOPE measurement functions.  In particular, you want time delay (one of the scalar measurements).  If you are unfamiliar with these, check out the NI-SCOPE examples.  You can find them with the LabVIEW example finder.  Make sure you set the other channel property before fetching so NI-SCOPE knows which channels to compare.
0 Kudos
Message 5 of 5
(7,117 Views)