LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert ascii to hexadecimal

They forgive my weak knowledge of labview. It needed that they helped me, to convert AsciiI into hexadecimal. I give the following example:    I have a string #01SVT<BL>+098,037 (ASCII) = 2C9 (hexadecimal). how it is that I can get this for labview?    Debtor, and I ask for excuse for my English.
0 Kudos
Message 1 of 6
(4,777 Views)
Hi Luigi,
why is 2C9 (hexadecimal) = #01SVT<BL>+098,037 (ASCII)?? But anyway, if you want to split your String to extract some parts of the String, there is a function called "split string"
. And from that splitted part you can make a conversion to a hexadecimal string by converting it into an integer and converting back to a hexa- string. All that functions you can find in the "string"-palette.
Another hint (and one of the reasons i'm so inspired by LabView) is: If you want to test the behaviour of a function or VI, simply open a new blank VI, drop the function to examine and create appropriate controls and indicators of the interesting In- and Outputs by the context menu of the connectors. Then you can type in some testdata and run the VI to see, what the function does. This is a very fast way to create a testing environment for the function.

Hope this helps,
Dave
Greets, Dave
0 Kudos
Message 2 of 6
(4,764 Views)

Hi,

as Dave said use the string convertion VI of Labview, see link below:

http://forums.ni.com/ni/board/message?board.id=170&message.id=185734

 

ClémentG
0 Kudos
Message 3 of 6
(4,739 Views)

Hello

 

I want to convert a string "02 sRN LMDsacandata 03" from ASCII to HEX to communicate via TCP/IP with a device(LMS111). I've tried to split the string in 3 parts and then concatenate it, but i don't get the right convertion (02 73 52 4E 20 4C 4D 44 73 63 61 6E 64 61 74 61 03). Can anybody help me with this problem?

 

Thanks.

 

0 Kudos
Message 4 of 6
(4,112 Views)

Your conversion of STX to an I32 (4 bytes) is all wrong. If the control is set for hex display, you don't need to convert anything at all.

0 Kudos
Message 5 of 6
(4,105 Views)

You're overdoing it. All you need to do is to concatenate the strings. Just make sure the strings are in hex display mode.

 

 

Edit: What he said. Smiley Very Happy

0 Kudos
Message 6 of 6
(4,103 Views)