キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/8
3,469件の閲覧回数
have you tried using the "radio button" controls?

0 件の賞賛
メッセージ2/8
3,466件の閲覧回数
I've tried but rather have a boolean button
 
-FredFred
0 件の賞賛
メッセージ3/8
3,462件の閲覧回数
In that case,  insert the radio button control, then modify the control to replace the current picture with any boolean picture....
0 件の賞賛
メッセージ4/8
3,459件の閲覧回数

 

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 件の賞賛
メッセージ5/8
3,452件の閲覧回数
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 件の賞賛
メッセージ6/8
3,450件の閲覧回数

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 件の賞賛
メッセージ7/8
3,438件の閲覧回数
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).
 
 

メッセージ8/8
3,430件の閲覧回数