LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable the dialog box for opening a file?

Hi,
In my VI I am opening a file to check some of its data but I don't want the user to have to select what file to open every time. Is there a way I can just hardcode it so that when I need to run my check it opens the file for reading in the background and the user does not need to be part of it?
0 Kudos
Message 1 of 6
(4,062 Views)
When opening files without the aid of a dialog box, you must wire a path up to the "file path" input of "Open/Create/Replace File.vi" or one of the other VIs used for opening files. The reason for that is you are most likely using one of the higher-level VIs that have built-in functionality to prevent blank paths from being processed. In most cases, a valid path at that input will be enough to forgo the file dialog box.

If you open up the VI you're using to open your file (the one that always seems to open the file dialog on you) you'll notice it has subVIs and functions behind it. You can get down to the low-level "guts" of that VI by looking in the "Advanced" subpalette of the "File I/O" palette. Notice the "Open File" function? He will not open that dialog on y
ou. As always if you're confused about the functionality of one of the VIs built into LabVIEW, simply right-click on it and select "Help".

Have fun,

Dan
www.primetest.com
0 Kudos
Message 2 of 6
(4,062 Views)
I wired the path and even the file name, so what happens is that a dialog box comes up with the directory already set and the filename highlighted, so all the user has to do is click Open, but I don't want the box to appear period! Any way of doing so, I'm using the Open Config File vi
0 Kudos
Message 3 of 6
(4,065 Views)
Strange indeed! Are you using LabVIEW 6.0.2 or something older? If you'd like, email your VI to me at dan.press@primetest.com. Now I'm curious! The config file VIs don't usually open dialogs.

Dan
www.primetest.com
0 Kudos
Message 4 of 6
(4,062 Views)
Maybe LabView can not find that file (and it opens a dialog) ... could be the file name somehow special? ... try with a simple name.
0 Kudos
Message 5 of 6
(4,062 Views)
When I dug into the O/C/R VI, I saw that my default filename was not being used. It's used in the dialog box and I had this option set to F on the O/C/R VI). Because my path did not include a filename, the dialog box was appearing. How else would the program know where to write the file since it thought I had not provided a filename.

After building my path, to include my new filename, the VI worked as I expected.
0 Kudos
Message 6 of 6
(4,037 Views)