09-22-2023 07:25 AM
Hi,
I have an instrument returning the measured current as a fractional string with dot as a decimal separator. The string needs to be converted to a DBL so I can do some math on it. In our country decimal separator of the OS is set to a comma, so to achieve the conversion I use the fractional string to number node with False constant connected to its input:
Works great!!!
Well ...not exactly
When I'm running this in the development environment then it works as expected, but it rounds to the nearest when running from an executable. We have a way to directly query the string reponse from the instrument and thats of course didnt change it always responds using dot as a separator.
So it seems working under labview but not under an exe.
Is there any known bug, or maybe something I dont understand with this operation I should know?
Thanks!
09-22-2023 07:52 AM
🤔 I can not confirm the behavior you see.
I compiled your code in an executable and receive the output you want. This is an german OS.Using LabVIEW 2022 Q3.
09-22-2023 08:52 AM
Thx for responding. Actually I did the same and it works fine in my mini app but not in the application we are working on.
Could be a classic "restart windows" issue which I can't do at the moment. I'll get back to this issue in Monday and update this topic with my findings.
09-22-2023 12:11 PM
I don't know why it wouldn't work the way you already try it, but if you want to try something else you could try switching to "Scan from string" instead, like so:
The percent-dot-semicolon at the start specifies the dot as the decimal separator to use. Percent-comma-semicolon forces the use of the comma.
09-22-2023 12:42 PM - edited 09-22-2023 01:26 PM
Do as Kyle suggested.
No OS specifica involved.
The instrument use a specified decimal point, you tell LabVIEW to use exactly the same.
Maybe use NaN as default value.