03-01-2007 10:08 AM
03-01-2007 10:10 AM
private
void start_Click(object sender, EventArgs e){
//double[] acquiredData = daqTaskComponent1.Read(); AnalogWaveform<double>[] acquiredData = daqTaskComponent1.Read(); //double [] acquiredData2 = daqTaskComponent1.Read();
Tremor.PlotWaveforms(acquiredData);
Sampledata.Text = acquiredData.Length.ToString();
//DataConverter.Convert(acquiredData, typeof(double[])); //System.Double [] data = DataConverter.Convert(acquiredData, System.Double); //Console.WriteLine(acquiredData.ToString()); Transforms.RealFft(acquiredData); //Transforms.PowerSpectrum(acquiredData); //Tremor.PlotWaveforms(acquiredData);}
03-01-2007 12:21 PM
03-02-2007 02:32 AM
Thanks, however it claims not to have a definition for GetRawData() I checked the class definition and can see that it ougth to. I've added all the references etc. Actually non of the methods etc. defined in the class is avaliable, it's rather wierd. dont know if u've experienced similar.
Regards
Simon
03-02-2007 02:35 AM
//double[] acquiredData = daqTaskComponent1.Read();
NationalInstruments.
AnalogWaveform<double>[] acquiredData = daqTaskComponent1.Read(); //double [] acquiredData2 = daqTaskComponent1.Read();Tremor.PlotWaveforms(acquiredData);
double[] data = acquiredData.GetRawData(); //Sampledata.Text = acquiredData.Length.ToString();
It apears that it is interpreted as the AnalogWaveform should be a System.Array ??
Regards
03-02-2007 05:01 AM - edited 03-02-2007 05:01 AM
You should call the GetRawData() function on the required AnalogWaveform<double> and not on acquiredData, which is an array. So, if you want to get data from the first analog waveform, you should probably doNationalInstruments.AnalogWaveform<double>[] acquiredData = daqTaskComponent1.Read();
Maheshdouble[] data = acquiredData[0].GetRawData();
Message Edited by mherle on 03-02-2007 05:02 AM
03-02-2007 06:01 AM
06-02-2009 12:22 PM
I cannot do a
convertdata.convet(data, oftype(double))
data is of type analog waveform.
It gives me the error that double cannot be an argument.
What is the most simple way to get the voltage from the hardware into a csv file? I already have created the file and am able to write to it, I just keep getting the output System Double[] when i try the above code.
06-05-2009 06:34 AM - edited 06-05-2009 06:35 AM
When I use
double[] data = acquiredData[0].GetRawData();
I get a System Double[] returned. What am I doing wrong?
06-08-2009 12:38 PM
You aren't doing anything wrong.
double is the C# keyword that means System.Double. System.Double is the actual data type in the .NET Framework Common Language Runtime.
Here is a link to the MSDN documentation that states this - http://msdn.microsoft.com/en-us/library/678hzkk9(VS.80).aspx.
If you want to do some reading that provides this kind of background information on .NET and C#, I (personally) highly recommend the book "CLR via C#", by Jeffrey Richter.
David Rohacek
National Instruments