Setting breakpoints within code

Set at least one →breakpoint in the code or the logic. This procedure depends whether it is a code or a logic.

Restriction for a debugging session for the built-in PLC

Do not set a breakpoint onto a code line or for a FBD-logic that is run by several →tasks . This restriction results from malfunctions of the debugger, if several tasks are interrupted at the same time.

Setting breakpoint within C-code or ST-code

  1. Open the appropriate file or the appropriate object:

    File with C-code

    Double-click the file containing the C-code to open the file.
    The file lcxx___name.c contains the C-code for the element name as the name has been entered e.g. in the ST-code. xx is replaced by pu for a program, by fu for a function block or a function, by dt for a data type. Example: The file lcpu___counter.c contains the C-code as it has been created for the ST program Counter.

    File with ST-code

    Double-click the ST-object to open the ST-editor.

  2. Point to the border left of the code that is executed and for which you want to set a breakpoint.
    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg Examples for code that is executed: →assignments, →calls, IF statements
    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg Examples for code that is not executed: comments, declarations

  3. Open the context menu and select Toggle Breakpoint. Alternative: Double-click.
    Result: images/download/thumbnails/414779041/Breakpoint-version-1-modificationdate-1534421178399-api-v2.png is displayed at the border of the code.

Setting breakpoint within FBD-logic

  1. Open the FBD-object.

  2. Open the context menu for an FBD-element and select Toggle Breakpoint. See "Setting breakpoints for the calls of blocks and value fields" for details.
    Result: images/download/thumbnails/413893548/BreakpointFBD-version-1-modificationdate-1533821317957-api-v2.png is displayed for the FBD-element.

Disabling, enabling or skipping the set breakpoints

Good to know

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/lightbulb.svg You are able to disable and enable any set breakpoint at any time. images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg This is only possible, if the perspective Debug has already been opened.

Step

Result

  1. Select one or several breakpoints in the Breakpoints view.

  2. Open the context menu and select the command Disable.

images/download/thumbnails/414779046/BreakpointDisabled-version-1-modificationdate-1534421197927-api-v2.png is displayed at the border of the code. images/download/thumbnails/414778234/BreakpointFBDDisabled-version-1-modificationdate-1534243336932-api-v2.png is displayed for the FBD-element.
Disabled breakpoints will not affect the execution of the application.

  1. Select one or several breakpoints in the Breakpoints view.

  2. Open the context menu and select the command Enable.

images/download/thumbnails/414779041/Breakpoint-version-1-modificationdate-1534421178399-api-v2.png is displayed at the border of the code. images/download/thumbnails/413893548/BreakpointFBD-version-1-modificationdate-1533821317957-api-v2.png is displayed for the FBD-element.
An enabled breakpoint will cause the application to suspend whenever this breakpoint is hit.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/lightbulb.svg You are also able to skip all breakpoints in one go, if the perspective Debug has already been opened.

Step

Result

In the menu Run, select the command Skip All Breakpoints.
Alternative: Click the button images/download/thumbnails/414779051/SkipAllBreakpoints-version-1-modificationdate-1534421239275-api-v2.png (either within the main toolbar of logi.CAD 3 or within the toolbar of the Breakpoints view).

images/download/thumbnails/414779059/BreakpointSkipped-version-1-modificationdate-1534421314260-api-v2.png is displayed at the border of the code. images/download/thumbnails/414778243/BreakpointFBDSkipDisabled-version-1-modificationdate-1534243377375-api-v2.png or images/download/thumbnails/414778238/BreakpointFBDSkip-version-1-modificationdate-1534243357533-api-v2.png is displayed for the FBD-element.
Now all breakpoints will not affect the execution of the application.

If you want to have the breakpoints considered again, select the command Skip All Breakpoints anew or click the button images/download/thumbnails/414779051/SkipAllBreakpoints-version-1-modificationdate-1534421239275-api-v2.png again. Now the breakpoints are enabled or disabled – as the breakpoint has been before it has been skipped.