LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a new log file every hour

I have a program which receives measurement data and writes this data to TDMS file. However, I want to create a new TDMS file every hour. When I put a while loop in mu sub vi which creates the new file the program doesn't run. I have attached the sub vi. Can anyone help me out here?

 

Cheers

0 Kudos
Message 1 of 6
(3,534 Views)

How are you running this subVI?  Is it part of another VI?

 

Your subVI runs.  It has a while loop in it that doesn't do much other than create a new file path every 60 seconds.  It stays in the while loop until the user presses the stop button.  And that won't happen if this is a subVI and the front panel isn't shown.

 

I don't know why you are obtaining a queue outside the loop.

0 Kudos
Message 2 of 6
(3,526 Views)

One trick for doing this is to prepend the file name with YYJJJHH See example

predate.png

 

Then just check if file exists (if not create and add headder) when you write to file.

 

This also generates the reports in "alphabetical" order so windows explorer presents them chronologically.Smiley Wink

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 6
(3,521 Views)

Yes this is a sub VI inside another VI. And that is exactly my problem, the sub vi keeps running when I hit stop. Although I don't know how to keep creating new files at a time interval without using a loop...

 

Will it help if I post the main VI?

0 Kudos
Message 4 of 6
(3,496 Views)

@TGL wrote:

Yes this is a sub VI inside another VI. And that is exactly my problem, the sub vi keeps running when I hit stop. Although I don't know how to keep creating new files at a time interval without using a loop...

 

Will it help if I post the main VI?


can't hurt


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 6
(3,485 Views)
0 Kudos
Message 6 of 6
(3,482 Views)