01-18-2011 03:40 AM
Hi,
Wanted to built a vi behind two buttons (and more) which should work as exclusive or. In other word, when button A pressed the corresponding LED should be ON and when the button B pressed the corresponding LED should be ON and meanwhile the button A and LED A should be off (the same for press button A after B). Attached a sample vi (working not properly ). used case structure but beilieve the event structure should work as well !?
All helps appreciated.
David
01-18-2011 04:29 AM
Hi david,
Try this. There may be better ways to do this, which I hope experts on this forum will tell you.
01-18-2011 04:48 AM
Hi David,
Before you proceed with Event structure, here are some points about your vi
1. Do not use property node where local variable is enough( also unterstand the difference between "value" and "value signaling" property)
2. Do not use local variable where control/ indicator terminal is enough to wire
3. No need of using "First call?" function in your code. you could also inialize the controls/indicators out side the while loop.
to implement XOR operation use "Exclusive Or " function from boolean palatte, if you want to increase the controls then go with
"compound arithmatic" function and change the mode to XOR.
pls see the attached image for more details..
01-18-2011 06:30 AM
Try looking at the Radio Button.
It allows one button at a time to be active. Pressing one button clears the other buttons.
01-29-2011 05:48 PM
Here is a sample of vi.
01-30-2011 04:29 AM
Hi David,
Find attached an example of how to implement what you are after. I have also shown how to bundle the information into a cluster as you asked in your e-mail.
In my example i have bundled the controls into a cluster. If you do not want the appearance of a cluster then you can use a cluster from the Classic palette and use the paintbrush to paint it transparent. You then will not see the cluster container.
If you have any questions just ask.
Rgs,
Lucither
01-30-2011 05:03 AM
Hi David,
Well that was a ball ache trying to convert to 8.2, kept on crashing as had a bug when converting if there is an event structure.
Anyway, managed to do it
Rgs,
Lucither
01-30-2011 05:43 AM
Hi David,
Just a quick one. I forgot to Disable the led's on the previous version. Causes the event structure to be entered if a LED pressed. Use this version instead.
Rgs,
Lucither
01-30-2011 05:57 AM
Just see your new reply now.
A Kudo for that pain!
01-30-2011 06:11 AM
The fixed version with LED is for LV 8.6 (I have 8.5):smileysad: