Join us today!
Finding the complete call path in TwinCAT - Call Stack Window
Call stack window enables you to see the entire call path of the currently reached point in your PLC program. This tool comes in very handy when debugging an issue.
Let's assume that somewhere in your program, you are having an array index boundary issue and you are already using CheckBounds implicit POU which is helping PLC program not to throw an exception. Since you have hundreds of function blocks in the program, you have no clue from which point this issue is coming. You can setup breakpoints in CheckBounds function and once the program reaches to those breakpoints, you can use the Call Stack Window to track the entire call path to get to that breakpoint.
I have created a function block and inside this function block I have an array input with boundaries from 1 to 5. In the for loop, I have started the indexing variable from zero on purpose to demonstrate usage of Call Stack Window.
Setup breakpoints in the Checkbounds and run your program.
Once the program reaches to a breakpoint, open the call stack window.
Now you can see the complete path before reaching to the breakpoint.
We can see that line 3 in FB_FillArray function block is causing lower array index issue.
In case you want to say thank you !)
We'd be very grateful if you could share this community with your colleagues and friends. You can also buy us a coffee to keep us fueled 😊 This is the best way to say thank you to this project and support your community.
twinControls - https://twincontrols.com/
- 17 Forums
- 267 Topics
- 924 Posts
- 2 Online
- 737 Members