LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Case - What other cases accept?

Solved!
Go to solution

The Case Error Structure allows we to add cases, What are the allowed cases? What is the syntax?

 

 

0 Kudos
Message 1 of 6
(2,827 Views)

Hello,

From your question what i understood is if you connect Error cluster to the case selector you will get 2 cases i.e error and no error.

I think you cannot add other cases if you wire error cluster to case selector.

Expand.Evolve.Influence
0 Kudos
Message 2 of 6
(2,817 Views)

Hi Carlos,

 

What are the allowed cases? What is the syntax?

Did you read the LabVIEW help for the case structure?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(2,804 Views)

If you wire an error wire directly to a case structure, the only available cases are "Error" and "No Error".  The case structure is examining the status element in the error cluster, which is a Boolean value which you can unbundle. The "Error" case corresponds to a TRUE status element, and "No Error" to a FALSE status element. If you instead unbundle the error code from the error wire and wire only the code into the case structure, then all valid integers for that datatype are available (-2,147,483,648 to 2,147,483,647) as cases for you to implement custom error handling functionality.  Not all of these codes will be used by LabVIEW, of course. You can define custom error codes in the range of –8999 through –8000, 5000 through 9999, or 500,000 through 599,999.

0 Kudos
Message 4 of 6
(2,781 Views)
Solution
Accepted by dgd.gomez

I think the question is related to the fact that when you right click on the case structure you have an "Add Case" option.  It exists on Error/No Error case structures and also True/False case structures.  Note that both of those are strictly binary case structures.  They only have 2 choices, either/or.  You can add a 3rd case, but as soon as you do, you'll generate an error either because the new case is undefined, or if you edit it to be True or False, or Error or No Error, you'll still have a broken run arrow because now that case structure as duplicate cases.

Message 5 of 6
(2,766 Views)

Really, this was the question. For some reason the image isn't loaded and confusion may have been generated.

 

Case Error.png

 

The question was motivated by some pages that I found on the internet

Warning case in Error/No error case structure

Error-code-case-selector

Allow-Error-Case-Structure-to-Handle-Specific-Error-Numbers

Try-catch-structure

Warning-case-in-Error-No-error-case-structure

...and when I saw the option of a new case, it made me doubt.

 

 

 

0 Kudos
Message 6 of 6
(2,750 Views)