LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert an ASCII string of variable length to a HEX number?

Hello,

 

I read data from the serial port 5 times in a second (while loop) and the number of bytes read varies every time.

The data comes in as ASCII string, and I can see the HEX representation if I connect a HEX string indicator, but I need to permanently convert data to a HEX number. 

How can that be done?

0 Kudos
Message 1 of 5
(3,560 Views)

Like This.

 

ConverToHexSTring.png

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 5
(3,551 Views)
TNX! But what will happen if i get 00 in the middle of the hex string. Will that be left out?
0 Kudos
Message 3 of 5
(3,529 Views)

žabić wrote:
TNX! But what will happen if i get 00 in the middle of the hex string. Will that be left out?

No, if the string contains a NULL byte (0x00) then the output string will show 00.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 5
(3,525 Views)
0 Kudos
Message 5 of 5
(3,501 Views)