03-18-2011 03:53 AM
Ini_PutDouble() function stores a floating point value using the system decimal point symbol taken from the operation system.
The same happens reading a floating point value using Ini_GetDouble()
For these reason, if you write an ini file on an operating system that uses the dot "." as decimal point symbol, you have
value = 7.5
If you try to read this file on another PC (where the decimal point symbol is the comma ","), the function Ini_GetDouble() returns
Error -5023 - Invalid Floating Point Number
because the dot"." is not a valid character for a floating point value on this PC.
This issue is the source of a lot of problems, and in LabVIEW I found a solution using the boolean input "use system decimal point" of the Read/Write Key functions.
Is there a similar parameters in CVI?
03-18-2011 08:08 AM
I did some additional tests, and the situation is a little different.
If I change the locale to "C locale" (using setlocale(LC_ALL, "C")) the ini-related functions always use the dot "." as decimal separator (even if the OS uses the comma ","), and this is OK.
The problem happens when the double value in the ini file has the value "NaN". In this case, the Ini_GetDouble() returns with error -5023.
How can the special "NaN" valued be handled with ini files?
03-22-2011 08:38 AM
Hi Vix,
I guess that it is expected behaviour that the Ini_GetDouble function returns error -5023 reading a NaN value (see the Return Value section of the Help).
You could simply filter that error. But why do you have NaN values in the ini file?
Serena