02-04-2015 12:31 PM - edited 02-04-2015 12:40 PM
Hi everyone
how do I save only the first time you start the program, and the second on automatically saved?
in other words, how to automatically save a file?
I got up here (*image)
Solved! Go to Solution.
02-04-2015 01:22 PM
Saille,
I am not sure exactly what you are trying to do and it may help to rephrase your question, but if you are looking to do something only the first time when you run your application you can use the First Call? function in LabVIEW.
http://zone.ni.com/reference/en-XX/help/371361L-01/glang/first_call/
02-04-2015 01:35 PM
If you're simply wanting to increment number in a filename each time the loop runs, please look at attached VI snippet. You can make it as a subVI and call it from inside your loop. First time you call it, give it file location/partial name, and next times leave it blank. See if the block diagram makes sense. If that's not what you want, please clarify what you're trying to do...
-BTC
02-05-2015 07:27 AM
Hey Saille
I think i didn't fully understood what are ou trying to do... Do mind explain it with a little more details?
Thanks
02-05-2015 09:11 AM
Hi,
you can do like this, to autocreate path and use this to connect on this program on some Report Generation toolkit and even on File I/O.
02-05-2015 11:09 AM - edited 02-05-2015 11:19 AM
I take it you want to open a data file on your first run and then use the same file for every run after that? I can sort of understand but over time you will end up with a huge file containing every single run. But if that's what you want...
Each time you start the program you will need to check to see if a data file exists.
If the file does exist then open it and write to it.
If the file does not exist then open a new file and write to it
AND if you are not using the default path save the data file path in another file so you can check for the data file on each run
02-05-2015 11:15 AM
@RTSLVU wrote:
I take it you want to open a data file on your first run and then use the same file for every run after that? I can sort of understand but over time you will end up with a huge file containing every single run. But if that's what you want...
Each time you start the program you will need to check to see if a data file exists.
If the file does exist then open it and write to it.
If the file does not exist then open a new file and write to it
AND save the data file path in another file so you can check for the data file on each run
Looks like he's wanting to create a new file each time with test or data # incremented (if you look at left hand side of his diagram in his posted image, he's creating a new name each time while incrementing #). Although I think we are all doing guess work here... 🙂
02-06-2015 04:42 AM
hello everyone
I'm sorry, I do not explained properly. My program will run for days. Each 1000 sec it generates a new file, in sequence.
so I need:
example:
1) called the program:
2) saved manually, I put the name "file 1.txt"
3) run 1000 sec
4) saved automatically "file 2.txt file"
5) run 1000 sec
6) saved automatically "file 3.txt file"
...
02-06-2015 06:46 AM
and then unite all generated in an archive
02-06-2015 07:10 AM - edited 02-06-2015 07:11 AM