LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
JICHFI

Error code case selector

CaseError.PNG

Would be nice to have an element selector with error case. No need to wire an unbundle element to connect the error code, then the Case structure becomes like a numerical values case selector.

16 Comments
Knight of NI
I would only use that special check you're alluding to whenever I'm dealing with NI functions/VIs that uses that convention. I don't use that convention in my error handling routines as I choose to not have a number mean two different things.
JÞB
Knight of NI
 

"Should be" isn't "Is" -Jay
JÞB
Knight of NI

I love the Idea!

Create>Case type a Pos int and the boarder turns orange for a "warning" case type a neg int and it turns red for a "error" case, Type  "posInt, negInt" and get a dark orange "Mixed" case  Error,Default remains as unchanged except it is default by default (huh) .....   Yes "error, default" by default whew!Ok.. almost confused myself..

 

type "SourceA","SourceB",Int1, Int2 to filter codes by error or warning source.  with modifiers to match any exact or must contain 1 (Get Prop.vi or Get Dest.vi would both match "Get*" but not "Get")

 

Could use a wizard to define cases!


"Should be" isn't "Is" -Jay
gb119
Member

I would quite like to see something like this generalised for all cluster types.

 

I'd have it so that if you wired a cluster to the selector then the selector would become named (if the cluster elemts have names) or take on the appropriate 'type' symbol - jut like bundle/unbundle nodes. Obviously, not all LabVIEW types can be selectors, so the default would be for the first element that could be a selector type, followed by the first slement that can be cast to a selector type, and if you still can't find a valid selector then you get a broken wire. Right clicking on the selector label would give you a drop down list with all possibly valid elements sel;ectable and all invalid elements greyed out.

 

For simple scalar types you'd get the current behaviour of a ? selector. *Yes there is a confusing corner case when an element name is "?" but...).

 

This would still mean that all cases tested the same element of a cluster for the selector, but I think that is more consistent with how switch()/select constructs work in most languages. So to handle warnings and errors with the same code number you'd need two nested case strictires that tested the status and then the code.

 

For clusters that were elements of clusters you'd just drill down to a suitable scalar element with the 'all elelments' option greyed out as invalid.

--
Gavin Burnell
Condensed Matter Physics Group, University of Leeds, UK
http://www.stoner.leeds.ac.uk/
JackDunaway
Trusted Enthusiast

@gb119: Could you post a mock-up picture of what you are envisioning? It sounds like Cluster to Case Selection.

Darren
Proven Zealot