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

exception after all code has been scanned

tvm
2020-02-12
2020-02-13
  • tvm - 2020-02-12

    I have an application which is causing an access violation exception. I can reproduce the exception, but I can't figure out what line of code is causing it. I get the following log messages:
    EXCEPTION [AccessViolation] occurred: App=[Application], Task=[MAST]
    SOURCEPOSITION App][Application] area=0, offset=0

    I've set breakpoints all throughout the code, to stop the scan before the exception occurs, but when I start to step through it to see where the problem is, I can step all the way to the end of my code, right down to the last line of the last function block of the last program in MAST, and still not trigger the exception. I then set a breakpoint at the first line of the first function block in the first program in MAST. The exception occurs before it hits that breakpoint. So it appears to be happening after all my code has been scanned, before the next scan.
    I've disabled all my I/O, visualizations, and Symbol Configuration, with the same results.

    I set MAST up on a 30 second cycle so I could try to isolate whether it was happening at the beginning or the end of the scan. It is definitely happening after the end of a scan, not before the beginning of the next scan.

    What else happens after the code has been scanned?

    using:
    Schneider Machine Expert v1.1 SP1 (Codesys 3.5.12.80)
    Schneider M241 PLC

    thanks

    Tim

     
  • eschwellinger

    eschwellinger - 2020-02-13

    Hi Tim,

    I would recommend to start with the 'checkbounds' implicit check (maybe you've done this already?!)

    https://faq.codesys.com/pages/viewpage. ... Id=3538982
    As long you see no valid address in the exception, this seems a crash in the runtime not in the iec code.
    So if checkbounds does not lead to a result I fear you need the plc manufaturer to investigate.
    Sure removing code parts should help to to find the reason of the exception.

    BR
    Edwin

     
  • tvm - 2020-02-13

    THANK YOU!

    I spent all day yesterday trying to figure this out.

    Tim

     

Log in to post a comment.