LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Embedded for ARM - Convert hexidecimal with preceeding backslash to ASCII

Solved!
Go to solution

- LV 2010 with Embedded for ARM module

- MCB2300

- COM1 port

 

I am trying to read in a serial string on this port from a serial device. I am (for whatever reason) reading in hexidecimal characters. I can either read in one byte at a time or all bytes at port.

 

My coming string either looks like this:

\D5\8B\D6\EC\AB\D6\EC\FB\F6\FB\F6\EBV\D6\EC\EB (if I read in all at once)

 

or 

 

\DB

\8B

... (if I read in one byte per iteration)

 

Either way I want to convert this to ASCII characters but I can't get the '\' off the front of the string. I have tried two ways and neither works. The outputs are just blank. Any suggestions?

 

 

 

 

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

Hi tir38,

 

Your logic inside the case structure worked for me. However, for your program, I suggest running your program in Highlighted Execution to check if the case structure hangs while waiting for the boolean input. In addition, I see that you have added the substring indicator, does that indicator show the cleaned-up HEX string correctly before converting it to a decimal?

 

 

 

 

Aldo A
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(5,880 Views)
Solution
Accepted by topic author tir38

suprisingly, when I change the 1 to a 0 (i.e. remove nothing) it works.

0 Kudos
Message 3 of 3
(5,876 Views)