LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Input string problem

Hello every !

I have a script want to change the contents with front panel but after switching it turns to wrong form as the picture... 

here is my front panel and program and hope someone can help my problem ….

A.PNGB.PNG

0 Kudos
Message 1 of 5
(2,303 Views)

Format into string uses %s, %f, %d, and there is none of those in the input string.

 

I don't see how your inputs result in that output.

 

If you post the VI we could actually try ourselves!

 

BTW. If you wire a path to Read Text From File, you don't need the close. It doesn't hurt though. See the help:

"The default is to close the file if it is referenced by a file path or selected from the file dialog box. If file is a refnum or if you wire refnum out to another function, LabVIEW assumes that the file is still in use until you close it. "

0 Kudos
Message 2 of 5
(2,273 Views)

Hi weibe , thanks for your response

 

Format into string I using %s , %d in original text file so you can see output result changed below the After text like 1.Send %s --> Send aaaa 

My question is from before changed the path in text like C:User\...  and "\" and some alphabet are gone …  I have no idea

a.PNG

I attached my VI at here  

0 Kudos
Message 3 of 5
(2,262 Views)

Ah, I was staring blinly at those red lines.

 

I assume a \ is used as an escape character by the Format Into String. A \n will become a line feed, a \s a space, etc. So the \ characters in the paths are replaced with bogus outputs.

 

Before using the format string input, you can try to replace each \ with a \\ (Search And Replace String) in that string. That will escape the \ character so the Format Into String outputs a \.

Message 4 of 5
(2,252 Views)

Hi weibe !

 

thanks for your reply , I think I figure out what's happening with \

 

I modified original text content which with \ and I changed it to \\ and it works !

0 Kudos
Message 5 of 5
(2,188 Views)