12-01-2009 08:15 AM
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.
Solved! Go to Solution.
12-01-2009 08:20 AM
12-01-2009 08:21 AM
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
12-01-2009 08:24 AM
12-01-2009 08:25 AM
Explaining what David mentioned:
To get the radix (b), right click on the number and select 'Radix'
Ton
12-01-2009 08:38 AM
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:
hope this helps,
Norbert
12-01-2009 09:13 AM
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:
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.
Ben
12-01-2009 09:49 AM - edited 12-01-2009 09:56 AM
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.