Debugging Blocks

You can use the debugger to check the behavior of a LCM block and/or running the application.

The main functionalities are:


  • Executing a simulation continuously or step by step.

  • Reading and writing the values and states of any port or signal.

  • Adding breakpoints to pause the simulation at a specific step or if a port or a signal is emitted.

  • Plotting any port or signal value (the plotting command is only available with the CATIA System license).


Before you begin: The Block Editor workbench should be opened.
  1. Edit a Logic representation. See a typical example below.

    This program is a simple counter. The main block calls the instance of the counter block. The input Activate triggers the run of the counter. The input Reset resets the counter's value to zero.



  2. Click Debug and select the block you want to simulate in the logic tree (Main Block in our example).

    The program is compiled and the simulation toolbars and windows appear:


    Logics Monitoring displays the content of the block.

    Note: Zoom and Pan commands are available in this window.



    Signals Monitoring displays the tree structure of the block and its instances.



  3. Click in the Signals Monitoring to display the structure of the nodes Ports and Instances.



  4. In the Logics Monitoring window, double-click the block Counter Instance to display its reference.

    A new tab is added to the Logics Monitoring window.



    Note: You cannot open the blocks +, Delay and 1 because they are pre-defined blocks. Only user-defined blocks can be viewed in the Logics Monitoring window.

  5. In the Signals Monitoring window, force the value of the Activate input to true and press Return.



  6. Click Play Step Forward in the Simulation Player toolbar.

    One step is computed. The step number is set to 1 in the Simulation Player toolbar.

    The block + is activated by the true value of the Activate input.

    The inputs of the + block are:


    • the constant 1

    • the output value of the block the step before (Delay block). As it is the first step, the default output value 0 is used.



    The first step, the output value is 1.



  7. Click Play Step Forward again in the Simulation Player toolbar. The output Counter is incremented.

  8. Right-click the Reset row in the Signals Monitoring window and select Insert 'Reset' to > WatchList 1.

  9. Repeat the previous step and add Counter in Watch List 1.

  10. Switch to the Watch List 1 tab, Reset and Counter appears in the list.

  11. Click Play Forward in the Simulation Player toolbar. The value of Counter is incremented continuously.



  12. Click Pause.

  13. In the Simulation Player toolbar, enter a step number (greater than the current one displayed) and press Enter.

    The simulation is executed until the step number is reached. Meanwhile, the Signals and Logics Monitoring windows are not updated.

  14. Click the commands of the Simulation Tools toolbar to hide the Logics Monitoring window.

  15. Click Play Forward in the Simulation Player toolbar.

  16. In the Signals Monitoring window, right-click the Counter row and select Plot 'Counter'.

    Important: The command Plot is only available with the CATIA System license.

    The Plot window appears. The vertical axis is the value of port, the horizontal axis is the virtual time (a simulation step matches 100ms).

    The axis are automatically redrawn to fit the graph.

    Zoom and Pan commands are available in this window.



  17. Click Close.

  18. Click Pause in the Simulation Player toolbar.

  19. Click Jump To Begin in the Simulation Player toolbar.

    The step number is set to 0. All the ports values are reset.

  20. Click Debug to stop the simulation.

Tip: You can also use the Play of the compass to launch a debug session. The features are similar except that the Simulation Player toolbar is replaced by the control bar above the compass.