LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using boolien switches for case selection

Solved!
Go to solution

Hi all,

        i want to use boolien switches for case selection in triggered mode. i mean i have a 4 switches (trigger mode as latch when pressed) when i have pressed and released the button a case corresponding to the switch has to be executed, but the case structure is able to work only with ring selectors, and single swiches(but not with  combinations of different states). i tried with combinational logic gates but it incresed the complexity nothing else.

 

               some body help me to do it. 

0 Kudos
Message 1 of 8
(3,620 Views)
Solution
Accepted by chaitu2
You can use the boolean like this
Message 2 of 8
(3,615 Views)

Hi Chaitu

 

make an array out of your controls and then convert the resulting boolean array to a number, Use that number to control the case structure.

 

Best Regards

 

David

NISW

Message 3 of 8
(3,614 Views)
thanks muks it worked
0 Kudos
Message 4 of 8
(3,610 Views)

Explaining what David mentioned:

To get the radix (b), right click on the number and select 'Radix'

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 5 of 8
(3,608 Views)

This approach lacks in naming the buttons. Elements within arrays share everything except the value (which could be different in each element). Since "Boolean Text" is an attribute of the button, it willl be shared for all other buttons.

Therefore, it is suggested to use a cluster of buttons and convert it to an array in software:

 

boolean selection.PNG

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 8
(3,597 Views)

Norbert B wrote:

This approach lacks in naming the buttons. Elements within arrays share everything except the value (which could be different in each element). Since "Boolean Text" is an attribute of the button, it willl be shared for all other buttons.

Therefore, it is suggested to use a cluster of buttons and convert it to an array in software:

 

boolean selection.PNG

 

hope this helps,

Norbert 


Provided the number of boolean values (bits) are limited to something less than 8, casting as an enum allows descriptive case names.

 

Cast_As_Enum.png

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 8
(3,585 Views)

Ben,

 

nice hint. The only disadvantage i think of is that there is the enum and on the other hand the cluster: What if one component is changed??

 

just pondering,

Norbert

 

[Edit] I just re-thought  (english word??) the sentenced you marked in bold. Of course i talked about the text displayed on the buttons on the frontpanel. 

Datenhaltung boolean Array.PNGDatenhaltung boolean Array ändern 1.PNGDatenhaltung boolean Array.PNG

Message Edited by Norbert B on 12-01-2009 09:56 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 8
(3,571 Views)