Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Error in simple division

jonathanD
2017-11-22
2017-11-22
  • jonathanD - 2017-11-22

    Hello,

    I have a simple division line, but the problem is that the variable does store the value of that division.
    I tried with a simple example: a := 100 / (600 -3437);
    But 'a' does not store the value, and shows 0.
    'a' is defined as REAL, also tried LREAL.

    Any suggestions about what the problem is?

    Best regards,
    Jonathan

     
  • josepmariarams - 2017-11-22

    A:=600.0/(123.0-2300.0)

    Use .0 after all numbers

     
  • jonathanD - 2017-11-22

    Thanks you!
    That worked.

     

Log in to post a comment.