LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HEX to ASCII

Hello everyone,

this is a stupid question......

How do I convert an HEX code to an ASCII code in labview? The device sends
me a CAN message with the data that I need but it sends it to me in an HEX
code. After I've received the message, I need to convert the HEX code to
an ASCII code.

ex : the first byte of data contains the HEX code 31, now I need to convert
it to the ASCII code which is 1, and so on with whatever code I receive.

I've looked everywhere in labview but I can't find what I want to do.

Thx


Eric Paulin
0 Kudos
Message 1 of 3
(3,576 Views)
nevermind this message I found it......

byte array to string.....that's it.... I told you it was stupid.....:)

Eric Paulin


"Eric Paulin" wrote:
>>Hello everyone,>>this is a stupid question......>>How do I convert an HEX
code to an ASCII code in labview? The device sends>me a CAN message with
the data that I need but it sends it to me in an HEX>code. After I've received
the message, I need to convert the HEX code to>an ASCII code. >>ex : the
first byte of data contains the HEX code 31, now I need to convert>it to
the ASCII code which is 1, and so on with whatever code I receive.>>I've
looked everywhere in labview but I can't find what I want to do.>>Thx>>>Eric
Paulin
0 Kudos
Message 2 of 3
(3,575 Views)
Eric Paulin wrote:

> Hello everyone,
>
> this is a stupid question......
>
> How do I convert an HEX code to an ASCII code in labview? The device sends
> me a CAN message with the data that I need but it sends it to me in an HEX
> code. After I've received the message, I need to convert the HEX code to
> an ASCII code.
>
> ex : the first byte of data contains the HEX code 31, now I need to convert
> it to the ASCII code which is 1, and so on with whatever code I receive.
>
> I've looked everywhere in labview but I can't find what I want to do.
>
> Thx
>
>
> Eric Paulin

Eric it's simple. Most likely you receive your data in a string.
Right-click on this string indicator and choose normal/hex display.
If you get bytes in U8 array(?), wire it to
byte array to string
function and see your "1" in a string indicator as an ASCII symbol.
--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
sergey_acs@levsha.ru
http://acs.levsha.ru
0 Kudos
Message 3 of 3
(3,575 Views)