LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a problem: I have a program that writes data to a file, and then another program that reads data from the same file, however when i run the second program, the file dialog box pops up occasionaly.

I suspect that i'm trying to access the file while it is beibg written to, and that is why the dialog box appears, because the path is set already, i.e. it is set as a constant. How do i try to avoid this, what kind of error-code or so can i use?
0 Kudos
Message 1 of 4
(2,806 Views)
This has happened to me before. By using the File Dialog VI, you can wire in a path, and a boolean will tell you if this file exists. If it does, go ahead and open it; if not, wait until it does exist. Then you won't get that file dialog anymore.

Mark
0 Kudos
Message 2 of 4
(2,806 Views)
Hi!
It seems quite logical, though i tried using this, and using a case statement to read from the file when the boolean is true only,however, i now have the save as dialog box popping up?????
0 Kudos
Message 3 of 4
(2,806 Views)
You're right. A better way is to use the File/Directory Info VI and take a look at the error output. If you use the unbundle by name vi to break out the boolean, that will do it. And it won't show a dialog box if the file doesn't exist; I tried it.

Sorry.

Mark
0 Kudos
Message 4 of 4
(2,806 Views)