LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting decimal string to a number

I have the same doubt, what should I do in my program, is giving the same error. Could you help me please.

0 Kudos
Message 11 of 33
(3,534 Views)

Doubt??  Or a question.

 

Post your VI so we can see what you are doing.

0 Kudos
Message 12 of 33
(3,527 Views)

My VI is attached. The following image are the values that are not rounded.

 

Download All
0 Kudos
Message 13 of 33
(3,521 Views)

@Carvalho10 wrote:

My VI is attached. The following image are the values that are not rounded.


What indicators are giving you problems and what "error" are you talking about.

 

It looks like your system is set to "comma" as decimal separator, while the received strings contain periods, which are not recognized and the fractional part is ignored. Maybe you should change the decimal point settings.

 

It also looks like most of your indicators are set for 6 significant digits. If you want more, you need to change the display format.

 

You also have several race conditions. For example the local variable wired to pitch, roll, and yaw will get read before the indicator gets updated with the new value.

0 Kudos
Message 14 of 33
(3,512 Views)

Thank already made these changes but did not work. Data is still coming integers. Should I change the icon? Another question Lord knows an icon that can save data to a string that is passed to the VI?

0 Kudos
Message 15 of 33
(3,491 Views)

Change what icon?

 

If it still doesn't work, then you need to post your VI.  I'm guessing that you didn't implement change from decimal point to a comma correctly.  Did you wire a False constant into the top of the Fract/Exp String to Number function?

 

Try using the Scan Value function instead.  Look closely at the help files for the syntax of the format string for the conversion.  There is generally a code such as .; which will force the conversion to pay attention to the string containing decimal points no matter what the OS tries to say the decimal separator is.

0 Kudos
Message 16 of 33
(3,483 Views)

Actually Scan From String is the function I would use.

 

I just couldn't remember the exact name of it and found Scan Value in the palettes first.

0 Kudos
Message 17 of 33
(3,475 Views)

I talked about changing the icon because the data are integers or round leaving this icon: Fract / EXP string to number. The previous icon appears the correct value. I do not know what else to do. My VI is attached. thank

Download All
0 Kudos
Message 18 of 33
(3,454 Views)
Then change it to the recommended function if you don't want to change the system setting. To repeat - use Scan From String.
0 Kudos
Message 19 of 33
(3,452 Views)

Did you try wiring a False constant into the top of the functions you are using now?  Like I said in message 16?

0 Kudos
Message 20 of 33
(3,447 Views)