LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure without hand selected selector

Hi all,

 

I have the following problem..

 

I want a case structure with a few options.. No problems here.. But the thing is;

I have my arduino connected and I want the case selector not selected by whatever I select on the front panel..

I want to select a case on whether or not a true output from the button reader from my arduino.

 

For example: If button 1 is true, I want case 'number1' active

If button 3 is true, I want case 'number 2' active

 

I can fix this b using 2 different case structures with a simple true or false case per button, but I would love it if I can make a if-then situation to the selector of one case structure.

 

Hope I am making myself clear..

 

Thank you for trying!

 

0 Kudos
Message 1 of 5
(3,046 Views)

What is the data type of your button reader from arduino? numeric? Boolean?

-If it is numeric you can connect the number directly to case selector. Case selector accepts other types also(numeric,ring,string to name few)

-You can also have array of booleans and check the index of the boolean changed and connect to case structure.

 

-If you have started just learning LabVIEW please check these links:

Start with below links to learn about LabVIEW programming 

NI Learning Center

NI Getting Started

LabVEW Basics

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction

LabVIEW Graphical Programming Course

Using the Context Help Window

LabVIEW Inbuilt Examples

 

Thanks
uday
0 Kudos
Message 2 of 5
(3,024 Views)

@MCdyna wrote:

 

Hope I am making myself clear.. 


No. Please attach some simplified code so we can get a better idea.

 

A case selecter connects to "data" and it is not important if it comes from a user interaction on the front panel, a result of some calculation, or from a hardware IO. If you have two booleans, there are four possible cases (FF, TF, FT, TT) so ideally you need a case structure with four cases. Build an array out of the two booleans and use "boolean array to number" to create posible numbers 0..3 (In binary 00, 01, 10, 11)  to be connected to the case selector. Then create as many unique cases as needed and create a default case for the rest.

0 Kudos
Message 3 of 5
(3,005 Views)

Perhaps Radio Buttons will serve you.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 5
(2,939 Views)

I understand what you mean! I think I can make it work! Thank you so much!

0 Kudos
Message 5 of 5
(2,930 Views)