LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Data Logging to new .txt file after every 30mins

Solved!
Go to solution

Hi,

 

I have written a program that serial reads from arduino the Dallas DS18B20 two sensors data as well as the stepper motor position data. I ran my setup for 24 hours but end up having a 70GB .txt file which I cannot open easily. What i ask help here that if possible someone can help me with how can I generate a new .txt file after every 30mins. So my log files are still able to open easily by any test editor. 

Please find my .VI attached. 

Thanks.

 

0 Kudos
Message 1 of 16
(4,421 Views)

The simple way is to use the Elapsed Time express VI in the Timing palette.  When the time has passed, close your current file and create a new one.  If you dig into the File IO->Advanced File Functions, you will find a VI in there called Create File With Incrementing Suffix.  That will help keep unique file names.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 16
(4,406 Views)

thank for the reply.

 

I able to get new files but they are empty , i want my serial data captured it to be in it as well. is there any example to use this feature. Thanks. 

0 Kudos
Message 3 of 16
(4,404 Views)

Are you storing your file reference in a shift register?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 16
(4,402 Views)

First question, do you need to save that much data? Second thought would be if you do, you should be using a database and not files.

 

If you must use files that you need to open/close/create your file within your loop. In your current code you are opening the file outside your loop so you end up with  a single file. I would recommend that you look at using a state machine or a producer/consumer pattern for your application.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 16
(4,380 Views)

Hi,

 

No I guess, I am not familiar with this technique. please find in attachment the .VI i did, its incomplete coz i am not getting any idea how to use it in line with my codes. It runs but goes to False.

0 Kudos