LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number to a binary base number

How can I convert a numeric data to a binary base number?
 
Ex.: A into 0001010
 
Thank you in advance
0 Kudos
Message 1 of 6
(3,204 Views)
Right click on the control/indicator and select Format & Precission.  Choose binary in the list of formats.  The number must be one of the I or U types to display in binary.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 6
(3,191 Views)
You question is too ambiguous to give a clear answer.
 
Is "A" a hexadecimally formatted string or a numeric set to hexadecimal display?
Is "0001010" a binary formatted string (consisting of the characters zero and one) or a numeric set to binary display?
0 Kudos
Message 3 of 6
(3,192 Views)
I forgot to write about these important details.
 
A is represented as Hexadecimal number and 0001010 is a numeric set to binary display. But later, I will need to convert the numeric binary display to a string.
 
Thank you in advance.
 
 
0 Kudos
Message 4 of 6
(3,183 Views)
OK, only conversion to a string is needed to solve the problem. (Everything else is just a cosmetic feature of the indicator where you set the formatting. This does not change the underlying data.)
 
Just use "format into string" with a format code of "%07b" (=show seven binary digits and pad with zeroes to the left).
Message 5 of 6
(3,176 Views)
Use the Format Into String function.  Wire in the number.  The format string should be "%8b" for 8 bits of binary.  Also, right click on the function and select Edit Format String.  Here you can specify to pad with zeros.  Then the output will look like "00001010" for hex A.
- tbob

Inventor of the WORM Global
Message 6 of 6
(3,174 Views)