From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I catch errors from "Write to Spreadsheet File" VI

I have a VI running that frequently uses the "Write to Spreadsheet File" VI to record the data it is reading. My problem is that occasionally, if running unchecked, the file it is saving to becomes so large it fills the hard-disk drive of the computer it's running on. When this happens my VI throws up an error box which halts operation until the error box is acknowledged somehow by a user. I need to be able to "catch" this error before it happens so that I can tell LabVIEW to power down power to the test system. So basically, how do I go about "catching" the error from the "Write to Spreadsheet File" VI so that it doesn't completely hang my program when unattended? Many thanks!
Neil
0 Kudos
Message 1 of 6
(3,294 Views)
The standard "Write to Spreadsheet File.vi" is lacking in a couple of ways: (1) it doesn't give you an option for the type of error dialog and (2) it doesn't have an error out terminal. It's easily modified. See attached. This vi lets you decide whether to display a warning and check the error output terminal for the error condition.

Tim
Message 2 of 6
(3,294 Views)
Save a copy of the function with a different name and not in the NI folder. Modify the copy and remove General Error Handler.vi that's called and wire the error out of Close File.vi to a front panel indicator. Lastly, wire the error out to the VI's connector pane
Message 3 of 6
(3,294 Views)
Thanks for the answer, may I ask why you say to not save the new version in the NI folder? Is this because future upgrades will wipe over it or something else?
Thanks!
0 Kudos
Message 4 of 6
(3,294 Views)
Cool, thanks a lot for that VI - really pointed me in the right direction. All sorted now 🙂
0 Kudos
Message 5 of 6
(3,294 Views)
That's exactly it.
0 Kudos
Message 6 of 6
(3,294 Views)