LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Was an open file operation successful?

How can I get an indication that an open file operation was successful.  I need a boolean indication so I can use it with case structures to write and ultimately close the file only if it was opened successfully. 
 
Is there a way to decipher the ref num?
 
Thanks
0 Kudos
Message 1 of 6
(3,419 Views)
Why decipher the refnum? The file open function has an error out cluster. Just use the unbunble by name and get the status.
0 Kudos
Message 2 of 6
(3,417 Views)

Dennis is right

Please look at the picture for reference


Message Edited by Van_L on 02-26-2008 11:56 AM

Message Edited by Van_L on 02-26-2008 11:57 AM
Van L
NI Applications Engineer
0 Kudos
Message 3 of 6
(3,380 Views)

You can even wire the error cluster directly to the select terminal of a case, and see the case structure change colour!

Rod.

0 Kudos
Message 4 of 6
(3,371 Views)

Somewhat unrelated to the topic, but what happens when the write file in this example returns an error? So the file is opened or created without error, but the write produces an error. Does the file get closed?

 

Dave

0 Kudos
Message 5 of 6
(3,067 Views)

According to the Close File Function Help: 

 

If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally even if an error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out.

0 Kudos
Message 6 of 6
(3,048 Views)