LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT transform to know the signal frequency

In my cRIO 9040 more precisely on the NI-9381 module I have a voltage value in differential mode and I want to measure the signal frequency through FFT, I was testing a little code but I am not quite understanding how I add the signal in FFT.

 

attached my file vi

 

0 Kudos
Message 1 of 6
(2,678 Views)

You need an accumulation of samples to perform the FFT on.  With a cRIO, I would probably use a DMA to stream the data from the FPGA to the host.  The host would check to see how many samples are there and repeatedly check until x samples are ready (x should equal the FFT size).  Then read the data from the DMA and do the FFT.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,668 Views)

@crossrulz wrote:

You need an accumulation of samples to perform the FFT on.  With a cRIO, I would probably use a DMA to stream the data from the FPGA to the host.  The host would check to see how many samples are there and repeatedly check until x samples are ready (x should equal the FFT size).  Then read the data from the DMA and do the FFT.


Unfortunately, I do not have one to try, just a cRIO 9039, but, I believe the the 9040 series added DAQmx support. You should be able to use DAQmx functions in the RT module and forget about DMA streaming and FPGAs. Seems simpler for just needing a FFT of a voltage input.

 

mcduff

0 Kudos
Message 3 of 6
(2,596 Views)

mcduff can you help me in the code of DAQmx? I´m not understand how i use the DAQmx initial configuration to access to analogic port in my cRIO9040

0 Kudos
Message 4 of 6
(2,553 Views)

You can look at this link, https://www.ni.com/en/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-handl...

 

Unfortunately, I do not have the 9040 and do not know if there are any differences between normal DAQmx and the "new" DAQmx that runs on the RT module.

 

My guess is to look for examples in the example finder specifically for DAQmx on RT, and look on the RT side for the DAQmx functions and the associated help files. I believe all of the AI should occur on that side (RT) and the FPGA does not need to be touched, but not sure. I am going off what a NI rep told me.

 

mcduff

0 Kudos
Message 5 of 6
(2,546 Views)

The 9045 (and so hopefully the 9040) have DAQmx that behaves very nicely.

It's just like the desktop, except for all the deploying back and forth...

You could definitely use it to acquire an array of N points and then use the RT system to either build larger arrays or window or whatever and then do an FFT.

 

To use a C-series module in DAQmx mode, set the deployment type to "Real Time [NI-DAQmx]". They appear in the "Real-Time Resources" section of a project view, unlike FPGA modules which appear under the Chassis.

With some removal, because I was feeling shy ;)With some removal, because I was feeling shy 😉


GCentral
0 Kudos
Message 6 of 6
(2,535 Views)