ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
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.
Please help.
I have attached the VI.
已解决! 转到解答。
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"…)
Edit/correction: you are talking about this function, which converts a scalar item into an array? 😄
@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.