LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case selector from a truth table

Solved!
Go to solution

We have a case structure with a set of cases and then we have boolean flags which describe the situatuation. we need to enter the case structure using a truth table. Forward, Backward and stop are different cases in the case structure.

 

Situation  |     case name

False True => Forward. 

True True => Backward

False False => Stop

 

How may we do it? Please upload a VI if it is possible for you.

0 Kudos
Message 1 of 11
(4,103 Views)

Hi,

You could use a simple State machine





0 Kudos
Message 2 of 11
(4,083 Views)

Boolean to 0-1 and add them to get 0, 1 or 3  (leave case 2 as default and throw an error "Undefined state command") to help you figure out how that True - False condition occured


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 11
(4,080 Views)

I imagine there is a better way to do owhat you want than what you are trying to do.  But you could use Build Array and the Boolean Array To Number.  You could then wire that number to the case selector.  For two booleans, you will have cases of 0 (F-F), 1 (F-T), 2 (T-F), and 3 (T-T).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 11
(4,068 Views)
Solution
Accepted by topic author aan928

Or, Boolean Array to Number and show the radix in the Case structure.

 

2015-01-09 14_18_08-Untitled 3 Block Diagram on TCPT CAN ESS.lvproj_My Computer _.png

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 11
(4,064 Views)

Darin wrote a truth table node a few years back. I never downloaded it, but it looked interesting...

 

http://forums.ni.com/t5/LabVIEW/Truth-Table-Node/td-p/1293680

0 Kudos
Message 6 of 11
(4,027 Views)

Darin's truth node only has two options.  The OP needs at least three output possibilities.

 

They also need to determine what happens in the True False state.  Does that act the same as False True? 

0 Kudos
Message 7 of 11
(3,965 Views)

 


@aan928 wrote:

We have a case structure with a set of cases and then we have boolean flags which describe the situatuation. we need to enter the case structure using a truth table. Forward, Backward and stop are different cases in the case structure.

 

Situation  |     case name

False True => Forward. 

True True => Backward

False False => Stop

 

How may we do it? Please upload a VI if it is possible for you.


 

 

You could do something like this but what about the True-False case?

 

Casee.PNG

 

 

You should be using "Radio Buttons" for this.

Radio buttons allow only one selection (or none) and it's output can be fed right onto a case structure.

 

 Radio2.PNG

========================
=== Engineer Ambiguously ===
========================
Message 8 of 11
(3,937 Views)

@RTSLVU wrote:

 

 

You should be using "Radio Buttons" for this.

Radio buttons allow only one selection (or none) and it's output can be fed right onto a case structure.

 

 


Radio buttons don't quite work that way.    You can have no selections when you first start, but as soon as you hit one button, you can never "unhit" it.  You'll always have one button pressed anytime after you've pressed any button for the first time.  You can only have the "false-false" condition up to the first time you ever hit any button.

0 Kudos
Message 9 of 11
(3,905 Views)

@RavensFan wrote:
Radio buttons don't quite work that way.    You can have no selections when you first start, but as soon as you hit one button, you can never "unhit" it.  You'll always have one button pressed anytime after you've pressed any button for the first time.  You can only have the "false-false" condition up to the first time you ever hit any button.

 All you need to do is "right-click...allow no selection". 😄 Now clicking the currently active selection will uncheck it.

0 Kudos
Message 10 of 11
(3,891 Views)