LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how convert decimal string to hexa string

I would like to convert a decimal string in hexadecimal string.
Ex a string written in decimal : 20 and then find a string written in hexadecimal 14
thank you
0 Kudos
Message 1 of 7
(5,605 Views)
Use the "Number To Hexadecimal String" function. It can be found in the Functions > String > String / Number Conversion pallete

Tim
0 Kudos
Message 2 of 7
(5,605 Views)
I know that function
I would like to convert : a decimal in normal display mode like 20 in a hexadecimal in hexa display mode
The input is 20 in normal display
The output is 14 in Hexa display
Do you understand?
Thank you
0 Kudos
Message 3 of 7
(5,605 Views)
Do you mean that you want one indicator formatted as decimal (normal) and one formatted as Hex?

On the indicator (or control) right click and choose Formatting and Precision and select the formatting you want.

See attached.

Tim
0 Kudos
Message 4 of 7
(5,605 Views)
hi

is this, what you are looking for ?
0 Kudos
Message 5 of 7
(5,605 Views)
The way to approach this task to first break-up the input string into seperate values. When you say a "decimal string" of 20, do you mean a single character with an ASCII value of 20 decimal, or a 2-character string consisting of a "2" and a "0"?

Note, there is a similar issue on the "hex string" side. Do you want a single character with an ASCII value of 14 hex (which by the way is identical to a character with a ASCII value of 20 decimal); or a two-character string consisting of a "1" and a "4"?

If you can post an exact description of the input string, with perhaps a sample, I can post you an example of how to make the conversion.

Mike...

BTW: what are you going to do with this string when you're done?

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 7
(5,605 Views)
"tot" wrote in message
news:506500000005000000C3FA0000-1042324653000@exchange.ni.com...
> I know that function
> I would like to convert : a decimal in normal display mode like 20 in
> a hexadecimal in hexa display mode
> The input is 20 in normal display
> The output is 14 in Hexa display
> Do you understand?
> Thank you

No, I don't understand. Your original post talked about decimal numbers as
strings and wanting to display them as a hex string. Shan's reply is
correct. Convert the decimal string to a number then convert the number to
a hex string.

If that is not acceptable, change the display radix on the indicator.
0 Kudos
Message 7 of 7
(5,605 Views)