High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure with High Speed Digitizer at specific intervals using NI Scope in Matlab?

Hi all,

 

I'm using an NI High Speed Digitizer to measure the noise signal of an amplifier, amplifiing a known sine wave. The digitizer is controlled by a computer using Matlab and NI Scope. 

 

I want to continuously measure 1 milisecond of data, with 0.5 second intervals. Because I'm averaging the 1 milisecond pieces of data, the data should be measured everytime at exactly the same spot in my generated waveform (a sine). I think one of the solutions is to use the internal clock of the NI Digitizer as a trigger.  I saw some examples on the internet and in the guide using a Trigger Offset, but it is not clear to me how to add it to my code, and which specific commands I should use.

 

To fetch data I'm using:

invoke(ni.Acquisition, 'initiateacquisition');
[waveformArray, waveformInfo] = invoke(ni.Acquisition, 'fetch', channelList, TimeOut, numSamples, waveformArray, waveformInfo);

 

This clearly does not use the internal clock, but just measures as the piece of code is ran by Matlab. 

 

How could I build in an exactly known delay?

 

Thanks!!

 

Jeroen

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

Hi Jeroen,

 

If you want to work with text based programming in LabVIEW you could possibly use the MathScript node. However, if you want to work with The MathWorks, Inc. MATLAB® with NI hardware this is usually done using the Data Acquisition Toolbox®. It would be best to contact The MathWorks, or go to their forums to get help with using this software. 

 

MATLAB® is a registered trademark of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 2 of 4
(5,857 Views)

Hi Miles,

 

Thanks for your answer. I found a diferent way to solve the problem. I now use an external clock (signal generator) to generate the start pulses for the measurement and use "Configureedgetrigger". It may be possible and more beautiful to use the internal clock, but for now this is easier and also solves the problem.

 

Jeroen

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

Hi jvdap,

I am working on acquiring data from an NI digitizer in Matlab, but I couldn't find a way to do this continuously. I implement fetch function in a for loop and I acquire using edge trigger. However, at each loop iteration, Matlab returns the same waveformarray from the fetch. How did you manage to get new samples from the buffer continuously using fetch?

0 Kudos
Message 4 of 4
(3,129 Views)