LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 buttons

Solved!
Go to solution

Hi experts,

 

i have a small problem with a part of my program. So i have 2 buttons. If button 1 is switched to logical "1" then button 2 should be switched to logical "0" and button 1 stays "1". If button 2 is switched to logical "1" then button 1 should be switched to logical "0" and button 2 stays "1". 

I tried to write a program for it but it doesn't work perfectly. I added it as an attachment.

 

Thank u for your help,

 

0 Kudos
Message 1 of 10
(3,199 Views)
Use a case structure and inside case corresponding to button 1 use a invoke node for button 2 and re-initialize to default. Do the same for the case corresponding to button 2.
0 Kudos
Message 2 of 10
(3,197 Views)
0 Kudos
Message 3 of 10
(3,193 Views)
I get it differently now. Try this
0 Kudos
Message 4 of 10
(3,190 Views)
Use a radio button and you won't have to write anything.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 5 of 10
(3,165 Views)

Use a radio button and you won't have to write anything.
Yes........:smileyhappy:
0 Kudos
Message 6 of 10
(3,160 Views)
Solution
Accepted by topic author rrrrtomi

Here is a way using booleans, and using radio buttons.  They behave slightly differently.  If you click on the boolean that is true, it switches values (which is probably undesirable) whereas hte radio button doesn't do anything.  This can be coded for in any number of ways.

untitled.PNG

Message Edited by elset191 on 11-04-2009 09:01 AM
--
Tim Elsey
Certified LabVIEW Architect
Message 7 of 10
(3,130 Views)

Well, here is the simplest code around I came up with.  Another one involved using Disabled property nodes.  The way i'm posting is better because you get feedback that you clicked the button.

untitled.PNG

Message Edited by elset191 on 11-04-2009 09:15 AM
--
Tim Elsey
Certified LabVIEW Architect
Message 8 of 10
(3,122 Views)

Hello Tim,

 

that is exactly what i need. Thank u very very much!

 

have a nice evening,

 

tom 

0 Kudos
Message 9 of 10
(3,105 Views)
Although I coded up what you had asked for, I still suggest using Radio buttons instead.  There is no code needed for these.
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 10 of 10
(3,101 Views)