LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to scan a string containing % (percent symbols) using the "Scan from String" function?

Solved!
Go to solution

I am communicating serially with a chilled mirror device and the input string syntax contains this text: "%RH=<input value>"

 

I have not been able to figure out how to tell the function that the percent here is not a format specifier. Is this possible, or should I just try to use a different function?

 

Thanks.

Mitch
0 Kudos
Message 1 of 3
(2,622 Views)

Use  '\%RH=%f' (or similar) as the format string.  The backslash lets you use the percent character.

0 Kudos
Message 2 of 3
(2,614 Views)
Solution
Accepted by topic author Qianlong

Use %% in your format string so that it knows to use the percent literally.  So %%RH=%f

 

 

EDIT:  Darin got one in there ahead of me.  It looks like either \% and %% both work.

0 Kudos
Message 3 of 3
(2,612 Views)