09-18-2018 03:22 AM
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.
Solved! Go to Solution.
09-18-2018 05:35 AM
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.
09-18-2018 05:57 AM
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.
09-18-2018 06:21 AM
Are you storing your file reference in a shift register?
09-18-2018 09:22 AM
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.
09-19-2018 03:52 AM
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.