4 Replies Latest reply on Aug 1, 2018 12:34 AM by DawidG

    Why don't I get the exact value back from a PIPoint that I saved?

    DawidG

      I have run a couple of tests and the tests always fail.

       

      Using the AF SDK, I send PIPoint data, then read them back immediately as a test. The retrieved values are never exactly the same, off by a very small margin.

       

      Examples:

      Name

      Value

      Type

      Original testValue

      15.26

      double

      val.ValueAsDouble() read from PI

      15.260000228881836

      double

       

      And again

       

      Name

      Value

      Type

      testValue

      39.07

      double

      val.ValueAsDouble()

      39.069999694824219

      double

       

      And again

       

      Name

      Value

      Type

      testValue

      44.19

      double

      val.ValueAsDouble()

      44.189998626708984

      double

       

      This is the code that sends the data:

      this.piServer.UpdateValues(

      valuesToWrite,

      config.AFUpdateOption,

      AFBufferOption.DoNotBuffer);

       

      NameValueType
      valuesToWrite[0].ValueAsDouble()12.34double

       

      After reading it from PI, the value is

      NameValueType
      val.ValueAsDouble()12.340000152587891double