05-05-2009 02:28 AM - edited 05-05-2009 02:30 AM
Hi,
We were using Traditional DAQ earlier with Borland C++.
We were using 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 ;
We are planning to use DAQmx with NI card 4461.
We will make use of measurement studio to define drivers etc. We read continous data from card.
Then we define a DaqTask1Component in our C# code and read data on its DataReady event.
AnalogWaveform<double>[] contains the data read from the cards and i can fetch value from
void objDaqTask_DataReady(object sender, DaqTask1ComponentDataReadyEventArgs e)
{
for(int i=0;i<e.GetData()[0].Samples.Count;i++)
{
double val = e.GetData()[0].Samples[i].Value;
//Frequency - How to calculate. In traditional C++ it was objCurrentMagnitude = x0 + i * dx;
//Magnitude - How to calculate. In traditional C++ it was objCurrentFrequency = measurement[i] * 1000 ;
}
}
How can i calculate the magnitude and frequency in DAQmx as i was doing with Traditional DAQ?
Do i need three parameters i.e. x0,dx,measurement here?If yes, where can i found the three parameters to calculate the freq and magnitude?
Regards,
Nirdesh
05-22-2009 01:58 PM
05-26-2009 11:55 AM