LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert decimal to binary in Labview

I am a beginner in Labview, please help with this- how to convert decimal to binary in labview using a VI
0 Kudos
Message 1 of 17
(29,711 Views)
Depends on what you want to do.
If this is just a matter of display, you can simply change the display format. This works only for integer values :
1/ select the indicator type (U8, U16,...I32) : right click >> representation.
2/ ask for "binary" format : right click >> Format and Precision >> Binary
 
Is that what you were looking for ?
 
 
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 2 of 17
(29,699 Views)
Try this. I'm sure there might be more elegant ways to do it but it's straightforward for a newbie. Have fun!
 
Paul
PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
Message 3 of 17
(29,698 Views)
Here is a way to convert any decimal number to a binary string.  If using U8, the string will be 8 bits long, with zeros padded to the left.  If U16, the string is 16 bits long, and U32 is 32 bits long.  You can change the U type by right clicking on the numeric control on the front panel and selecting Representation - Ux.  The program will automatically adjust the length of the string.
- tbob

Inventor of the WORM Global
Message 4 of 17
(29,684 Views)
Like CC says, it depends on the format and data type of the source and destination. Look at the attached VI to see how many ways to "convert" and display a number there are...Welcome to LabVIEW!


LabVIEW, C'est LabVIEW

Message 5 of 17
(29,675 Views)
Thanks everybody for your help and advise.
 
Charu Leo
0 Kudos
Message 6 of 17
(29,668 Views)

JPD, you really are a joker !

Since Ray's crack-pot idea of changing his user name some months ago, I have taken some dispositions just to go around these kinds of maneuvers. The List does not rely anymore on logins. Sorry to deceive you... But beware,  I could consider that as an agressive move that could cost you some stars ! :D:D:D

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 7 of 17
(29,639 Views)
I would like to take credit for that, because I believe my E-Trend VI handled the users by their numbers and even adapted to new names even before Ray changed is nick (Charly, just picture Nelson here) Smiley Very Happy.

___________________
Try to take over the world!
0 Kudos
Message 8 of 17
(29,624 Views)

I'm having the same problem. My application:

 

I joined 5 boolean controls in an array and converted to an integer. I am using this integer as a case selector. It would be much easyer if I could convert this integer into a binary number to create the cases than writing in decimal form (this is an organizational decision) but I couldn't find such function.

0 Kudos
Message 9 of 17
(27,328 Views)

All you have to do is right click on the case selector and select 'Radix>Binary'.

0 Kudos
Message 10 of 17
(27,303 Views)