ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

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,620 Views)
Solution
Accepted by 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,615 Views)

Thanks!!

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