11-13-2009 06:34 AM
I wish to use the "save report to file" function to save to a network, but if the network is not available (error code 6) then I wish to save the file locally on my C: drive. How can I capture this 'error code 6' before it happens and then divert the file to the local drive instead without any pop-up's?
11-13-2009 06:47 AM
Hi Steve,
"pop-up's" let us assume you're not doing error-checking ![]()
How to avoid such errors:
Check error outputs of file functions!
Try to open a file (or: try to get info for the network drive) first. When no error is delivered from the file function then you can write to the network. When an error is indicated you have to change the path for saving.
11-13-2009 07:34 AM
Further to Gerd's comments...
Since I didn't see the code, I can only speculate based on the described behavior.
Are you wiring all the error clusters within the block diagram? For instance, you can use the information from error status / number / message in order to make decisions within a state machine.
You should also use an Error Handler in order to avoid the popups. An alternative would be to use an Error Out Indicator.
To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
11-13-2009 03:20 PM
Hi Steve,
You can use "Check if file or Folder exists.vi" to know the existence of the link..This is available under Advanced Functions.....Based on the result, you can change your path and give to "Save Report to file" VI
11-16-2009
05:58 AM
- last edited on
05-05-2025
02:55 PM
by
Content Cleaner
Hi Steve,
I have been looking into your issues for you. Firstly, I must advise that either of the recommendations on this page are perfectly valid methods for achieving your desired results. The Check if File or Folder Exists VI could be used to determine whether a specific path on the network exists which will output a Boolean which indicates the outcome. This Boolean can then be used to select which path to save the file to using a case structure. A very simple example of this has been attached below. This approach would ensure that the error would never occur therefore eradicating your error pop-up issue.
For this particular instance I would recommend using the above method, though for more complex applications it may be worth adopting a more sophisticated manual error handling strategy rather than automatic error handling that is used by default. For more information on this, see the following document.
Handling Errors
https://www.ni.com/docs/en-US/bundle/labview/page/handling-errors.html
I hope this helps but let me know if you require further assistance.
Christian Hartshorne
Applications Engineer
National Instruments