LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary number display format

Hi everybody, I am a student, now I faced a problem, I convert one decimal number to a binary number, but I want the result is always 8 bits. For example, I convert decimal no.7 into binary no. Is 111, I want the format is 00000111. And the result can display by using LED(if the digit is "1" LED light up)Is it possible? Hope can get solution, Thanks a lot.
0 Kudos
Message 1 of 8
(3,440 Views)
Hello Kuroro,
Try the following:
Hope it helps,
Paulo
0 Kudos
Message 2 of 8
(3,427 Views)
thanks PauloM. my LabVIEW Version is 7.0 your program code is 7.1.1, I can't open it, it display LabVIEW load error code 9; still thanks for helping.
0 Kudos
Message 3 of 8
(3,422 Views)
Try it now...
0 Kudos
Message 4 of 8
(3,419 Views)
For the first problem, just create a U8 indicator. Then right-click..."format&precision" and select "binary, 8 wide, pad with zeroes".
For the second problem use "number to boolean array". Invert array as needed depending how you want to look at it.

See atttached.
Message 5 of 8
(3,414 Views)
Give this one a try, its a little simplier and keeps the values in numerical format.
Message 6 of 8
(3,409 Views)
Whoops altenbach beat me but with the same concept on the numerical display, just pad with 0's on left. Sorry I didnt describe it more I had someone here waiting on me to try something. The boolean array is problably a better choice because if needed you can always index the array to get a specific bit which was the main reason I used a cluster (it leaves those bits for you to easily access) but I dont know which uses more resources. At least you have a few alternatives now. Best of luck.
0 Kudos
Message 7 of 8
(3,401 Views)
Thanks for helping me. the solution is perfectly done. I learn a lot from it.

may I ask how to move the arrow to the left if we press the left puch button, but when we press the up button the arrow move up(on the front panel), it goes the same as right and down button. I would like to know which function should i used.

we got the joystick interface problem as well, our joystick is USB port, but we can not communicate with it in LabVIEW(Measurement and Automation), Is it because we did not instal the driver?

Thanks a lot.
0 Kudos
Message 8 of 8
(3,382 Views)