LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

floating point values using "scan from string"

Hello,

I wanted to grep vales from a string 

"$PRISTY,1,-1,6553,25.3,0,,,,0*1D3B"

I basiclly wanted first 5 values. (1 -1 6553 25.3 0)

 

If i use scan from string with match pattern $PRISTY,%d,%d,%d,%f,%d  ---> i get "error 85"

 

I can grep first 4 values, using $PRISTY,%d,%d,%d,%f  ----> but the fourth value i get is just 25 and not 25.3.

 

I think there is problem in greping floating point values.

0 Kudos
Message 1 of 2
(2,469 Views)

Works fine for me. Maybe your local settings use the comma as decimal separator?

Try prepending %.; to the format string, i.e. use %.;$PRISTY,%d,%d,%d,%f,%d

 

Message 2 of 2
(2,439 Views)