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

REAL in Codesys

mesc
2012-08-14
2012-08-18
  • mesc - 2012-08-14

    Wie wird ein REAL Wert in Codesys interpretiert?
    Ich hΓ€tte erwartet, es ist ein Float. Dann wΓΌrde der Wert 0xBD3A38BF -4.546E-2 entsprechen:
    http://www.binaryconvert.com/result_float.html?hexadecimal=BD3A38BF
    Aber Codesys rechnet die Bytes ganz anders um:

    in Codesys wird daraus der Wert: 9.930815e+008 resp. '993081500.0'
    Die Variable 'yaw' ist als REAL deklariert, %ID68 kommt aus einem eds File und es wird auch als REAL angegeben...

    Kann mir jemand weiterhelfen?
    Danke

    IMG: REAL.PNG

     
  • J Schohaus - 2012-08-15

    Hallo mesc

    Real in Codesys sind Float.
    Leg deine Variable yaw mit AT auf die Adresse %ID68
    Dann kannst du dein Wert umwandel von RAL_TO_STRING

    mfG Jochen

     
  • gravieren - 2012-08-18

    Hi

    J Schohaus hat geschrieben:
    Dann kannst du dein Wert umwandel von RAL_TO_STRING

    REAL_TO_STRING

    Gruß Karl

     

Log in to post a comment.