Showing results for 
Search instead for 
Did you mean: 

Alternate to Nested case structures ?


But I feel that the Boolean Array to Number is  much easier and elegant. I can have the state machine inside of the Default case and all the other "fault cases " can be directly handled in thier respective frames.

As compared to this, when I follow the bundle / unbundle route, I will have to place the State Machine in the True Case and open up another case structure inside the False Frame to handle the unbundled  fault bits.

This is my understanding.  Please correct me if wrong.

LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 11 of 16
You can also search in the boolean array for a FALSE value and execute a case according to the index when found

Message Edité par JeanPierre le 03-03-2006 06:45 PM

LabVIEW, C'est LabVIEW

Message 12 of 16
Agreed. Another good method.

A vexing problem yesterday. Today it has become a non issue. Oh  the power of knowledge !



LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 13 of 16

For modularity and speed, it sounds like a producer/consumer events structure would work well. Your producer case would check your failure modes (it sounded like some of them were event driven that's why I suggested the events structure, otherwise the regular producer/consumer would be better), and your consumer loop would have the regular cases and the specific failure cases. When your producer loop finds a failure it can enqueue in front the enumerated value for the failure case. Then you check all the fail cases in real time without slowing down your normal execution. It also makes it really easy to add more cases and failure modes without big code change. 


Also, as a general rule, I don't like numbers determining cases because it's hard to understand/debug and easy to mess up. If you changed your priority, for example, you'd have to rewrite all of your logic and it would be very confusing. Using Enums is more clear. 

0 Kudos
Message 14 of 16

You know that this thread has not seen activity for 10 years, right.


If you think you have a revolutionary new insight into the old problem, please be more specific and even attach some code or pictures. Also make sure to quote relevant section of the previous posts so we understand what part you are replying to. Thanks! 😄 

LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 15 of 16

I actually didn't notice how old it was until I had already written my reply. Then I just figured, if I found myself here, other people with the problem might also, I might as well post it. But you are absolutely right, altenbach, this horse it way too old to beat.

0 Kudos
Message 16 of 16