LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting boolean array to case structure

I would like to connect a boolean array to a case stucture without having to create a seperate control.  I'm sure that this can be done but I'm not sure how.  Thank you for your time.
Ron Deavers, CLD
0 Kudos
Message 1 of 7
(4,139 Views)
If you mean "connect to the case selector terminal" it won't work. you cannot connect arrays.
Maybe you could take the logical-AND or the logical-OR of the boolean array to suit your purpose?
 
If your boolean array is the result of a comparison operation, you might also be able to right-click on the comparison node and select "compare aggregates". In this case you'll get a single boolean out instead of an array.
0 Kudos
Message 2 of 7
(4,134 Views)

I have a subVI that outputs a boolean array of buttons depending on the user input.  I would like to know how to convey this information to the main vi into a case structure.  unless there is an easier way to do this.

My subVI is a dialog asking the user what wire is being cut so I know what length of test to run.  They click on the color, which is a button (4 in all). I made an array and that is how I am passing this to the main vi.  When this information gets to the main vi to the case structure, the respective test is run.  I appreciate any ideas.

Ron Deavers, CLD
0 Kudos
Message 3 of 7
(4,132 Views)
OK, with this information we can probably assume that exactly one of the arry elements is true and you want to know which one. Feed it to "search array" and hook a boolean true diagram constant to the "element" input. You'll get a number between 0 and 3. WIre that number to your case structure and add two more cases so you have one for each condition.
 
Also add a case for -1 in the event that none of the elements is true. Make it the default case, just to be sure. 🙂
 
Let me know how far you get 🙂
0 Kudos
Message 4 of 7
(4,130 Views)
Here's a quick example (LabVIEW 7.0)
Message 5 of 7
(4,125 Views)
Thank you very much.  I was able to apply this to my project.  Can I give unique properties to these buttons, like color and caption text?
Ron Deavers, CLD
0 Kudos
Message 6 of 7
(4,106 Views)

No, all array elements are identical.

As an alternative, you could use a cluster of four individual booleans as a control, then convert it to an array (using cluster to array) for the logic.

0 Kudos
Message 7 of 7
(4,102 Views)