LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Could I use 2 boolean controls with case structure?

Greeting fellow labVIEW users

 

Please refer to the attachement. I want 2 separate On and Off buttons to control the same case structure if possible. Essentially I want the VI to do the following

 

  1. I want the "Off" button to bypass the "On" button and send the string "0200 0002 03" and turn the loop and the program off. At the moment the "Off" string does not close unless the "On" button is switched off.
  2. I also want the exit button to close the LabVIEW window if possible.

Thanks for all the help

 

mhaque

0 Kudos
Message 1 of 10
(4,768 Views)

If I understand you correctly you can use something like this. Make a case for 0,1,2,3.

 

Capture.PNG

=====================
LabVIEW 2012


0 Kudos
Message 2 of 10
(4,756 Views)

Nope does no work since it does not bypass the On button and the On button has to stay on before the program is run.

 

Thanks for your help regardless.

 

Mhaque

0 Kudos
Message 3 of 10
(4,747 Views)

 



@mhaque wrote:

Nope does no work since it does not bypass the On button and the On button has to stay on before the program is run.


 

See, now you are changing specifications. Please provide a complete truth table.

 

There are 3 buttons, two have latch action, only one button is switch action.

 

What are the states at program start?

What should happen for all the following conditions (1: "On", 2: "Off", 3: "Cancel"):

 

 

  • all buttons off
  • button 1 off, button 2 latched on
  • button 1 off, button 3 latched on
  • button 1 on, all others off
  • button 1 on, button 2 latched on
  • button 1 on, button 3 latched on

 

0 Kudos
Message 4 of 10
(4,741 Views)

I am very new to LabVIEW.

Actually, I am currently taking an introductory class.

I am wanting to do a switch circuit somewhat like the one being discussed here.

I want to have 4 buttons, but only one can be on at a time.

 

Button 1 ON, all others OFF

Button 2 ON, all others OFF

Button 3 ON, all others OFF

Button 4 ON, all others OFF

 

For example if button 3 is ON and you push button 2.

Button 3 is automatically turned OFF as button 2 is turned ON.

How would I go about doing such. There must be several ways to acomplish this.

0 Kudos
Message 5 of 10
(4,689 Views)
That is an unrelated question and you should have started a new thread. Anyway use a radiobutton control.
0 Kudos
Message 6 of 10
(4,676 Views)

Hello mhaque,

Can you elaborate more on what you would like to have done? Are the states as altenbach wrote?

Ricky V.

National Instruments
Applications Engineer
0 Kudos
Message 7 of 10
(4,647 Views)

 I Searched the internet and found the answer.

It was bizarrely easy.

I just wanted a radio button with 4 buttons.

The palette comes with just 2 buttons.

I just had to open up the buttons palette and drag more over to the radio button and then I had a 4 button radio button.

Like I said, I am just getting started so the simplest of tasks can be difficult.

Especially when the NI help menu doesn't explain how to do what I just described.:smileyvery-happy.:smileyvery-happy.

0 Kudos
Message 8 of 10
(4,630 Views)

To smg:

 

That's probably because you fail to take instruction properly. 😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 9 of 10
(4,626 Views)

OK the problem for 1 is that the Off is inside a False case based on the On button - so it won't be read unless the On button is not active.

 

The best bet I can give you is to look at event structures if you can. That way you can react to each situation.

 

Otherwise, check the Off button before the On button (so if Off it True send the value for off out otherwise if On is True do whatever it currently does) but you will need a default command to write. (Restructuring the architecture to have the VISA write/read in a subVI and calling it from within the cases would be a better option, but I'm not going into the details for that)

 

As for 2, put a case outside using the application VIs, and put an OR inside the loop before the conditional terminal.

 

Coming back to the structure - readability would be a lot easier (and it would probably be a more accurate behaviour) if you did the string manipulation and looked at the conditional terminal at the other end of the loop (so you read the string back, and manipulate it then). The shift registers to allow this functionality is really not needed.

0 Kudos
Message 10 of 10
(4,583 Views)