# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Convert 8 bit Binary numeric to 1 byte string

Hello..

I want to convert a 8 bit binary number to hex string.

Examples;

binary- 00000000  -> 00 (Hex)

binary- 11110000  -> F0 (Hex)

binary- 01110000  -> 70 (Hex)

And the Hex STRING should be 1 Byte.

I tried but its not showing the exact string as above.

I have attached the VI.

Message 1 of 7
(6,130 Views)
Solution
Accepted by topic author Nayan

## Re: Convert 8 bit Binary numeric to 1 byte string

Hi Nayan,

can't open your VI here, but your question translates to this snippet:

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(6,124 Views)

## Re: Convert 8 bit Binary numeric to 1 byte string

Thanx Buddy.. Thank you very Much..
Message 3 of 7
(6,116 Views)

## Re: Convert 8 bit Binary numeric to 1 byte string

@GerdW wrote:

Hi Nayan,

can't open your VI here, but your question translates to this snippet:

Can you please specify the 2nd node used(between numeric control and  byte array to string converter)

Message 4 of 7
(5,236 Views)

## Re: Convert 8 bit Binary numeric to 1 byte string

Hi sajipk,

what I posted is a snippet: you can drag it onto a block diagram to get real code!

What does that node?

Let's look at the snippet:  At the input it gets an array of U8 (depicted in the function icon by "[U8]") and at the output you get a string. Obviously it's a conversion function… (Hint: search for "U8 array to String"…)

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 7
(5,228 Views)

## Re: Convert 8 bit Binary numeric to 1 byte string

The second block is a function 'Build Array'.

Message 6 of 7
(5,223 Views)

## Re: Convert 8 bit Binary numeric to 1 byte string

@SPK91 wrote:

@GerdW wrote:

Hi Nayan,

can't open your VI here, but your question translates to this snippet:

Can you please specify the 2nd node used(between numeric control and  byte array to string converter)

This solution proves that sometimes there's just no substitute for experience.  I'm pretty sure it isn't obvious to a beginner that you would have to convert the number into an array of numbers first so you can use the byte array to string node.  Even less obvious is that you can use the "build array" node with just one input and output.

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 7 of 7
(5,209 Views)