# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## convert binary signal to numbers

Hi All,

I have been searching and I can't find a simular solution to this issue, so I hope somone can help me. It is probably pretty simple, but as I am new to Labview, it takes some time for me to get used to the programming language.

I have a custom built rotating selector valve with 16 positions. The valve has 5 inductive sensors mounted to a rotating plate with holes drilled for positions.

With 4 sensors there is a binary code created for the 16 positions.

v1 v2  v3  v4

1   1   1   1   pos 1

0   1   1   1   pos 2

1   0   1   1   pos 3

0   0   1   1   pos 4

1   1   0   1   pos 5

0   1   0   1   pos 6

1   0   0   1   pos 7

0   0   0   1   pos 8

and so on..

The fifth sensor is (1) when the valve is rotating and (0) when the valve is in a position.

What I am building with LV is a monitoring system for this valve.

How can I use the 5 digital inputs(simulated with boolean switch) into labview and convert it to a numeric indicator for the position of the valve?

I hope someone can guide me in the right direction with this issue.

Thank you.

Message 1 of 4
(1,291 Views)

## Re: convert binary signal to numbers

Hi LeifJoh,

do you know the function "boolean array to number"?

Is this what you need?

Mike

Message 2 of 4
(1,289 Views)
Solution
Accepted by topic author LeifJoh

## Re: convert binary signal to numbers

here is a solution

put it together into in an array, invert it, convert it to a number, add 1, DONE 😉

the red dot could be avoided, but that is your homework now 🙂

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Message 3 of 4
(1,279 Views)

## Re: convert binary signal to numbers

Thanks Henrik and Mike. Very simple problem but, it takes some time getting used to the block diagram for me 🙂

Message 4 of 4
(1,255 Views)