LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

New files are automatically created every hour to store the data being collected by the NI cDAQ

Solved!
Go to solution

Thank you for your reply. I used NI-cDAQ-9132.


@GRCK5000  已写:you want to be able to create new file every  (1) hour. Is that right? 

yes!But Mcduff has already solved this problem, and now I have another question that is how to realize on the vi provided by Mcduff that no matter how many times vi is run, the files generated by the vi program run last time will not be overwritten by the files generated by the vi run next time, but continue to accumulate? Do you have any good ideas? Thank you!

0 Kudos
Message 11 of 21
(804 Views)

Hi laixx,

 


@laixx wrote:

now I have another question that is how to realize on the vi provided by Mcduff that no matter how many times vi is run, the files generated by the vi program run last time will not be overwritten by the files generated by the vi run next time, but continue to accumulate?


By providing unique filenames so you cannot overwrite existing files…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 21
(795 Views)

@GerdW wrote:

Hi laixx,

 


@laixx wrote:

now I have another question that is how to realize on the vi provided by Mcduff that no matter how many times vi is run, the files generated by the vi program run last time will not be overwritten by the files generated by the vi run next time, but continue to accumulate?


By providing unique filenames so you cannot overwrite existing files…


+1 to what @GerdW said. You should also stop your program properly, with a stop button, close window, etc, don't close the abort button unless needed. Using the abort sometimes doesn't always properly close references, etc, and that leads to problems.

0 Kudos
Message 13 of 21
(786 Views)

 


@mcduff  已写:+1 to what @GerdW said. You should also stop your program properly, with a stop button, close window, etc, don't close the abort button unless needed. Using the abort sometimes doesn't always properly close references, etc, and that leads to problems.


I know to provide a unique file name, I have an idea to use a time stamp for file names, but I don't know how to implement this in your share vi. Thank you. I will stop program properlywith a stop button.


0 Kudos
Message 14 of 21
(766 Views)

Don't have LabVIEW on this computer, but use the Time Palette to get a time stamp and use format in string to convert it; look at the help for format string to show you how. Append this to the filename. 

0 Kudos
Message 15 of 21
(762 Views)

I hope my statement did not mislead you, I have mastered how to use the timestamp to join the file name operation. I want to realize that the NI DAQ capture device is always running. When I start clicking the Run button, the vi program automatically creates a file into which data is automatically imported every 10 minutes. After 1 hour, the file is automatically closed and a new file is automatically created. The collected data is imported to the new file every 10 minutes. Until 1 hour later, the new file automatically closes again, creating a new file again, and so on. After I stop running this vi program, assume that 10 files are generated after I stop running the vi program. When I press the run button of the vi program again, the 10 files generated by the vi program last time will not be overwritten, but continue to accumulate after the 10 files generated last time.Thank you very much for your reply. Do you have any suggestions?

0 Kudos
Message 16 of 21
(759 Views)

@laixx wrote:

After I stop running this vi program, assume that 10 files are generated after I stop running the vi program. When I press the run button of the vi program again, the 10 files generated by the vi program last time will not be overwritten, but continue to accumulate after the 10 files generated last time.Thank you very much for your reply. Do you have any suggestions?


Create unique filenames, like you apparently do using timestamps.

Then there is no way to overwrite existing files…

 

What exactly do you mean by "continue to accumulate after the 10 files generated last time"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 21
(740 Views)

@GerdW  已写:What exactly do you mean by "continue to accumulate after the 10 files generated last time"?


Files generated by running vi for the first time will not be overwritten by files generated by running vi for the second time. Suppose the first run of the program generates a total of 10 files, and the second run of the program generates a total of 15 files. So there are 25(10+15) files on disk

0 Kudos
Message 18 of 21
(735 Views)

Hi laixx,

 


@laixx wrote:
Files generated by running vi for the first time will not be overwritten by files generated by running vi for the second time. Suppose the first run of the program generates a total of 10 files, and the second run of the program generates a total of 15 files. So there are 25(10+15) files on disk

So the answer still stays the same: use unique filenames…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 19 of 21
(722 Views)

Thank you for your reply, I know the way to use the unique file name, but I don't know how to combine this method with the hourly data storage program to achieve the content of my reply post mcduff above

0 Kudos
Message 20 of 21
(694 Views)