LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scalable MUX VI

I am trying to develop a scalable multiplexer where inputs are boolean inputs (mutually exclusive or only one of the boolean inputs is true) and gives back the number of input that was true.
Any sugestions or ideas are wellcome. For now I will implement a MUX for the size I need rigth now to test my app.

Thx
0 Kudos
Message 1 of 4
(2,839 Views)
Not being able to see how you intend to "wire" the boolean inputs makes providing an answer a little more hypothetical. Are they coming from a Digital I/O card? If so then they can be returned as an array. You can then scan your array for the true one. I'm not sure what you mean by mutually exclusive, unless it is just a rephrasing of the second part of the sentence "only one of the boolean inputs is true". What do you want to happen if more than one _is_ true? You can check the returned array for more than one true and return an error or an array of zero's or whatever.

Here is a check for only one true in the array and what its index is. There are probably more elegant solutions, but I'm finishing lunch, working on another problem, and any other excuse that doesn't come immediately to mind.


P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 4
(2,835 Views)
I agree that the question is a little confusing without knowing more. Attached is an example that just counts the number of true states in a Boolean array. If only one is supposed to be true, then a simple comparison would suffice.
0 Kudos
Message 3 of 4
(2,835 Views)
Sorry for the confusion, maybe I should explain the problem and not a small piece. I want to segment a circle in 'n' slices (like cake slices) and for each one, there is a specific value stored in an array of size 'n'.
Because there is only rectangular grids (2D array) then, what I did, is to check each cell of an empty rectangular array and calculate the angle WRT (with respect to) the center cell.
Then I did 8 comparisons to figure out in which slice the cell belongs to. I still do not know how to make it for 'n' and not only for 8.
Here comes then the MUX.
A hardware MUX place as inputs one bit true and all others falses and the output is a binary number of which bit was the one true. Example 0 0 1 0 0 0 0 0 gives as output 101 (5) (because the true bin is the 5th) Similar to LV_pro response.
Now this comes because an element can ONLY belong to one of the cake slices (mutually exclusive means only one output is true and the others are falses). Because the Booleans comes from comarison then they are not in an array.

My program has an array size 8. Place values in it and run it. The intensity plots shows an array (size 'dimension') with 8 cake slices. I do have a circular mask later in the main program to make it look like a circle.

Do you have any ideas in how to make this scalable for 'n' slices and not like my program for only 8?
Have I improve in explaining my self ;)?

yardo
0 Kudos
Message 4 of 4
(2,820 Views)