LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV RT - String to double conversion

Solved!
Go to solution

Hello,

 

I want to convert a string to a double on my Real Time device (PXI-8101. When I use the "scan value" or "Fract/Exp String To Number Function" VI the numbers after comma dissapear. This does not happen on the Host (PC). 

 

So for example on the host vi, the string "2121,3" gives the number 2121,3. If I do the same thing on the Real Time, the string "2121,3" returns the number 2121. 

 

How can I fix this?

 

Thanks in advance,

Regards,
Dries

0 Kudos
Message 1 of 4
(3,097 Views)

Hi dries,

 

try ScanFromString with "%.;%f" as format code...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,094 Views)

Hello,

 

Thanks for the reply, but scan from string also does not return the correct number on the RT device. The VI returns the number after comma as the remaining string. Any other suggestions?

 

Best regards,

Dries

0 Kudos
Message 3 of 4
(3,057 Views)
Solution
Accepted by topic author LVD

I've changed the format string to "%,;%f" and now it works. Thanks for the help.

 

Best regards,
Dries

0 Kudos
Message 4 of 4
(3,055 Views)