01-23-2009 12:04 PM
Is there a way to know which toggle switches were selected on a frt panel with 6 or so Sws. The sw's select a particular test. I saw an example in the discussion grp to find out which SINGLE element in the boolean array was high ( use Build an array then search 1 d array) . What if I have 2 or 3 or 4 etc that were selected. How can I tell boolean sw associated w "turn on pwr suppl1 and Turn on PS 2 " was selected?
Thanks,
Clint
01-23-2009 12:09 PM
The way I would do this usually is through the event structure, but you can use a shift register and check equality between itterations as well.
01-23-2009 12:18 PM
01-26-2009 01:04 PM
Hey Clint,
Paul and Jim have some good suggestions. I agree with Jim though, creating a Boolean array and converting it to a number is a clean way to do what you are attempting to do. I have created a small example that shows how to do this in LabVIEW 8.6. I have also included a picture of the block diagram, in case you have a different version of LabVIEW.
Let us know if this helps.
Ben
Applications Engineering
National Instruments
01-26-2009 01:31 PM
XOR old and new values. Everything True has changed.
Ton
01-26-2009 01:42 PM
Another approach would make the array of booleans a cluster of booleans with an appropriate name for each.
Then set up an event for each boolean. The events will be serviced in the order the buttons are clicked.
Ben
01-27-2009 05:56 AM
Thanks everyone.
I played w Event Structure (ES) and I think I got that to work. I worked off of an example from the Discussion Grps posted back in 2006. When I 1st posted I didn't think you could get an ES know which toggle SW "Changed Value". I thought it only let you know a toggle sw ( Boolean) chg'd. It does, and the chg value is perfect for what I want to do.
Again, Thanks.