LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How automatize Filename ?

Hello Labviewers.

I would like to automatize my filenames from aquired Voltage Date
against Time ASCII Tabels.
How can i aquire Date and time into a variable and create a file like:
27_03_2003-9_23_10.txt.
It would be perfect if i also could automatize the path in which this
file is stored.
So it would be gould to have a folder
C:/Bioluminescencedata/27_03_2003/27_03_2003-9_23_10.txt
while the folder with the Date should be created or opened if existing
and
the ASCII-File should be created new every time the VI is running.

Thank you for your help

best regards
Sven Zörner
zoers000@students.uni-mainz.de
0 Kudos
Message 1 of 6
(3,723 Views)
Just use the format date and time function to generate the file and directory names...build the paths, create any missing directories and then write the file.

I have attached an example, just open the OpenMe.vi in the llb file. In the example seconds is also included in the file names due to the fact that the example creates new files every third second...

Mads
0 Kudos
Message 2 of 6
(3,723 Views)
You can use the Get Date/Time String function, format the result any way you want and use the String to Path function to create a folder name and complete file name. There have been some complete examples showing how to do this posted to the forum in the past. From the NI Developer Zone Search page, do a search with "file name" as the search parameter, limit it to LabVIEW General and check the results.
0 Kudos
Message 3 of 6
(3,723 Views)
Thank you all.
I now managed to name the file automatically and place it into a
preformated Folder.
One question is left and still open to me:
Is it possible to create new Windows folder or subfolder within a
defined path using a vi. Or do i need to programm this from outside
labview (eg visual basic etc.)?
0 Kudos
Message 4 of 6
(3,723 Views)
Check out the OpenG Toolkit from OpenG.org.
0 Kudos
Message 5 of 6
(3,723 Views)
Sven Zörner wrote:

> Is it possible to create new Windows folder or subfolder within a
> defined path using a vi. Or do i need to programm this from outside
> labview (eg visual basic etc.)?
>

There is new directory function under the file io->advanced path.

--
Francesco Pezzuti ICQ: 14253763
0 Kudos
Message 6 of 6
(3,723 Views)