LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS log last N hours

Hi, i'm working on project. We are doing acquisition during very long time (can be 60 days). I need to log on harddrive the last 2 hours .

In normal condition i need to save 5 minutes every 2 hours . In case of failure i need to save the last 2 hours. (Frequency of acquisition is low 20HZ)

Is it possible to use tdms recording to achieve this . At first i'm thinking to limit sample by file, then extract data from tdms to create new one.

 

Regards

 

0 Kudos
Message 1 of 2
(3,004 Views)

Hello, it seems to me that what you need is some sort of circular buffer 72000 elements long (3600 sec * 2 * 20Hz). TDMS is not the proper instrument to achieve this, since you cannot delete elements from the file once written; I suggest you to keep all data in memory instead, and dump the whole set of data to disk only in case of failure, with a format at your choice.

 

A good and simple way of storing data in memory for this purpose is to have an 72000-elements array with proper initialization at program start; when you need to record a measure, you can shift all elements by one to the right and store actual measure in element 0: that way your data will be always stored in the array sorted from the most recent backwards with increasing index.

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(2,994 Views)