From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting Multiple File Types With Path Control

Solved!
Go to solution

My application uses a file path control for the user to specify an output file.  This output file can have two different formats (.csv or .mbf) which is unknown until the user specifies it through the file dialogue.  However, when the user inputs a file name with a .mbf extension (test.mbf, for example), the file path control automatically appends the typed-in name with a .csv extension (test.mbf.csv).  Given that the Pattern field on the control is written like this: *.csv; *.mbf., it seems that the control is simply taking the first file pattern listed and appending it to whatever is typed into the File Name field in the file dialogue box.  Selection Mode is set to "Files" and "New or existing".

 

Anyone know a way to smarten up the file control to recognize the appropriate file type?

 

Using LabVIEW 8.6.1.

 

Thanks!

 

Andrew

 

0 Kudos
Message 1 of 4
(4,004 Views)
Solution
Accepted by topic author StoneTrees

Instead of using the file path control, try using the Fial Dialog Express VI. This will bring up the same dialog box but will allow you much more flexibility. Replace your file path control with a button ("Specify Path" in my example code):

 

file1.png

Message 2 of 4
(3,994 Views)

I made a mistake in my example. The pattern should read "*.csv;*.mbf" exactly (no quotes). This works in the File Path control as well. I think the comma on the end of your pattern string was messing things up.

0 Kudos
Message 3 of 4
(3,989 Views)

This will work as an alternative solution, but it's a shame that the file path control isn't able to make this distinction.  Thanks for the help!  I do want to retain the path name visible to the user, but I can do this with a string control.

0 Kudos
Message 4 of 4
(3,964 Views)