LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary indicator

How do I get a binary indicator to display all 8 bits of my value without truncating the zeros?

Thanks
0 Kudos
Message 1 of 9
(4,654 Views)
Hi Lei,

I have tried in the past to do this unsuccessfully. LV always truncates the Zeroes on the MSB side and starts with the First "1" encountered from the MSB side. I am assuming here.. that you are using Numeric Indicator Configured to Show Binary Value.

One Work Around is to Use Format into String Function and Use Pad with Zeros to See the truncated Zeroes. But again the Length of the String is fixed based on what you set it to be. Since you know what your data is 8 Bit 16 Bit etc. This is not a Problem.

Here is a small Vi showing this ...

Good Luck

Mache
Good Luck!

Mache
0 Kudos
Message 2 of 9
(4,654 Views)
Here is an off-the-wall idea.

Make you indicator I16 and add 100000000 (binary) to it be fore you display the value.

Subtract when you are done.

Set the dissplay for "right Justify" and then size the indicator so you can not see the "1" in the 9th bit.

Counting up and down (in the control variation of this idea) would work as usual.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 9
(4,654 Views)
Nice! If you can't do it directly...cheat!

Thanks Ben 🙂
0 Kudos
Message 4 of 9
(4,654 Views)
There was nothing in your question that said I could not cheat.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 9
(4,654 Views)
Also,

Sometimes cheating inspires a good idea.

Sharing thoughts,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 9
(4,654 Views)
Formatting the number to a string with a set length is the best way I've found to display all bits of a byte or word.

Kelly
0 Kudos
Message 7 of 9
(4,654 Views)
Hi Mache,

Is there any chance you could save the VI for an earlier version of LabVIEW. I only have the evaluation version (6.01).

Thanks a lot for your help.

Lei
0 Kudos
Message 8 of 9
(4,654 Views)
Here is the Vi in Ver 6.0. You should be able to open with eval version too!!

Good Luck!!

Mache
Good Luck!

Mache
0 Kudos
Message 9 of 9
(4,654 Views)