LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filename generation & Auto increment filename

Solved!
Go to solution

Hi,

 

I would like my program to create a filename automatically, im using the "Filename Generator" which was available online, and also the "Unique Filename" VI. The way im using this is, I let the user select a path, and feed the path to the filename generator.vi. The output of that VI is the input to the Unique filename.vi .And the output of this VI is the root where the actual output file will be located. Im getting an error:

 

Error 7 occurred at Open/Create/Replace File in Write Spreadsheet String.vi->Write To Spreadsheet File (string).vi->Write Header & Waveform Ref.vi->Main.vi

 

I have attached my main VI, and the two above mentioned VIs. Also attached is the png file of the frames that contains these functions.

Is there a way to get over this???

 

 

 

Thank you,

Eureka 

Download All
0 Kudos
Message 1 of 6
(4,107 Views)

As you can tell from the error description, you need to check the path that is being generated. You have an indicator there. Is the value a valid path.

 

p.s. You should learn to code without all of those local variables and without the sequence structure. None are necessary.

Message 2 of 6
(4,105 Views)

I think i see what the problem is,

This function creates a path, but not a file. So, the input given to the write to spreadsheet file is not actually the location of a file, i would say it is something virtual.

If i use the Unique filename.vi alone and not the filename generator.vi, my program works fine, it does increment the filename, but, the user has to select the file every time.

For instance, i have a txt file "Current". The VI generates a file path for "Current(1)" and writes the data in the new file.

The next time, if the user fails to select "Current(1)" as the input path, and if the input path is just the same as the 1st run, it over writes the data in "Current(1)", as expected!

The basic problem is, i need to avoid over writing data. Because, i read the waveforms from the file and it will me messed up big time.

Is there a function to auto-increment filenames as we write them?

 

 

 

Thank you,

Eureka

0 Kudos
Message 3 of 6
(4,103 Views)

Dennis,

 

I got what you are saying, but, how do i get around this?

Oh, and the sequence and all the local variables, yes, i should spend some more time with labview i guess, its been less than a month for me with labview, im still trying to get the grip. But thanks for the tip, i'll try to catch up.

0 Kudos
Message 4 of 6
(4,101 Views)

I think im getting there,

Im trying to play around with the open/create filename function, which eventually works...trying to auto-increment the filenames without appending/overwriting the data.

 

0 Kudos
Message 5 of 6
(4,093 Views)
Solution
Accepted by topic author Eureka

Its done, I used the open/create function...and set the operation to "5" which prompts the user to decide on replacing the file.

 

0 Kudos
Message 6 of 6
(4,088 Views)