LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Pie566942.0

Equal and Not Equal to Zero Support for Error Cluster Wire

Status: Declined
Checking the code is not enough to confirm that an error happened -- you have to check code and status.

I'd like the Equal To Zero? and Not Equal To Zero? primitives to support the error cluster wire.  The node would look at the Error Code and compare it to zero, resulting in a Boolean accordingly.

 

Error_Cluster_Zero.png

 

Thanks,

 

Steve K

10 Comments
crossrulz
Knight of NI

So this would result in a TRUE for a warning or an error.  Typically, we are just looking for an error.  Not completely sold, but worth thinking about.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Pie566942.0
Member

Good point.  How about a context menu setting to ignore positive codes:

Error_Cluster_Zero2.png

crossrulz
Knight of NI

That is a misconception.  There are lots of errors with positive codes.  Just unbundling the error status is just going to be the easiest way to check for an error.  The Not Equal To Zero could work for "at least a warning".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Pie566942.0
Member

Another good point.  Here's what I want to replace with the ==0 / !=0 nodes:

 

Error_Cluster_Zero3.png

 

The Select node evaluates the Status Boolean.  I thought evaluating the code would give me more flexibility, but you're right, there are positive error codes.  I usually care only about errors, so the ==0 / !=0 could look at the Status Boolean.

crossrulz
Knight of NI

From your example, why not just use the NOT primitive?  The output would be TRUE if there is not an error and FALSE if there is one.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Pie566942.0
Member

That works.  I got caught up in the code == 0 / != 0 and overlooked the obvious.  Thanks for the tip.  A moderator can remove this tread if they like.

 

 

wiebe@CARYA
Knight of NI
Lets blow it up. Think bigger. Not sure if its a good idea but this just popped into my mind: How about the error wire cn be connected to ANY compre function? Check error==57, error>0, error=0 (not the same error=true, the boolean can be T, with the code 0). Even build array to add the error code to a list of error codes. Why restrict it to compare function? error wired to number to string would give the number as string. What if we wire to a string fuction it use the sting? Wire the error to a concatenate string, and the error string is concatenated.
AristosQueue (NI)
NI Employee (retired)

The whole theme strikes me as a bad idea because checking the code is not enough to confirm that an error happened -- you have to check code and status. There's enough ambiguity in what the comparison means that I don't think it is worth weakening LabVIEW's type safety -- and I say that as one of the major advocates for allowing the error cluster to connect to Boolean terminals.

wiebe@CARYA
Knight of NI

it is a bad idea. It would be a lot of work to implement, and only saves one unbundle each time it's used. The boolean action is used a lot, and it is very convenient to have.

 

Still good enough idea to have some fun thinking it over.

Darren
Proven Zealot
Status changed to: Declined
Checking the code is not enough to confirm that an error happened -- you have to check code and status.