LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Long term logging in Labview with auto file creations

What is the best way to setup a loop in labview that automatically saves data (from DAQmx Base) into 1 hours worth of collection and then starts over again into a new filename (with date and time stamp) and keeps going for about 3 months - so that you end up with about 2160 separate data files? Thanks.
0 Kudos
Message 1 of 8
(3,911 Views)
Hi
I generally follow this kind of practice.
In my code i generally allow user to specify the base folder for logging data through configuration panel.
Inside Base folder then i create the folder for current year, current month (and in your case you can creat a folder for a day which contains 24 files for 24 hrs)
hence the hierachy lwill look like "c:\Test Data\2005\Nov\29\3pmTo4pm.txt"
while logging data you can check that all the folders specified in path do exist and then you can create the file for current hr.
 
 

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 2 of 8
(3,900 Views)
hi,
 
In the Attached VI a new file is created every hour and data is logged into it.
 
the new file created will have hour, date and month(h_d_m.txt) as its name.
 
Here i am logging dummy data, the same logic can be used for logging DAQmx data as well.
 
for including time stamp, quite a few ideas can be found in labview examples.
you decide which will serve your purpose.
 
Regards
Dev
 
 
 
 
Message 3 of 8
(3,895 Views)
Hey Thanks Guys.

By the way, would you do any changes to this if you wanted to convert the data to binary form first?

Thanks.
0 Kudos
Message 4 of 8
(3,882 Views)

Hi,

my logic should work just fine for binary data too, except modify/use relevent file write VI for that.

Regards

Dev

 

Message 5 of 8
(3,871 Views)

I think its better to sort out the files in folders as per months and years...(depending on how many files are gettting generated.)

just imagine how difficult it is to search a file like 10_10_05.txt in more that 1000 files

one more thing to note down: files saved with this naming format do not appear in proper order after setting the sort order to "sort by name" in windows.

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

Message 6 of 8
(3,866 Views)

Tushar,

This program is just to demonstrate how a new file can be created every hour and stored. It is not hard bound that the files have to be named with this nomelclature itself.

The user can modify the logic as per his requirement.

I can recomment a lot of ways to handle files, like creating a new folder for each day and saving the folder and so on.

There are a lot of options.

The designer just has to explore it.

hope this answers your commnet

regards

Dev

 

Message 7 of 8
(3,858 Views)

thushar,

This is to answer your other comment.

You said, "one more thing to note down: files saved with this naming format do not appear in proper order after setting the sort order to "sort by name" in windows."

But if you check it, you will find one more option called "sort by date" in Windows.

If you select this option for sorting file in windows, you will find that these files created as i have explained, will indeed fall in the order they were created!  😉

Voila!

In the end, if all this discussion has solved 'Hmarcallo's' problem, i would consider the whole discussion worthwhile.

Regards

 

 

 

 

Message 8 of 8
(3,834 Views)