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: 

How to convert decimal to binary

Is there a module that converts decimal number to binary? I need to input number and output 0011.
May be some one has a formula
0 Kudos
Message 1 of 32
(53,635 Views)
Use "format into string" with a format code of e.g "%04b" if you want a string output with these binary digits.

If you just want to see the binary representation in a numeric indicator, set its formatting to binary (right-click..format&precision..).
Message 2 of 32
(53,629 Views)
Can you plese convet file to 6.1 format. I am not able to open with 6.1
Thank you
Message 3 of 32
(53,625 Views)
LabVIEW 6.1 cannot do leading zeroes in binary numeric indicators, but here's the conversion anyway.
0 Kudos
Message 4 of 32
(53,624 Views)
Hello how are you?

I am trying to start with an input string...12345678901, and convert into 36 bit binary. In this example, there will be 34 bits and two zeros will be placed in front of the binary converted string to fulfill the full 36 bits. Each time there is a new input, I would like for the original input string to increment by 1.  So 12345678902->converted to binary.

Any ideas

Thanks


0 Kudos
Message 5 of 32
(53,397 Views)
Sorry about that. I am new to labview and must have gotten lost within the links. I really would appreciate it if you could help me out, if you have the opportunity.

Thanks
0 Kudos
Message 6 of 32
(53,398 Views)
(It is not clear why you now had to add to a 2 year old unrelated thread. Why didn't you start a new thread?)
 
Can you explain in a bit more detail what you mean by 36bit binary? LabVIEW does not have a native 36bit datatype, so what do you actually want?
  • a 36digit string consisting exclusively of the letters 0 and 1?
  • A U64 integer masked to 36 bits?
  • A 5 byte binary string masked to 36 bits?
  • ...???

 

0 Kudos
Message 7 of 32
(53,390 Views)
I am trying to start with an input string...for example 12345678901, and convert that string into 36 bit binary. In this example, there will be 34 bits and two zeros will be placed in front of the binary converted string to fulfill the full 36 bits. When you convert 12345678901 into regular binary, you will get 1011011111110111000001110000110101, which is 34 characters. Since there are 36 characters needed, two zeroes will automatically be placed in front of the converted string to fullfill the 36 character requirement.  So if my input is 1, then there will be 35 total zeroes followed by 1. Each time there is a new input, I would like for the original input string to increment by 1.  So 12345678902->converted to binary. 
0 Kudos
Message 8 of 32
(53,384 Views)
OK, you want it formatted as binary, not "converted to binary". Big difference. What is your LabVIEW version? What is a new input? Where is it coming from?
0 Kudos
Message 9 of 32
(53,381 Views)
My labview version is 8.2.  Basically a "new input" would represent new compiled information if I continuously ran the program.
0 Kudos
Message 10 of 32
(53,379 Views)