LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert asci string to hex

Solved!
Go to solution

The attached VI allows me to convert a single ASCII character to to hex.

 

If I have a string of ASCII characters I can convert them by breaking the string into individual characters and converting each individually then forming a string again. Is there an easier way to convert an ASCII string into hex without parsing?

 

For example: CN1003001A (ASCII string) should equal 434E3130303330303141 (hex string).

 

Thank you

0 Kudos
Message 1 of 4
(3,208 Views)
Solution
Accepted by topic author chuck72352

String to Byte Array, Number to Hexidecimal String, Concantanate String.

 

Message Edited by Dennis Knutson on 03-13-2010 10:58 PM
Message 2 of 4
(3,202 Views)
Thank you, it works perfectly!
0 Kudos
Message 3 of 4
(3,174 Views)

Dennis solution is not really equivalent to your posted example, he converts it into a hexadecimal formatted string, while you convert it to a number and display it in hex display format.

 

I really depends what you need to do with it later. For a plain front panel display, you could just set the string indicator to hex format instead of normal, no code needed (It will  not be exactly the same but also slightly more "readable" because it will be grouped into words).

 

 

 

Can you tell us a little bit more about your application? 

Message Edited by altenbach on 03-14-2010 12:10 PM
Message 4 of 4
(3,157 Views)