LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

generating "arraytofile" files in different locations

Hello everyone,

 

I am confronting a real problem here. I am using ArrayToFile to generate certain files. What I want to do is to every time I run the system to get these files in different locations, say in different folders. Another option I have is to get different version of this files, for example, filename: light.dat, light_2.dat, light_3.dat... etc. Any help will be appreciated.

 

Best,

 

LM

0 Kudos
Message 1 of 5
(3,544 Views)

I'm a little confused of what you are trying to do.

 

The function to get the date of a file is GetFileDate.  If you are wanting to get a version of the file thats embedded in the name, then you just have to do basic string/character handling which can be done with CVI tools or ANSI C pretty easily.

 

As for your array to file, I don't understand what you meant by multiple locations.  Trying to copy to multiple places? 

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

Well, for example, the array to file function generates certain files. These files are saved in the current project folder. What I want to do is to, programmatically, save these files in different folders every time I run the program. For example, in the first run folder number 1 is created and in it the files regarding to that first run. In the second run, folder number 2 is created and inside it the files regarding the second run... and so on.

Please, let me know if it is clear now.

 

Best,

 

LM

0 Kudos
Message 3 of 5
(3,540 Views)

Oh, instead of using the file name in the first argument (File Name), use the absolute path.  This argument takes relative or absolute paths.

 

if you give it output.dat, then in the current working directory, it saves it.  If you pass it "C:\output.dat" it saves it there.

 

With string manipulation, you combine paths and filenames.  

 

FYI:

GetDir() and SetDir() are functions that get and set the current working directory. (In Utility Library > Directory utilities)  But I don't recommend changing teh working directory without setting it back to it when done.

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

Thanks for the reply. It helped on what I needed.

 

Thanks,

 

LM

0 Kudos
Message 5 of 5
(3,502 Views)