07-06-2012 01:36 AM
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!
Solved! Go to Solution.
07-06-2012 02:26 AM - edited 07-06-2012 02:28 AM
typecast will do what you want.
(Make sure that the numeric is U8 and the String is set to hex display.)
07-06-2012 05:27 AM
Isnt there in the strings->string/number conversion a number to hex string vi? (in lv 2011)
07-06-2012 06:29 AM
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.
07-06-2012 07:14 AM
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.
07-06-2012 09:36 AM
@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. 😉
07-06-2012 10:32 AM
@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.
07-06-2012 11:06 PM
Thank you very much.
Problem Solved.
Type Cast was the Solution!