06-14-2023 03:10 AM
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!
06-14-2023 04:57 AM
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…
06-14-2023 08:13 AM
@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.
06-14-2023 07:57 PM - edited 06-14-2023 08:03 PM
@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.
06-14-2023 08:01 PM
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.
06-14-2023 08:24 PM
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?
06-15-2023 02:43 AM
@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"?
06-15-2023 02:54 AM - edited 06-15-2023 02:56 AM
@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
06-15-2023 04:37 AM
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…
06-15-2023 07:54 PM
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