LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

some questions about TDM /TDX file(with my demo program)

my program will save continuing  data to TDM file ,in this demo program ,
I use Timer(interval=1s ) to generate data ,and DDC_AppendDataValues function to append data to TDM file,
I find the CPU and PF RAM will increase slowly ,if  TDM size reaches 30MByte,my PC will become very slow,
 but when I use  DDC_CloseFile function to close my file ,CPU and PF usage will return to initial status,
I want to know what's wrong with DDC_AppendDataValues function .
 
Thanks
My CPU 2.4GHz,256M RAM, data count to save every time is 40000 (float),two channels(each is 20000), TDM file's size 300MByte approximately.
0 Kudos
Message 1 of 15
(3,976 Views)

Original codes:

// Write the data in the channels 

DDC_AppendDataValues  (channels[0], tempDataWrite,20000);    
 DDC_AppendDataValues  (channels[1], tempDataWrite+20000,20000);

Corrected codes:

// Write the data in the channels 

DDC_AppendDataValues  (channels[0], tempDataRead,20000);   
 DDC_AppendDataValues  (channels[1], tempDataRead+20000,20000);

0 Kudos
Message 2 of 15
(3,931 Views)
Hi
 
Does this happen with any DIAdem tdm file?  or is it exclusively with the one you are using.  If so, please send me the file you are using.  Also, does this happen only when appending to an exisitng file or witing to a blank one?
 
Thank you
Nandini
0 Kudos
Message 3 of 15
(3,923 Views)
Hi  Nandini
 
Q1:Does this happen with any DIAdem tdm file?  or is it exclusively with the one you are using. 
Q2:Does this happen only when appending to an exisitng file or witing to a blank one
A:   I just create my TDM file using my demo program ,first I create a new tdm file, and save some data ,then I append new data continuously,the timer interval is 1 second. All of those can be tested by my demo program posted above.
I didn't test any other existing  DIAdem tdm file.
 
 
Thanks
 
0 Kudos
Message 4 of 15
(3,907 Views)

I think there are some performance issues when appending to large files using the DIAdem library.  Performance decreases as the file grows.

You should be able to minimize the performance issues by saving less frequently or saving only after you have appended all data.  The downside of this change is that by saving less frequently, you will be losing more data if your program shuts down unexpectedly.  This will not necessarily reduce the memory usage of your application, but I think it will make it run faster.

I hope this helps.

-Jeff

0 Kudos
Message 5 of 15
(3,879 Views)
 
Hello  Jeff
Thanks you for you suggestion.
I have noticed the Save Function will consume much CPU time,and in my application I must save data every time .
And  I want to definitely know if the memory usage can not be reduced when appending  contiuous data to large file  .
 
Any suggestion will  be appreciated.
 
 
0 Kudos
Message 6 of 15
(3,877 Views)
Hi  all
 
Can anyone else give me some suggestion ?
 
 
Thanks
0 Kudos
Message 7 of 15
(3,850 Views)
Hi  all
 
Can anyone else give me some suggestion ?
 
 
Thanks
0 Kudos
Message 8 of 15
(3,852 Views)

At the risk of stating the obvious, how many times do you press your TEST button? Because of the way you allocate memory, every time you press it more than once you will leak 640000 bytes of memory. Not a problem if you only press it the once, but it is an obvious potential problem.

I usually do all my memory allocation (and de-allocation) in the main() function, immediately around the call to RunUserInterface().

JR

0 Kudos
Message 9 of 15
(3,845 Views)
Hi  JR
 
  Thanks for your reply,I just press TEST button once.
  
 
 
 
0 Kudos
Message 10 of 15
(3,829 Views)