I am running a labview program which includes for loop that runs 'n' number of times. I need to save the data collected in each loop in a different folder. This needs to be done automatically as soon as i run the programme.
Most Labview VIs (functions) that allow you to save data have a 'file path' input variable (eg. for saving data to a spreadsheet see https://zone.ni.com/reference/en-XX/help/371361J-01/glang/write_to_spreadsheet_file/ ). This is the name and location of the folder where Labview will save the data to (when it is left blank the user selects where to save the data). If the file that you are saving the data to doesn't exist, Labview will typically create the file first, and so would probably do the same thing for folders and file paths that don't exist. So if you create a string constant which is the location of where you want to save the file and make this constant an input to any save data VIs, Labview will automatically save the data in this location without prompting the user.
Then all you need to do is automatically create a new folder path for every loop iteration. If you wanted to call each folder after a different number(such as "folder1", "folder 2", "folder 3") then you need to first define the beginning of the folder name (in this example "folder") as a string constant. Then you convert the iteration number (1,2,3 etc) from an int to a string and combine your number string and your string constant using the Concatenate string function (http://zone.ni.com/reference/en-XX/help/371361P-01/glang/concatenate_strings/). You can then used this concatenated string as the file path input for your VI to save the data and it should save the data to a different file for every loop iteration.
Thank you Mark Gardner . I had already tried these. What I am looking for is how to dynamically create and open folder for every iteration in order to save the data in that folder. Saving part is already taken care.
Currently I have created folders readily before and then using loop number, I can save the data for each iteration. But is there any other way to dynamically create folder but not file?
There appears to be a create folder VI as well that will create a folder without saving a file: http://zone.ni.com/reference/en-XX/help/371361P-01/glang/new_directory/
The input is a string that is the location of where you want to new folder to be located.