06-10-2014 08:12 AM
I'm using the NationalInstruments.Tdms.dll, v4.0.30319 for logging my aquisited data in my WinForm App.
It worked fine when the data was in the AnalogueWaveForm-format, but I also need to be able to log data from an double array.
But the following example doesn't work:
channelGroup.AppendData<double[ ]>(channels, waveforms, NationalInstruments.Tdms.TdmsDataLayout.Interleaved);
channels = new TdmsChannel[ Channels(16) ];
waveforms = double[ Channels(16) ] [ SAMPLE_COUNT ]
Running this code throws the following Exception:
System.InvalidOperationException: The type parameter of the method does not match the data type of the TDMS channel data.
at NationalInstruments.Tdms.TdmsChannelGroup.AppendData[TData](TdmsChannel[] channels, TData[] data, TdmsDataLayout dataLayout, TdmsSaveFile saveFile)
at NationalInstruments.Tdms.TdmsChannelGroup.AppendData[TData](TdmsChannel[] channels, TData[] data, TdmsDataLayout dataLayout)
at Datenaufnahmesystem.FormMain.WriteTdmsWaveforms(Double[][] waveforms) in \FormMain.cs:line 468
A first chance exception of type 'System.InvalidOperationException' occurred in NationalInstruments.Tdms.dll
How can I make this work?
06-13-2014 03:30 AM
I wasnt able to append all channels at once like described above, but doing it for each channel seperatly works just fine:
channels[0].AppendData(waveforms[0]);
channels[1].AppendData(waveforms[1]);
..
..