LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean Switches

I have a series of switches in my vi and I wish to make them Mutually
exclusive,
ie only able to press one button at a time. Does anyone know how to
accomplish this without using a case structure? Thanks.

Magela


[See first answer for additional information]
0 Kudos
Message 1 of 7
(1,885 Views)
[Attachment(s) for question]
0 Kudos
Message 2 of 7
(1,885 Views)
Magela Moore wrote:

> I have a series of switches in my vi and I wish to make them Mutually
> exclusive,
> ie only able to press one button at a time. Does anyone know how to
> accomplish this without using a case structure? Thanks.
>
> Magela

Check the examples
examples\general\controls\booleans\Simulating Radio Buttons.vi

This shows you how to do what you want. It CAN be done without
a case but I dont think you will like the results.

Kevin Kent
0 Kudos
Message 3 of 7
(1,885 Views)
"Kevin B. Kent" wrote:
>This is a multi-part message in MIME format.>--------------2EA5932BDFAE8CC4460FDBED>Content-Type:
text/plain; charset=us-ascii>Content-Transfer-Encoding: 7bit>>Magela Moore
wrote:>>> I have a series of switches in my vi and I wish to make them Mutually>>
exclusive,>> ie only able to press one button at a time. Does anyone know
how to>> accomplish this without using a case structure? Thanks.>>>> Magela>>Check
the examples>examples\general\controls\booleans\Simulating Radio Buttons.vi>>This
shows you how to do what you want. It CAN be done without>a case but I dont
think you will like the results.>> Kevin Kent>>--------------2EA5932BDFAE8CC4460FDBED>Content-Type:
text/x-vcard; charset=us-ascii;> name="Kevi
n.B.Kent.vcf">Content-Transfer-Encoding:
7bit>Content-Description: Card for Kevin B. Kent>Content-Disposition: attachment;>
filename="Kevin.B.Kent.vcf">>begin:vcard >n:Kent;Kevin>tel;fax:972-477-4462>tel;work:972-477-4468
>x-mozilla-html:TRUE>url:http://www.usa.alcatel.com>org:Alcatel USA;OXC Hardware
Development>version:2.1>email;internet:Kevin.Kent@usa.alcatel.com>title:Engineering
Technician>adr;quoted-printable:;;MS OLXDV=0D=0A1000 coit Rd;Plano;Texas;75075-5802;United
States>x-mozilla-cpt:;-472>fn:Kevin Kent>end:vcard>>--------------2EA5932BDFAE8CC4460FDBED-->
0 Kudos
Message 4 of 7
(1,885 Views)
You can easily do this by putting the boolean switches in an array (or build
their outputs into an array) and use a while loop with a shift register.
Compare the current value of the array of switches to the previous value,
subtract the results, take absolute value and this is the new value of the
array, unless there is no change, then keep previous value, use a select
function found in the comparison sub-pallete to make this decision and no
case statements need ever be used.
Attached is example I wrote in LabVIEW 5.1.1

"Glen" wrote in message
news:39f0b202@newsgroups.ni.com...
>
> "Kevin B. Kent" wrote:
> >This is a multi-part message in MIME
format.>--------------2EA5932BDFAE8CC4460FDBED>Content-Type:
> text/plain; charset=us-ascii>Content-Transfer-Encoding: 7bit>>Magela Moore
> wrote:>>> I have a series of switches in my vi and I wish to make them
Mutually>>
> exclusive,>> ie only able to press one button at a time. Does anyone know
> how to>> accomplish this without using a case structure? Thanks.>>>>
Magela>>Check
> the examples>examples\general\controls\booleans\Simulating Radio
Buttons.vi>>This
> shows you how to do what you want. It CAN be done without>a case but I
dont
> think you will like the results.>> Kevin
Kent>>--------------2EA5932BDFAE8CC4460FDBED>Content-Type:
> text/x-vcard; charset=us-ascii;>
name="Kevin.B.Kent.vcf">Content-Transfer-Encoding:
> 7bit>Content-Description: Card for Kevin B. Kent>Content-Disposition:
attachment;>
> filename="Kevin.B.Kent.vcf">>begin:vcard
>n:Kent;Kevin>tel;fax:972-477-4462>tel;work:972-477-4468
> >x-mozilla-html:TRUE>url:http://www.usa.alcatel.com>org:Alcatel USA;OXC
Hardware
>
Development>version:2.1>email;internet:Kevin.Kent@usa.alcatel.com>title:Engi
neering
> Technician>adr;quoted-printable:;;MS OLXDV=0D=0A1000 coit
Rd;Plano;Texas;75075-5802;United
> States>x-mozilla-cpt:;-472>fn:Kevin
Kent>end:vcard>>--------------2EA5932BDFAE8CC4460FDBED-->



[Attachment Exclusive boolean 511.vi, see below]
0 Kudos
Message 6 of 7
(1,885 Views)
This will take a little patience but it works pretty well. I have created
a customized verticl slide control replacing the slide element with a picture
of the TRUE state of a bolean check box control and placing pictures of the
FALSE state at all whole number intervals. Line up the FALSE state picture
elements so they line up exactly with the slide element. With the slide
element the foremost object it will cover appropriate FALSE state picture
making it appear that false state bolean just tuned true. Make all other
elements of the slide control transparent or invisible. I know this sounds
confusing. If you are familiar with customizing controls this may make sense.
0 Kudos
Message 5 of 7
(1,885 Views)
Simialar custom slide controls are part of the LabVIEW distribution. Go to
Examples\General\controls\booleans.

"Glen" wrote:
>>This will take a little patience but it works pretty well. I have created>a
customized verticl slide control replacing the slide element with a picture>of
the TRUE state of a bolean check box control and placing pictures of the>FALSE
state at all whole number intervals. Line up the FALSE state picture>elements
so they line up exactly with the slide element. With the slide>element the
foremost object it will cover appropriate FALSE state picture>making it
appear that false state bolean just tuned true. Make all other>elements of
the slide control transparent or invisible. I know this sounds> confusi
ng.
If you are familiar with customizing controls this may make sense.>>>
0 Kudos
Message 7 of 7
(1,885 Views)