Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

File Dialog

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Displays a dialog box with which you can specify the path to a file or directory.

You can use this dialog box to select existing files or directories or to select a location and name for a new file or directory.

(Mac OS) This function does not recognize any Mac OS-specific means of specifying the default application for a file. However, you can use the pattern input to specify a file type for files that include an extension to the file name.

Example

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

Dialog Box Options

ParameterDescription
Limit selection to single itemThe user can select one or more files. When you de-select this option, the options for the types of files or folders the user can select appear dimmed. Contains the following options:
  • File—The user can select only a file.
  • Folder—The user can select only a folder.
  • File or folder—The user can select either a file or a folder.
  • Existing—The user can select only an existing file or folder.
  • New—The user only can enter the name of a new file or folder.
  • New or existing—The user can select an existing file or folder or create a new file or folder.
Treat LLBs as foldersThe user can select a file in an LLB. If this checkbox does not contain a checkmark, the user can select an LLB but cannot select a file in an LLB.
Note  To select an LLB using the File Dialog function, you can remove the checkmark from the Treat LLBs as folders checkbox and select the LLB from the file dialog box. You also can place a checkmark in the Treat LLBs as folders checkbox, select the Files or Folders option button, choose an LLB from the file dialog box, and select the second folder icon from the file list in the second file dialog box that appears.

Block Diagram Inputs

ParameterDescription
button labelLabel to display on the OK or Current Directory button in the file dialog box. If you configure the Express VI to allow the user to select directories, use this input to specify a label for the Current Directory button. If the configuration does not allow the user to select directories, use this input to specify a label for the OK button. For example, if you select Files only in the configure dialog box, the user must select an existing file to which to append data, so you might want to wire Append to button label.

If button label is longer than the width of the button, the file dialog box does not display the entire label. For example, in an English version of Windows, the button is approximately 11 characters wide.
default nameName you want to appear as the initial file or directory name in the dialog box. The default is an empty string.
error in (no error)Describes error conditions that occur before this VI or function runs.
pattern (all files)Restricts the files displayed in the dialog box to those whose name matches pattern (all files). pattern (all files) does not restrict the directories displayed. The pattern matching in this function is similar to the matching used in matching wildcards in Windows and Linux file names. If you specify characters other than the question mark character (?) or the asterisk character (*), the function displays only files or directories that contain those characters. You can use the question mark character (?) to match any single character. You can use the asterisk character (*) to match any sequence of one or more characters.

For example, a pattern (all files) of *.vi;test*.llb returns matches for any file with a .vi extension and any file whose file name begins with test and has a .llb extension.

To match multiple patterns, use a semicolon ( ; ) to separate the patterns. White space, such as blanks, tabs, and carriage returns, are taken literally. Avoid using white spaces unless they are part of the extension pattern. For example, if you use *.html;*.doc, the dialog box displays all files that end with .html and .doc. If you use *.html; *.doc, the dialog box displays only files that end with .html.
pattern labelLabel to display in the file dialog box next to the custom pattern. If you do not wire a string to this input, the default label next to any custom pattern is Custom Pattern. If you do not wire a string to pattern, LabVIEW ignores this input.
promptCustom message that appears as the title of the file dialog box. The default dialog box title is Choose or Enter Path of File.
start pathPath of the directory whose contents LabVIEW initially displays in the dialog box. If start path is valid, but does not refer to an existing directory, LabVIEW strips names from the end of the path until the path is a valid directory path or an empty path. If start path is invalid or unwired, the last directory viewed in a file dialog box initially appears in the dialog box.

Block Diagram Outputs

ParameterDescription
cancelledIs TRUE if you cancel the dialog box.
error outContains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces.
existsIs TRUE if selected path specifies an existing file or directory.
selected pathFull path to the file or directory selected using this dialog box. If you cancel the dialog box, this function sets selected path to <Not A Path>. This output is available if you place a checkmark in the Limit selection to single item checkbox in the Configure File Dialog dialog box.
selected pathsContains the full path names to the files or directories selected using this dialog box. This output is available if you do not place a checkmark in the Limit selection to single item in the Configure File Dialog dialog box.

Example

Refer to the Interactive Play Sound File VI in the labview\examples\dll\sound\playsnd.llb for an example of using the File Dialog VI.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit