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

NaNs don't work in the simulator

Yegor
2015-11-30
2015-12-11
  • Yegor - 2015-11-30

    The CoDeSys 2.3 sim and PLCWinNT don't seem aware of the not-a-number type. Attached to this post (in reverse order, apparently) are a few screenshots demonstrating the improper handling of NaNs by the simulator and PLCWinNT.

    Use the following code to reproduce the results:

    PROGRAM PLC_PRG
    VAR
    Β  Β  bin: UDINT := 2#0111_1111_1000_0000_0000_0000_0000_0001;
    Β  Β  nan: POINTER TO REAL;
    Β  Β  equ: BOOL;
    END_VAR
    nan := ADR(bin);
    equ := nan^ = nan^;
    

    IMG: div_zero_sim.png

    IMG: div_zero_plc.png

    IMG: nan_vs.png

    IMG: nan_sim.png

    IMG: nan_plc.png

     
  • Rapucha - 2015-12-02

    2.3.9.40 build has Apr 16 2013 date. I will be surprised with any fixes ((

    Are you developing a test suite for a CoDeSys compiler?

    PS
    I was wrong, 2.3.9.49 is available for download now. Have you tried it?

     
  • Yegor - 2015-12-07

    It seems I've forgotten my download area credentials (did I ever have them? there's no link to try to restore the password), so the most recent version I have is 2.3.9.41 and the misbehavior can be reproduced in it.>Zitat:
    Are you developing a test suite for a CoDeSys compiler?
    Nah, that sounds like a 3S developers' job. I'm just poking this creature with a pointy stick for fun. And I think in this particular case the runtime is to blame, not the compiler. It'd be nice to have NaNs consistently and reliably supported.

     
  • shooter - 2015-12-11

    so what is the definition of a NaN.
    so poking is not always giving an answer.

     

Log in to post a comment.