LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cluster case data

Hello,
 
I have a cluster of booleans.
 
I want to output a certain value if any "one" of the buttons is pressed.
 
Is there a way to do this other than to make a case structure for each?
Is it possible to create a case structure for a cluster?
 
Enclosed is my vi which kinda explains what i want to do
 
 
thanx
0 Kudos
Message 1 of 8
(2,960 Views)
have you tried using the "radio button" controls?

0 Kudos
Message 2 of 8
(2,957 Views)
I've tried but rather have a boolean button
 
-FredFred
0 Kudos
Message 3 of 8
(2,953 Views)
In that case,  insert the radio button control, then modify the control to replace the current picture with any boolean picture....
0 Kudos
Message 4 of 8
(2,950 Views)

 

The radio button initializes itself to the most significant button.

This cannot occur in my vi for it is event driven.

I'll try to work with it for now,

 

Thanx!

 

-FredfRed

0 Kudos
Message 5 of 8
(2,943 Views)
You could set your buttons to latch action and monitor a data change of the cluster in an event structure.
 
To get the pressed button, convert the cluster to a boolean array and find which one's true. (reorder the cluster elements to get the right numbering).
 
See attached (LabVIEW 7.1).
 
Now just feed your numeric output to a case structure and create a case for each possibility (1-3).

Message Edited by altenbach on 07-19-2005 04:56 PM

0 Kudos
Message 6 of 8
(2,941 Views)

hi there

or try this...

 

best regards

chris

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 7 of 8
(2,929 Views)
chrisger,
 
A few points: The cluster should be inside the event structure (or at least inside the while loop), else the latch action booleans never reset because they are never read by the diagram. Also the stop button should be latch action and must have the terminal inside (no local variables needed now)
I am not sure how you ensure that the local variables on the left are written at the right point in time, because there is no data dependency to the rest of the code. Should they execute before or after the loop? You should probably ensure that things execute in a predictable order (Not that it probably matters much in this particular case, but in other situations this kind of coding can cause very unpredictable behavior and should be avoided.)
 
Property nodes are expensive so it does not make much sense to take a detour via the text labels and a multicase structure just to end up with a plain number at the end. 😉
 
All that's needed is the code alternative I proposed above. I have it now isolated for simplicity (see attached).
 
 

Message 8 of 8
(2,921 Views)