LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String separation

Solved!
Go to solution

Hello,

I'm sorry if it has been already asked but I'm facing some troubles concerning string splitting.

I have a serial port that gives me a string of hexadecimal numbers : for example : \02P\00\03\CF\01\02\00\FD\03

 

In here, I would like to get the numbers  : 03CF , 0102  and 00FD which corresponds to 3 variables that my sensor is measuring.

I tried using the Search/Split String Function and I have succeeded in separating my string in fragments : \03 or \CF for example.
However, I can't get past this point and remove the backslah '\'.

 

When I used the String length function on \03 it gave me 1...

 

I want to separate those strings so I can convert them afterwards using the Hexadecimal String to Number Function

 

Thank you in advance...

 

 

0 Kudos
Message 1 of 2
(2,346 Views)
Solution
Accepted by topic author felibonobo

It sounds like you have "\ Codes" display turned on.  I think you should change it to Hexadecimal display to make it look more like what you want to see.

 

So it sounds like you already have a binary/flattened string.  So just use Unflatten From String to create an array of U16.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 2
(2,309 Views)