LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV numerical results differ for country/region

Solved!
Go to solution

Hi there,

 

Customers using exe in Europe have reported they are receiving NaN results for numerical calculations (pure mathmatical floating point operations with some use of LV optimisation VIs such as LM).

 

When I perform the same calculations using the same exe I don't get NaN.

 

What could possibly be the problem?  Any help is appreciated.

 

Customers using W7 64 bit and developed in LV 2013.

0 Kudos
Message 1 of 7
(2,639 Views)

It's possible there's some decimal point separator mismatch.

 

Are you reading data from text files?


Regards,

Marco

Message 2 of 7
(2,636 Views)

Yes, XML files.

 

Is there a work-around?

 

I know in Europe they use comma (,) for decimal point.

 

Can the PC be set to use conventional . dot for decimal point?

0 Kudos
Message 3 of 7
(2,633 Views)
Solution
Accepted by topic author battler.

I found this:

 

http://www.copsmodels.com/gpcommapnt.htm

 

Fortunately there is a very simple fix. Suppose Windows 7 is configured to use Finnish conventions (including decimal comma), but ViewHAR is (wrongly) using decimal point.

  1. Open Regional and Language Options
  2. Under "Format" pick another regional setting (eg: English (United States)).
  3. Press "Apply"
  4. Under "Format" pick your original desired locale (ie: Finnish)).
  5. Press OK.

and the problem will be permanently fixed (just changing to something else, then back to your desired setting, reminds Windows 7 how it should behave).

0 Kudos
Message 4 of 7
(2,628 Views)

You can also tell Labview to use localized decimal point separator when converting from string:

 

http://digital.ni.com/public.nsf/allkb/4B259A9CF98AD4628625697E00548EA0

 

 

Marco

Message 5 of 7
(2,611 Views)

I do not recall which ones off the top of my head, but I think there are some functions (Spreadsheet String to Array?) which do not work with comma decimal points regardless of settings.

 

Lynn

0 Kudos
Message 6 of 7
(2,581 Views)

Hi Lynn,

 

SpreadsheetStringToArray accepts (and obeys) format strings including "%.;"/"%,;".

Problems appear when parsing/formatting timestamps, where parts of seconds always expects/uses a point as decimal separator:

check.png

This snippet will produce an error message. It will work fine when using a point (instead of comma) between 6 and 7…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(2,569 Views)