LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enter binary values in LabView?

For example, I want to enter the binary value 1010000 into a field in LabView, and I want LabView to convert it to the number 80. For example, 101 would be the number 9.

And I also want my application to convert all numbers read from our device and display them in their binary form. So it would receive the number 80, and display it as 1010000.

Using normal procedures I send 1010000 to our device and it records it as 80, so somewhere along the line LabView does this.

However, if I want to enter a 16-bit number, a number with 16 ones or zeroes, then LabView limits the data range to the maximum 16-bit value, 65,535.

Thanks for the help.

-Kazem
0 Kudos
Message 1 of 4
(3,989 Views)
All numbers are stored in binary format in the computer anyway. The only change comes in how it is displayed.

Put your control or indicator up on the screen and right click on it. This should give you a menu. Choose "Format and Precision...". At the top of the window that opens, you will see a drop-down box that lets you choose how the number will be displayed. Pick "Binary" and click "OK".

This works with all non-floating point number formats.
Message 2 of 4
(3,989 Views)
Thanks. I had no idea that was an option. I've been programming for a couple months in LabView, but I never looked into that particular menu. Works great. Thanks!

-Kazem
0 Kudos
Message 4 of 4
(3,989 Views)
Right click on the control or indicator, choose Format & Precision and then select Binary format. I'm not sure I understand your second question. If you use an 16 bit interger, then yes you are limited to 65535 and if you use an 8 bit integer you are limited to 128. If you want to display more than 16 bits, use the Long or Unsigned Long data type.
Message 3 of 4
(3,989 Views)