10-22-2019 09:14 AM
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
10-22-2019 09:33 AM
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.
10-22-2019 05:30 PM
@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
10-23-2019 09:44 AM - edited 10-23-2019 09:45 AM
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
10-23-2019
09:55 AM
- last edited on
12-20-2024
11:52 AM
by
Content Cleaner
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
10-23-2019 11:05 AM - edited 10-23-2019 11:09 AM
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 😉