From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure (2 cases)

Solved!
Go to solution

Hello,

 

Im a new labview user.  Can anyone help me design a case structure where if it recieves a 0, lets say action A occurs and if it receives any other number, action B occurs?

 

In terms of code..

 

If x==0,

 Action A

Else

Action B

0 Kudos
Message 1 of 3
(2,023 Views)
Solution
Accepted by topic author sally99

Hi saranam16,

 

example.png

 

This is a snippet for 2012 SP1 (you can save the .png to your computer and then drag it onto your block diagram to turn it into code).

 

If you wire your X value to the case selector for the case structure, by default you will have one case that is 0 and one case that is 1. If you right click on the border of the 1 case, you can Make this case Default, which means it will execute when all other cases are not true.

 

To help get started with LabVIEW there are also a number of good resources here: http://www.ni.com/gettingstarted/labviewbasics/ and NI offers a number of training courses for new LabVIEW users. If you have SSP, the training is offered for free online.

 

Hope that helps!

 

Jeff Peacock 

 

Product Support Engineer | LabVIEW R&D | National Instruments 

Message 2 of 3
(2,018 Views)

Thanks!!

0 Kudos
Message 3 of 3
(2,013 Views)