07-24-2009 06:56 AM
Hello
I need to create numbers starting from 1 to n. I need these numbers to add as ending in the name of files that are being saved. For example File_1, File_2........etc.
I tried to create a for loop (n= 100) and wired the "i" outside. Only i need is these i values ( 0,1,2,3,.....100)
How is i possible? See attachment ffor what i have done.
07-24-2009 07:01 AM
Hi Nghtcrwlr,
this works.
Mike
07-24-2009 07:04 AM - edited 07-24-2009 07:05 AM
Hi Nghtcrwlr,
you can't connect an array to FormatIntoString...
It works like this:
I suggest a format of %03d instead of %d.
And btw. "(0,1,2,3,...100)" are 101 values ![]()
Mike beats me - I had to start LabView first...
07-24-2009 07:22 AM - edited 07-24-2009 07:22 AM
07-24-2009 01:34 PM
Hi all
Thanks for your responses. I made it in another way. I created a while loop and inserted my VI inside it. Then wired the "i" as input number to the name ending.(i.e used concatenate function to join the string "Filename" & "i"). So as long as the VI runs , those values are automatically created. When you stop the VI , it also stops.
Anyways thanks for all your ideas. Sometime later, i might need them:P
07-24-2009 01:36 PM
07-24-2009 02:10 PM
Nghtcrwlr wrote:
Again Mike and Gerd, how is it possible to access each element of the array at a time? do i just need to do the autoindexing at the output end?
Once the names are in an array, you can use the 'Index Array' function to index a certain cell.
07-24-2009 02:15 PM
Nghtcrwlr wrote:
Again Mike and Gerd, how is it possible to access each element of the array at a time? do i just need to do the autoindexing at the output end?
It's meaningless to first build up an array with a loop and then go through all the elements using a second loop ![]()
Can you give us a complete picture of the problem instead of some bits & bytes now and then ?
That way we can suggest the best way to go ![]()
07-26-2009 06:46 AM
07-27-2009 02:03 PM
Nghtcrwlr wrote:
Ok Alain... here s the problem. I have a VI that writes some values to Excel and saves. Each time the VI is run it saves an Excel file. I need the Excel file naming like " File_1, File_2...etc.Those numbers 1, 2 should come at the ending in name. That was what i needed. But as i mentioned, i already got the solution in another way.
In that case, the following vi is what you need. You send in the basic file name, like "File_", and it returns the next numbered file name, like "File_003". The next time you call it, it will return "File_004", and so on. The first time you ever call it, send in a True on the Start Over? boolean input. After than send in a False. The vi contains a LV2 Style Functional Global. The shift register is uninitialized. It remembers what is in the shift register from the time it was called before. The first time you call it, you must make Start Over as True so that it can initialize the shift register with 1. Then the file name will be FIle_001. Next time you call it, Start Over is False, and the shift register gets incremented, so the 1 becomes a 2, and the output is File_002.
I think this is the best way to handle your problem. It is both quick and easy.