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

Cyclic written REAL gets shifted value on RPi MC

onstage
2022-10-27
2022-10-27
  • onstage - 2022-10-27

    This is an input of another POU being cyclically written from the main POU.

    Does anybody have an idea of why the assigned and actual values differ?
    Different assigned value produces different delta.

    The only piece of code in the "another" POU that deals with this var looks like this:

    (Encoder handling)
    IF bInvertEncoder THEN
    nActPos:= (DWORD_TO_REAL(SHL(WORD_TO_DWORD (InEncoder[1]XOR 16#FFFF),16) OR InEncoder[0]XOR 16#FFFF)nEncScale)+nEncBias;
    ELSE
    nActPos:= (DWORD_TO_REAL(SHL(WORD_TO_DWORD (InEncoder[1]),16) OR InEncoder[0])
    nEncScale)+nEncBias;
    END_IF

    As I don't have access to any other hardware at the moment I cannot verify this, but I believe that this problem didn't exist prior to updating Runtime from 4.0.1.0 to 4.5.0.0 and IDE to V3.5 SP18 Patch 3.

    I've tried the obvious things, reboot of PC and target, origin reset of target. (Which is a RPi 4B with 32-bit OS)

     

    Related

    Talk.ru: 1

  • onstage - 2022-10-27

    Stuff learned every single day, thanks!

     

Log in to post a comment.