LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Better alternative to case structure

Solved!
Go to solution

Hi,

 

I am trying to find a cleaner way of doing the attached vi. In the vi I have booleans wired to case structures. If the boolean is false it sends a string to an array and into a dialog box.

error vi.png

0 Kudos
Message 1 of 7
(2,873 Views)

Build the booleans into a 1-D array.  Store the error messages in a 1-D array of strings.

 

Search through the boolean array in a loop.  For each true, concatenate the corresponding error message onto the string.

0 Kudos
Message 2 of 7
(2,863 Views)

Use an event structure.

 

Lynn

0 Kudos
Message 3 of 7
(2,861 Views)

Think about the duplicate code, you have, and how you might eliminate 3 instances of it, and use the one remaining as a subVI to handle all the buttons.  Also think about how those four buttons could really be an array of booleans that could be parsed with a for loop, with each indexed boolean feeding into that subVI.

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 7
(2,859 Views)
Solution
Accepted by CLH239

1!.PNG

You need to learn to love that new conditional tunnelSmiley Wink


"Should be" isn't "Is" -Jay
Message 5 of 7
(2,844 Views)

Thanks Jeff,

 

Your solution was the most helpful, it did exactly what I needed.

 

Chris

0 Kudos
Message 6 of 7
(2,829 Views)

Love that new tunnel!

0 Kudos
Message 7 of 7
(2,820 Views)