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.
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.
01-27-2021 12:16 PM
Hello,
I was wondering if it was possible to use an Error code to run a specific portion of a VI. Simply put, if there is a certain error X will happen.
Solved! Go to Solution.
01-27-2021 12:42 PM
Use a Case Structure. I don't remember which version started this (2018? lack the time to look it up), but you can wire the error cluster to the case selector and put the error code in the case identifier. If you are using an older version, you can use Unbundle By Name to get the error code and use that for the case selector.
01-27-2021 12:44 PM
I just figured it out about 30 seconds before you replied. But this is the correct answer. Thank you very much!
01-27-2021 12:52 PM - edited 01-27-2021 12:52 PM
I just want to add, "Congrats! You've entered the world of error handling." This is a very important step if you want to create LabVIEW applications of any complexity, and absolutely critical if you are going to build an executable.
I employ two kinds of error handling. I handle any "expected"- that is, common errors that would occur with the action, like an "file not found" error if I am trying to open one - immediately. e.g., Popup "File not found. Please navigate to the folder that contains the xyz file." and then show a file dialog box. The second kind of error handling is what I call the "general" error handler. At the end of the loop, I will clean up any errors that have made it all the way to the end.