ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

remove slash codes

Hi all,
I have run into a bit of a perplexing problem.  I am communicating with an instrument via TCP.  When I try to compare the received strings, I get an error.  For example if I see a 1 in the string, and compare it with a string 1, I get a false.  A search here suggested a possible problem with slash codes.  If I probe the line with the return data, copy and paste it into the diagram, and enable \ codes display, a '\00' appears after the 1.  How on earth do I get rid of this?  I can't just convert to a number because some of the data is string data.
 
Jim
Jim

LV 2020
0 Kudos
Message 1 of 3
(3,556 Views)
A \00 is the ASCII NULL character. Before you do your comparsion, you can use the Search and Replace function. For the search string, create a string constant and enable \ code display for it. Enter \00 into the constant. For the replace string, use the empty string constant. Set the replace all input to true.
Message 2 of 3
(3,553 Views)

Dennis,

Again I thank you.  I had tried the search and replace but hadn't thought to turn on the display codes.  You just saved me a bunch of time.  Thanks.

Jim

Jim

LV 2020
0 Kudos
Message 3 of 3
(3,547 Views)