Join us today!

Finding the complet...
 
Notifications
Clear all

Finding the complete call path in TwinCAT - Call Stack Window

1 Posts
1 Users
0 Reactions
611 Views
TwinControls
Posts: 71
Admin
Topic starter
(@beckhoffsupport)
Member
Joined: 2 years ago

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. 

breakpoints

 

Once the program reaches to a breakpoint, open the call stack window.

callstack

 

Now you can see the complete path before reaching to the breakpoint. 

checkboundscallstack

 

We can see that line 3 in FB_FillArray function block is causing lower array index issue. 

lowerindex

 

Reply
Share: