LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increment file number

The problem statement:  Create a test application that saves the test report with a filename that increments each time the test is run.

 

Example:

 

VR-1524-NXX-XXXXXXXX-June 17, 2011 - 100015

VR-1524-NXX-XXXXXXXX-June 17, 2011 - 100016

VR-1524-NXX-XXXXXXXX-June 17, 2011 - 100017

 

 

The next time the application is opened and the product is tested, the number needs to increment to 100018.

 

Aside from creating a txt file that contains the increment number, what is the best practices method for solving this issue?

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 1 of 5
(3,134 Views)

If I understand your problem correctly, the application whenever runs test a file is created and it is incremented when you run it again, and when you close the application and open it at different time to runt test again the file numbering should be continuous right ?

 

As you already have said text file is better method, but instead of having increment number let it hold file name of the last file.

 

One more thing what you can do is, read how many files are there in the saved folder and use that count to start incrementing the file number, but if someone deletes the file then numbering may not be continuous.

0 Kudos
Message 2 of 5
(3,128 Views)

Here is how I would do the name part. From here you just need to save the name in the text file and make it so it can open it.

Tim
GHSP
0 Kudos
Message 3 of 5
(3,122 Views)

If the only thing in the directory is report files and if they all have the same filename format you can use something like this

 

Next File Name.png

=====================
LabVIEW 2012


0 Kudos
Message 4 of 5
(3,121 Views)

You can save it to a text file, as has been suggested, or use the config file VIs.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 5 of 5
(3,093 Views)