Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting owner measurement file to Tdms takes too much time

Hi everybody,

 

For high speed acquisition, we created our own measurement file.

Each file is divided in blocks.

Each block contains the data of all recorded channels.

Each channel contains a number of data depending on the acquisition frequency.

It means that for example ai0 could have 10 samples per block, ai1 could have 100 samples per block....

 

What I want to do is to convert this file to a tdms one but unfortunately for huge files it can takes hours to be created.

For example : I record data during 30 secondes, the file contains 16 analog inputs acquired at 500kHz, 32 analog inputs acquired at 10kHz and 64 other channels acquired at 1kHz.

The recorded file size is 503MBytes.

 

To convert it to tdms, it takes 20 hours (too much time for the customer Smiley Frustrated).

 

My C# code is the following to add the data :

 

AnalogWaveform<double> waveForm = group.GetAnalogWaveform<double>(group.GetChannel(VALUE));
waveForm = AnalogWaveform<double>.FromArray1D(aic.Block.ElectricalValues);
group.AppendAnalogWaveform<double>(group.GetChannel(VALUE), waveForm);

This code is called after reading each block to add each data to the good channel in the Tdms file.

 

What I see is that after reading each block and writing the data to the tdms file, it takes longer to write each channel.

In my case, writing the first data block to the tdms file takes 1 sec.

The second block takes 2 sec.

The third block takes 3 sec.

...

After reading 48% of my measurement file, the block is written in 3 minutes and 48 secondes.

 

Conclusion, it takes long time to create the tdms file. I think some operation are done by the AppendAnalogWaveForm.

 

Does someone know how to optimize it or maybe there is a better solution to be compatible with DIAdem.

 

Thanks,

 

CFOE

 

0 Kudos
Message 1 of 1
(5,119 Views)