Strange Behavior on Raspberry Pi

2024-06-18
2024-06-18
  • timothyzalusky - 2024-06-18

    Hello, I am seeing some weird runtime behavior related to the EQ function on a rapsberry pi based system.

    I have attached a screenshot showing the strange latching I am seeing on the EQ function, and I have not seen this behavior before. I tried freshly restarting the runtime and it has this same behavior. Anyone seen this? I am on 3.5.20 with the latest runtime installed.

    Basically, as soon as it hits one of those EQ's in the program, it latches effectively locking the output on.

    Any input from the Codesys team would be appreciated as well as anyone that might know what I am seeing.

     
    • rmaas - 2024-06-18

      Hello, what you are seeing is not strange behavior. The problem is that everyting is happening in the same program cycle.

      After the variable Stepnumber is changed from 10 to 20 for example then you want the program to wait with the next EQ until the next program cycle. Else every EQ will be be true because in every line the variable Stepnumber is increased. When the program arrives (still in the same cycle) at the line with the timer, the Stepnumber has been increased to 30 in the meantime and the timer will allway be ON because even though the variable is written to 10 in this line in the next cycle it starts with 10 and will be 30 again before reaching the timer in line 8.

      Not very good at explaining stuff but i hope you get the problem.

      See screenshot below for an example of one way you could solve this...

       

Log in to post a comment.