LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

number to hexadecimal string

Hi,

I wonder whether anybody can give me a hint. Please, see the tiny vi in the attachment. I'd like to convert an integer number into a hexadecimal string. Why do I not get the expected "00" if I want to convert "0"? Rather the function delivers "30". Strange, strange...

Thanks for any tip,
Peter
0 Kudos
Message 1 of 5
(2,914 Views)
Refer to this chart for the ascii character conversions.
http://digital.ni.com/public.nsf/websearch/283fd21035defa0386256a390061ce5f
0 Kudos
Message 2 of 5
(2,907 Views)
Hi,

You have to use the normal view of the string indicator. Not the hex view.
See also adjusted vi…
0 Kudos
Message 3 of 5
(2,902 Views)
You don't need to have the string indicator in 'Hex' display mode. The 'Number to Hex String' function will output a string in Hex notation of the input number. The Hex display mode for the string indicator actually displays the ASCII representation of the string in the indicator, which is normally in hex notation.

If you always want at least 2 digits in the string, change the width(-) terminal to 2. This way, a 0 on the input number will result in a 00 string representation.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 4 of 5
(2,899 Views)
Thanks a lot for your fast and helpful response!
Peter
0 Kudos
Message 5 of 5
(2,887 Views)