LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert String with hex-values to string with chars

Hello,
i want to create a vi with one string-in and one string-out.
In string-in a is inserted a hex-value like for example "65". In the string-out i want the real char to be returned what would be the charactaer "e".
How can i do this?
Thanks for your help
0 Kudos
Message 1 of 7
(4,184 Views)
 

There is a function to convert a hex string to a number and one to convert a byte array (an array of numbers) to an ASCII string, so that's one way to do it. Both functions to do this can be found in subpalettes of the String palette.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
Message 2 of 7
(4,178 Views)
TST is right (as usual). Here's an example of how to do it:


Message Edited by Philip Courtois on 01-03-2007 05:43 AM

Cheers,
Philip Courtois « Development Engineer « 2C A/S « Denmark « Heading towards CLA

Message 3 of 7
(4,173 Views)
Thanks @tst and @Philip for this fast help. Works great.
0 Kudos
Message 4 of 7
(4,160 Views)

Sorry - I just noticed that the front panel in my screenshot is not updated with "e" in the indicator Smiley Surprised. Guess I should have pressed Run once more before taking the screenshot... I apologize for the confusion.

Message Edited by Philip Courtois on 01-03-2007 06:17 AM

Cheers,
Philip Courtois « Development Engineer « 2C A/S « Denmark « Heading towards CLA

0 Kudos
Message 5 of 7
(4,157 Views)
Yes, i was wondering for a short time. But i thought to myself that you just have strange codepage installed or something like that.
But thanks for the info.
0 Kudos
Message 6 of 7
(4,151 Views)
Since you're dealing with ASCII values in LabVIEW, here's a little VI I once created to get a good overview of available ASCII characters.

Guess that's what happens when a LabVIEW fan misplaces his ASCII table...
Cheers,
Philip Courtois « Development Engineer « 2C A/S « Denmark « Heading towards CLA

0 Kudos
Message 7 of 7
(4,138 Views)