LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number to BOOlean Pattern Conversion

To write to port @DIO6534 it requires an address as
a binary pattern (like 00001111) of U32 format.
What is the way obtain this U32 word from Number
(or maybe to convert to U32 word from string)?
0 Kudos
Message 1 of 6
(3,234 Views)
,

Depending on the interface you desire, there are a number of ways to handle this situation.

I would suggest that you start by showing the radix on whatever is your input to the DIO. When you show the radix, you can set it to display binary, which is exactly what you are looking for.

Let us know if this solution doesn't fit your needs. Elaborate on your interface, and what you need to do.

Good luck
0 Kudos
Message 2 of 6
(3,233 Views)
Evgueni wrote:

> To write to port @DIO6534 it requires an address as
> a binary pattern (like 00001111) of U32 format.
> What is the way obtain this U32 word from Number
> (or maybe to convert to U32 word from string)?

############

Hi Evgueni,
I spent 10 min programming...
Does this fit your needs?

Ciao,
Rainer
0 Kudos
Message 3 of 6
(3,233 Views)
There is a way better way of doing this.
 
You can go in between Numeric Representation (i.e. I32 , U32, "12509"),Boolean Bit array (array of booleans), Binary Representation (using the Radix), and String Binary Representations all using built-in functions in LabVIEW.
 
See my attached VI.
Joji
0 Kudos
Message 4 of 6
(3,152 Views)
Something seems wrong here.  It doesn't matter how your number value is displayed (decimal, binary 1s and 0s, hex digits), it all goes in and out of a computer as binary bits.  If you wire a numeric for the address, it should not matter what that numeric looks like on a display.  To the computer, and any other hardware like a DIO, a number is a number.  Seeing it on the screen as a hex number or a decimal number is just for our convenience, it is still a number to the computer and DIO.  You should not have to convert to anything, unless your DIO function is expecting a string input rather than a number.
- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 6
(3,149 Views)
"Something seems wrong here.  It doesn't matter how your number value is displayed (decimal, binary 1s and 0s, hex digits), it all goes in and out of a computer as binary bits.  If you wire a numeric for the address, it should not matter what that numeric looks like on a display.  To the computer, and any other hardware like a DIO, a number is a number.  Seeing it on the screen as a hex number or a decimal number is just for our convenience, it is still a number to the computer and DIO.  You should not have to convert to anything, unless your DIO function is expecting a string input rather than a number."
 
tbob is right.
 
The only time you need to convert should be for the string input for DIO functions.  Anything else ( except maybe a bit array) is just aesthetics and can be controlled with the Radix and Property nodes but the actually number remains the same.
 
 
Joji
0 Kudos
Message 6 of 6
(3,127 Views)