01-31-2022 07:59 AM
hello everyone i have some problem with my .vi. in this case i want to makes 3 case with control bolean. in this first case if i click the button of 3 member in case "0" can send the string from bolean to write in the visa, then second if i click the button of 5 member in case "1" can send the string from bolean to write in the visa and the last if i click the button of x member in case "2" can send the string from bolean to write in the visa. but for now i have some problem if i click 3 member in case "0" and x member in case "2" why the string to in case is always 0 but before to case the value of string can display. but for button of 5 member in case "1" its normal. what wrong about that ? does this have an effect because of the election Boolean To (0,1) and Compound Arithmetic. do you have for solution ? thank you for advance
Solved! Go to Solution.
01-31-2022 08:06 AM
Hi mamprat,
@mamprat wrote:
i have some problem with my .vi.
do you have for solution ?
We will give (good) suggestions as soon as you attach any code.
We cannot debug/edit/run images with LabVIEW!
@mamprat wrote:
in this first case if i click the button of 3 member in case "0" can send the string from bolean to write in the visa,
if i click the button of 5 member in case "1" can send the string from bolean to write in the visa
if i click the button of x member in case "2" can send the string from bolean to write in the visa.
but for now i have some problem if i click 3 member in case "0" and x member in case "2" why the string to in case is always 0 but before to case the value of string can display. but for button of 5 member in case "1" its normal.
I really don't understand what the problem is… (Some real code might help.)
01-31-2022 08:26 AM
That integer can only be 0 or 1.
If one of the Booleans is true, it becomes a 1. Orring 3 1's will still be 1.
The only way the integer becomes 0 is if none ogf the Booleans is true.
Put the integers in an array, and use Boolean Array To Integer.
Or add the Booleans, so the first is added once, the 2nd 2 times, and the 3rd 4 times. This resulTs in a 2th complement of the values.
01-31-2022 08:35 AM
sorry sir, i forgot to add my vi. this is my vi and my rules
01-31-2022 08:38 AM
i follow the concept from this videos, and the result is not problem. but may i try apper the problem sir
https://www.youtube.com/watch?v=8w_yK1PhIKc
01-31-2022 09:04 AM
@mamprat wrote:
i follow the concept from this videos, and the result is not problem. but may i try apper the problem sir
https://www.youtube.com/watch?v=8w_yK1PhIKc
Note that they use a +, not an OR.
So, they will get:
F F F -> 0
F F T -> 1
F T F -> 1
F T T -> 2
T F F ->1
T F T -> 2
T T F -> 2
T T T -> 3
This, to me, only makes sense if 1, 2 and 3 are clicked on and off in the right order. Or for an example...
You'd usually try to handle each Boolean individually, avoiding 2^n cases, if that's what you want.
01-31-2022 09:35 AM
I've found the problem, I'm seeing the wrong symbol in the boolean. Thank you for the advice