ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

character to hex conversion

Hi,
 
How can i convert character into hex string , for example if i have the data as "testing data", how can i get the hex coded output? Ive tried out using first string to number vi and thennumber to hex conversion vi but i get the answer as 0, can u help me in this?
 
In short my data is " testing1234okokok" , i want a hex coded output which would be something as  "AD87BA......."
 
Please help
From Subhash
0 Kudos
Message 1 of 8
(4,083 Views)

Hi S.G1.,

do you want the ASCII Code as Hex? something like a = 97 = 61Hex?

Mike

0 Kudos
Message 2 of 8
(4,078 Views)
It should be pointed out that the for-loop in the example is not necessary and superfluous.

To OP: How is one supposed to get "AD" for "t", and "87" for "e"? These are not ASCII values for the characters.
0 Kudos
Message 3 of 8
(4,042 Views)
@smercurio_fc
your are right with the for loop, but i hate coercion dots. Smiley Happy
 
Mike
0 Kudos
Message 4 of 8
(4,031 Views)
What coercion dots? There are no coercion dots even without the loop:




Message Edited by smercurio_fc on 02-13-2008 03:12 PM
0 Kudos
Message 5 of 8
(4,017 Views)

Hi,

thats interesting. What do i have to change in the attached vi, so that there is no coercion dot?

Thanks

Mike

0 Kudos
Message 6 of 8
(4,008 Views)
That looks like a LabVIEW 8 thing since opening the VI in 8.2 shows no coercion dot. I checked the Upgrade Notes for 8.2 and saw no mention of a change in the polymorphic nature of the Numeric to String functions. I don't have 8.0 to verify, but I would think that regardless of whether it's done in a loop or not, the existence of a coercion dot shouldn't change.

Interesting sidebar, and I would still like a better clarification from the original poster on the relation between the text and the hex values.
0 Kudos
Message 7 of 8
(4,001 Views)

Hi,

yes i saved it for 8.0, but in 8.5 is an coercion dot, too. OK, i saw that there are differences. Thanks for the information.

Mike

Message 8 of 8
(3,998 Views)