01-09-2015 12:39 PM
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.
Solved! Go to Solution.
01-09-2015 01:09 PM
Hi,
You could use a simple State machine
01-09-2015 01:14 PM
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
01-09-2015 01:17 PM
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).
01-09-2015 01:18 PM
01-09-2015 03:30 PM
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
01-10-2015 10:19 AM
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?
01-10-2015 12:14 PM - edited 01-10-2015 12:29 PM
@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?
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.
01-10-2015 02:54 PM
@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.
01-10-2015 04:01 PM - edited 01-10-2015 04:03 PM
@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.