article

Paul Toone avatar image
0 Likes"
Paul Toone posted

Debugging Overview   

How It Works

Within the FlexSim code editor, there is a margin on the left side of the line numbers. By clicking in the margin, you can add a breakpoint to that line of code. The breakpoint will appear as a in the margin. You can delete the breakpoint by clicking the . When a line of code with a breakpoint is executed, FlexSim will enter debug mode. While debugging, you will only be able to interact with certain areas of the program including the debugger tools the tree window, output consoles and a limited number of other windows. The code window will change to give you tools for debugging.

The debug() Command

The debug() command can be placed in any flexscript code. It acts just like a breakpoint; it will pause the model and open the debug window when it is executed. However, it will pause the model even when breakpoint debugging is disabled.

This command makes it possible to have conditional breakpoints.

Controls

Next Line - The yellow arrow shows you what line will be executed next. By pushing the Next Line button, that line will be executed and the yellow arrow will move to the next line of code to be executed.

Step Into - This button can be used when a line of code contains certain function calls. It allows you to follow the code execution into the function and proceed line by line. When the function is finished, the debugger will return to the code that called the function. The only functions you can follow in this way are nodefunction, executefsnode, and any custom user commands.

Continue - This will cause the FlexScript execution to continue until it reaches another breakpoint. If the code currently being executed finishes, then it will leave debug mode.

Stop Simulation Clock - This button will stop the model's simulation clock. This is particularly useful if the model is running quickly, as the Continue button may cause FlexSim to re-enter debug mode almost instantly when it continues.



flexsim users manual
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Article

Contributors

paul.t contributed to this article

Navigation

FlexSim 2016.1