LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic saving labview data

Solved!
Go to solution

 

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)

0 Kudos
Message 1 of 15
(5,654 Views)

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/

Matt J | National Instruments | CLA
Message 2 of 15
(5,621 Views)
Solution
Accepted by Saille

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...

 

Filename Incrementer.png

 

-BTC

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


Message 3 of 15
(5,616 Views)

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

Message 4 of 15
(5,574 Views)

 

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.



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
Message 5 of 15
(5,556 Views)

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

 

 

========================
=== Engineer Ambiguously ===
========================
Message 6 of 15
(5,543 Views)

@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... 🙂

 

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


Message 7 of 15
(5,539 Views)

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"

 

...

0 Kudos
Message 8 of 15
(5,509 Views)

and then unite all generated in an archive

0 Kudos
Message 9 of 15
(5,492 Views)

Hi Saille,

 

that repeating pattern just screams "loop" and  "State machine"…

 

- How to count file numbers has been shown above.

- To create an archive you could use SystemExec with a ZIP tool of your choice…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 15
(5,471 Views)