LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

about save file...

Hi all i'm Jaxx...

i'm doing a program, and this program need to save some data in a file. what i wish to ask is can use program to control the file name of the save file or not? confusing? never mind.... continue your reading...

example:
In the first time, i saved a file call "1.txt", but in the second time i save those data, can the file name automatic jump to "2.txt" and so on?
0 Kudos
Message 1 of 12
(3,133 Views)
Hi Jaxx

That's no Problem.

You have different possibilities.
1. If you want to save signals with different filenames even if you restart your app, you can check the existing filenames (see attachement). There you can pass the path, where the files are located (e.g. c:\measurements), and a default filename (e.g. myData). It then generates a filename (e.g. c:\measuremensts\myData0.sig) and checks if the file exists. As long as the file exists, the number is incremented. If the file doesn't exist, the loop is stopped and the path is given back to the caller of this vi.

2. You can do it in a similar way in your app, if the numbering is just needed while the app runs. Then you just can create the new filename and pass this to the save-function.

Hope this helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 12
(3,129 Views)
i see.... thanks for your attachment thomas! 🙂
0 Kudos
Message 3 of 12
(3,120 Views)
HI... Thomas...

i got a vi here, that is i modify from yours. but when i run it, i got nothing in my folder... hope u or anyone else can help e about this...

with regard
Jaxx
labview 7.1 user
0 Kudos
Message 4 of 12
(3,091 Views)
HI... Thomas...

i got a vi here, that is i modify from yours. but when i run it, i got nothing in my folder... hope u or anyone else can help e about this...

with regard
Jaxx
labview 7.1 user
0 Kudos
Message 5 of 12
(3,089 Views)
Hi Jaxx

Please convert it to LV7.0, so that I can have a look at it too.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 12
(3,087 Views)
Hi... Thomas... i'm not very sure that i really do the convertion, but no matter how please try it...
if still got problem... please let me know....
0 Kudos
Message 7 of 12
(3,082 Views)
Hi Jaxx

The first thing I noticed, is the file-info function. If you want to open a file and it does not exist the function returns an error (code 7).

If you want to write a new file and call this function, it can't work, because you access the not existing file. Due to the returned error, the following file acces vi's are not executed. So either remove the file-info function or don't wire the error cluster to the open/create/replace file function.

The second thing is this open/create/replace function. There you have to wire a function constant (open, open or create, create or replace, ...).
If you don't wire a value, the default is open. This will also result in a not writen file, because you then try to open a not existing file. Either use "open or create" or "create or replace" to write the file.

Hope it helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 12
(3,076 Views)
Hi... Thomas...

i think i get it! thanks for your help! 🙂

with regard
Jaxx
0 Kudos
Message 9 of 12
(3,059 Views)
Hi.. Thomas and everyone...

can you or everyone else show me an example for save signals with different filenames even if I restart my application?

with regard
Jaxx
0 Kudos
Message 10 of 12
(3,027 Views)