From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert binary signal to numbers

Solved!
Go to solution

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.  

0 Kudos
Message 1 of 4
(2,401 Views)

Hi LeifJoh,

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

Is this what you need?

 

Mike

0 Kudos
Message 2 of 4
(2,399 Views)
Solution
Accepted by LeifJoh

here is a solution

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

poscalcdial.png

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

poscalcdialfront.png

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 ǝɥʇ'


0 Kudos
Message 3 of 4
(2,389 Views)

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

0 Kudos
Message 4 of 4
(2,365 Views)