Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How can we get frequency and magnitude values using NI 4461.

Hi,

We need to use NI 4461 instead of NI4551 because this is obsolete.

 

The problem is to understand how to get our desired values using NI 4461.

 

We were using C++ NIDSA_read_measurement (dsa_session, ipchannel, 0,measurement_length, 2, 0, 1,0, &x0, &dx, measurement);

 to calculate frequency and magnitude as shown

below:

objCurrentMagnitude = x0 + i * dx;

objCurrentFrequency = measurement[i] * 1000 ;

 

 

In DaqMx we can get voltage value from NI 4461 card by using

  

myTask.AIChannels.CreateVoltageChannel(...);

reader = new AnalogMultiChannelReader(myTask.Stream);

 

reader.ReadMultiSample(800);

 

But the problem is about converting/getting frequency and magnitude values.

 

How can i get frequency and magnitude values using NI 4461.

 

Do we need to perform some FFT on this voltage recieved or we need to use some different method to get values.

 

Can you please share some code for .Net 2.0 for this issue?

 

Regards,

Nirdesh

 
0 Kudos
Message 1 of 8
(4,401 Views)

Consider the NI Measurement Studio Product which has signal processing and instrumentation graphics for .net. 

 

http://zone.ni.com/devzone/cda/tut/p/id/3715#toc5 

 

These include filters and FFT processing

here is a class hierarchy chart

https://www.ni.com/docs/en-US/bundle/373528f/resource/373528f.pdf

 

Hope this helps

 

Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 2 of 8
(4,398 Views)

Hi Preston,

 

Thanks for the information.

 

Can someone please let me know if we can do this frequency and magnitude calculation directly in NI-DAQmx also i.e. without Measurement Studio.

 

If we plan to go for Measurement Studio then which one is sufficient for this requirement:

            - Standard Edition

            - Professional

            - Enterprise

            - Suite

 

Can some one please share some code example?

 

Regards,

Nirdesh

0 Kudos
Message 3 of 8
(4,389 Views)
Duplicate
Simran K
National Instruments
Applications Engineer
0 Kudos
Message 4 of 8
(4,372 Views)

Hi Simran,

 

My purpose of posting this again was that this question can be more easily understood.

 

Hence the chances of reply are more.

 

Can you help me with my further question posted above.

 

Regards,

Nirdesh

0 Kudos
Message 5 of 8
(4,369 Views)

Hi,

 

We have continued to write some code for frequency and magnitude.

 

 Attached is the sample POC with code on timer tick. 

 

NationalInstruments.Analysis.Dsp.Transforms.PowerSpectrum(dataRowCopy);                 for (int i = 0; i < 800; i++)                {                    freq[i] = dataRow[i];                } ComplexDouble[] FFTValue;                FFTValue = Transforms.RealFft(dataRow);                 magnitudes = ComplexDouble.GetMagnitudes(FFTValue);

 

 

Please let us know if this the right approach for our purpose of calculating magnitude and frequency.

 Regards,

Nirdesh

 

0 Kudos
Message 6 of 8
(4,290 Views)

Hi,

 

You are correct that you have to use NationalInstruments.Analysis.Dsp for it.

 

Seems to me that you are doing correctly. But I am not well versed with the programming language you are using, but have a look at this video link 

Data Acquisition in C#.NET:http://zone.ni.com/wv/app/doc/p/id/wv-783

 

On slide 17:analysis they have clearly shown what to use to get FFT.

Also they are getting the magnitudes automatically. I suppose the frequency values can be obtained by the index number of the array.

 

Hope this helps.

.......^___________________^
....../ '---_BOT ____________ ]
...../_==O;;;;;;;;_______.:/
.....),---.(_(____)/.....
....// (..) ),----/....
...//____//......
..//____//......
.//____//......
..-------
0 Kudos
Message 7 of 8
(4,280 Views)

Hi cs_BOT,

 

You said "Also they are getting the magnitudes automatically.".

 

I could not locate the magnitudes on this slide number 17.

 

What i understand here is that

 

  1. e.GetData gives the voltage values.

    double[,] data = e.GetData();

  2. Power spectrum changes this to frequency which is stored by iteration.

    Transforms.PowerSpectrum(SingleChannel);

 

But magnitude still seems missing.

 

Please let me know if i am missing something.

 

Regards,

Nirdesh

0 Kudos
Message 8 of 8
(4,257 Views)