LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save

Solved!
Go to solution

@camerond wrote:

Is there "Build Path"? That creates a folder in LV2012.

 

Cameron


There is a Create Folder in 7.1.  I recommend looking at the OpenG code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 21
(1,075 Views)

Hello. Im pretty new in labview so i need help. I have problem with saving excel file. Everytime when i start program and save, its overwrite and i wanna save as file with new name (for example test1, test2...).

 

Thanks for help.

Download All
0 Kudos
Message 12 of 21
(1,053 Views)

This really has nothing to do with the original thread.  You should have started a new thread.

 

What you need to do is make a subVI that checks to see if the file already exists.  Look in the File I/IO->Advanced File Functions palette.  There is a Check If File Or Folder Exists.vi in there.  If the file doesn't exist, then just pass out the path.  If it does already exist, then use a While loop to build up a file name that includes a number at the end and perform the check until you find one that does not exist.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 21
(1,034 Views)

I know but when i want to start new post they dont allow me, i dont have privilege to do that. And i must post reply on some post.

I tried something like that with Check If File Or Folder Exists.vi, but it just dont work like it should. I will try again.

 

Thanks for help.

0 Kudos
Message 14 of 21
(1,025 Views)
The function works as designed. What exactly did you do and what does the function return that you are not expecting?
0 Kudos
Message 15 of 21
(1,021 Views)

Probably i did something wrong. I building just now. I hope it will work.

0 Kudos
Message 16 of 21
(1,016 Views)

I need help, again. How to create a file with next free name? But i dont need to user manualy save file, i need after he pres stop to save it in background.

 

 

0 Kudos
Message 17 of 21
(996 Views)

Ok, let's think through this problem.  What do you need to do?  First check to see if the base file exists.  You already know the function for that.  Since you are performing a decision now, you need a case structure with the select terminal wired to the File Exists? output.  In the False case, you just wire the file name straight through.

 

Now the False case can be interesting.  You need to get the various parts of the file path.  First, you need the folder.  Use Strip Path to get that.  Now you need the file name and the extension.  Dig back into the Advanced File Functions palette.  In there you will find a Get File Extension.vi.  That will give you both of these.  Now put down a While loop.  Inside the loop you will build up your new file name.  I recommend using the Format String function.  READ THE HELP.  It is a very powerful and useful function.  Use it to combine your file name, the iteration count of the While loop, and the exention.  Then use Build Path to make the full path.  Now check to see if that file exists.  It is does, keep looping.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 18 of 21
(989 Views)

Yeap i using Ctrl+H all the time. I done all of this thanks to that. But i start using this program 15 days ago and i yet learning.

 

But i cant solve my problem. Look and if u can build that part of code, i will be very thankful to you.

0 Kudos
Message 19 of 21
(970 Views)

Duka wrote:But i cant solve my problem. Look and if u can build that part of code, i will be very thankful to you.

We are not here to do your work for you.  We will help you through it though.

 

First of all, your saving of the file should not be inside of that While loop.

 

You need to reduce your problem.  So make a subVI that only takes in a file name and error cluster.  The only outputs should be a new file name and an error cluster.  Now work that subVI just like what I already told you.  You can then use this subVI in your main program.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 20 of 21
(958 Views)