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?
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
THANK YOU!
I spent all day yesterday trying to figure this out.
Tim