[BUG-16490] Problem in Programmable Device Simmulator

Hi, I think there is a problem in Programmable Device Simulator, when I go to edit a program and I then save, float’s or double’s decimal part goes to the integer part and integer part are multiplied by 10 each time that I save. So if I edit or add one instruction and then save, all the others instructions are changed in this way.

Wild guess: are you in a locale that uses , as the decimal separator, and . as the thousands separator?

I’m not. I’m using “.” as the decimal separator. Are you tried what I said? I’m using Version: 8.0.11

I did - I can’t reproduce the issue. My guess was based on us doing some kind of number parsing on the backend; I’m not very familiar with how the programmable simulator works.

I made a new device simulator, edited the configuration, made a readonly(123.45) value source of type double. Then I saved the configuration, and went back to it - still 123.45. I added an integer readonly(123), saved the program, went back to it - both values are still the same.

I tried what you did.


I save and then try to edit. So, this is what I see.

Do you have any browser extensions? Do you get the same behavior in a private/incognito window? Or a different browser? Or a different computer/mobile device connecting to the same gateway? Basically - try to isolate whether this is something about your particular computer, or your particular gateway, or your particular browser.

It’s pretty inexplicable; it’s acting as if the decimal separator just doesn’t exist. The only way I could see that happening is some kind of locale-related confusion.

I tried all that you said. I’ve installed Ignition on other PC with the last version 8.0.12 and I keeping to have the same problem :man_facepalming:t5:

@Jorgeibesi,
Paul reached out to see if others could replicate this issue, and so far we have been unable to. See the following screen recording:

SimulatorRecording

To try and narrow down what is happening, can you answer the following questions?

  1. Does this happen when you make the change with the browser in Private mode?
  2. Does the same issue happen in a different browser?
  3. It looks like your browser is on a Mac, which version of MacOS are you using? What locale is set within the browser?
  4. What browser and browser version are you using?
  5. What OS is the Gateway on? What locale is set for the Gateway server?

Thanks,
Garth

Hi Garth, thanks for the answer.

  1. Yes, it happen.
  2. Yes, it happen.
  3. macOS High Sierra, Version 10.13.6. The Language is set in Spanish.
  4. I used chrome Version 81.0.4044.138 (Build oficial) (64 bits) and Safari Versión 12.1.2 (13607.3.10)
  5. I use the the Gatewat in mac and another gateway in windows. And I don’t know what do you mean about ‘what locale is set for the gateway server’. My region is spain.

I’ve tried to do the same in my iphone with both gateways and occurs the same.

Hi Jorgeibesi, if your region / locale is Spain, the standard is that folks would be using a “,” as a decimal separator, and a “.” as a thousands separator. Ignition is trying to respect the rules for the area of the world that your system says it’s in.

If you set your Value Source to “readonly(123,45)”, it will probably give you what you are looking for.

1 Like

Hi Kevin, thank you very mutch for the answer. But what about if I want to use several parameters in a function like sine(min, max, period, repeat)?

Good question! Back over to you @PGriffith

1 Like

I’m gonna log this is a bug. The locale shouldn’t be taken into account here.

1 Like

I think that this is not the problem. I tried to do what @Kevin.McClusky said and doesn’t work.
Here is the sequence when I only save the first configuration several times.

This seems to support what he said. The first save results in the “same” value, with a decimal separator instead, then the subsequent saves grow each time because the separator changed?

Perhaps, actually I don’t know. But then it is a bug because this don’t solved my problem.

We have it duplicated now. Any Gateway setup to use a region that uses anything other than a period for a decimal separator is going to have issues with the built in functions for the simulator unless you want to use integers. The bug Kevin H filed will ultimately address these issues, but I am not seeing a workaround at this point.

Garth

If I execute “system.util.getLocale()” in the script console, it print me ‘en’.

That’s the locale of the designer. The issue is the locale of the gateway. Consider changing your gateways to ‘en’ until the bug is fixed.