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

EATON XV-302 SoftPLC problem

joan-d
2022-09-30
2022-09-30
  • joan-d - 2022-09-30

    Hi, I'm trying to implement a combinatorial algorithm on an EATON XV-302.

    In the codesys simulator for the device the program works fine, with the function TIME() I found out it takes around 10-20ms to execute the function that contains the algorithm. However, the SoftPLC on the device will work until it reaches the function and then crash shortly afterwards. I've tried to reduce the number of combinations and thus reducing the computation effort as well, this has worked and the program stopped crashing, so I suspect there isn't anything inherently wrong with the program, rather an execution time problem.

    I've tried increasing the cycle time and even tried creating a second task with lower priority and triggered via status where the function is called, with no time limit, but the problem persists. Since the program compiles just fine and the PLC crashes I get no error reports, and thus I can't find what could be causing the SoftPLC to crash.

    Any help is appreciated.

    I attached a picture of the main chunk of the algorithm. The first for loop runs for 40 iterations, the second for cycles up to 8000 times, so that code in between is executed around 300k times.

     
  • joan-d - 2022-09-30

    UPDATE: The program now works on the device, but only if I move the code from a function (FUN) and execute it directly on the program (PRG), after initializing all variables to 0. Not sure why the same code won't execute inside a function but will work fine in a program.
    If anyone has any idea on why this could be happening please let me know.

     

Log in to post a comment.