REAL tag in function - curious transformation

When I put a real tag into my Cicode function the value like 0.127 I see in Debugger Stack Windows 1.226999998 .

What is it ? I tried some real values and got the same result

The trouble is with only tag.

If I put a raw value  0.127 to the CiCode function I see 0.127 in Debugger ...

At the picture below you can see a simple CiCode wich shows the problem is in Citect, not in input pag .....

I noticed it on my input pad ...

Parents
  • >> Citect (and most software) stores floating point values in the IEEE 32-bit floating point number format

    Maybe you are right but how it looks from the user side: he want to input a value -> original mechanism for it is tool tip - unbelievable - do you know any SCADA with the similar extraordinary input method ? Many people when see Citect Runtime can't guess how to input - if we use touchscreen PC with Citect Runtime the input method wit tool tip is quest - we need use an object like inputPad (sime SCADA have OnScreen keyboard as page property - no forms, no programming, only one checkbox "OnScreen Keyboard") - I made custom InputPad, I try to debug, I set the tag to 1.2270 by init.ci and try to input a new value and what I see - 1.226999998092 instead 1.2270 . I very surprised. It looks like bug....
    Now I use "sInputValue = StrTrim(RealToStr(rInputValue, 20,6));" to get 1.2270 in CiCode ...
Reply
  • >> Citect (and most software) stores floating point values in the IEEE 32-bit floating point number format

    Maybe you are right but how it looks from the user side: he want to input a value -> original mechanism for it is tool tip - unbelievable - do you know any SCADA with the similar extraordinary input method ? Many people when see Citect Runtime can't guess how to input - if we use touchscreen PC with Citect Runtime the input method wit tool tip is quest - we need use an object like inputPad (sime SCADA have OnScreen keyboard as page property - no forms, no programming, only one checkbox "OnScreen Keyboard") - I made custom InputPad, I try to debug, I set the tag to 1.2270 by init.ci and try to input a new value and what I see - 1.226999998092 instead 1.2270 . I very surprised. It looks like bug....
    Now I use "sInputValue = StrTrim(RealToStr(rInputValue, 20,6));" to get 1.2270 in CiCode ...
Children
No Data