LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex number to hex string

Solved!
Go to solution

Dear Labview moderators and experts.

I am looking one simple tool, but couldn't find out.

Could you help me?

 

I want Hex number convert to hex String, without any change.

I mean Hex display numeric shows E8 and I convert it to string, and I open string indicator Hex display window and get same answer E8.

Anyone know how to do it?

Thank you very much in advance!

0 Kudos
Message 1 of 8
(7,917 Views)
Solution
Accepted by h.melikyan

typecast will do what you want.

 

 

(Make sure that the numeric is U8 and the String is set to hex display.)

0 Kudos
Message 2 of 8
(7,911 Views)

Isnt there in the strings->string/number conversion a number to hex string vi? (in lv 2011)

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 3 of 8
(7,897 Views)

There is, The difference is that the Number to Hexadecimal String function gives you letters for each hex value. Thus the output would be a string to 2 characters: "E" and "8". The Type Cast give you a string of one character, where the ASCII value is E8 (232 decimal).

 

Which one to use depends on what is intended to be done with the string. The OP said they simply wanted it for display, so either way will work.

0 Kudos
Message 4 of 8
(7,885 Views)

There's also the byte array to string.  If you are dealing with only 1 byte, then you will have to use build array first.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 8
(7,877 Views)

@smercurio_fc wrote:

he OP said they simply wanted it for display, so either way will work.


I don't think so! The OP said what he wanted to see on the display (numeric set to hex format and string set to hex display). That does not mean he's not going to use it somewehere else, e.g. send it to an instrument. 😉

 

 

0 Kudos
Message 6 of 8
(7,867 Views)

@altenbach wrote:

@smercurio_fc wrote:

he OP said they simply wanted it for display, so either way will work.


I don't think so! The OP said what he wanted to see on the display (numeric set to hex format and string set to hex display). That does not mean he's not going to use it somewehere else, e.g. send it to an instrument. 😉


I did not interpret it that way. I interpreted the request as having a string indicator show "E8". The OP may be under the mistaken assumption that the only way to show hex values is to set the string indicator to "hex display mode", but as noted, there are other ways to accomplish the same (essential) thing. The OP has been shown several ways to do it, so they can choose what works best for the situation.

0 Kudos
Message 7 of 8
(7,856 Views)

Thank you very much.

Problem Solved.

Type Cast was the Solution!

 

0 Kudos
Message 8 of 8
(7,835 Views)