Skip to main content

Monitoring and Detecting Errors

In online mode, the editor provides value monitoring and supports the writing and forcing of current values. You can set breakpoints, and the color-coded representation of the connections allows for a kind of flow control.

Monitoring:

In online mode, the actual value of each variable is displayed in the editor for the variable. Constant variables get a green C symbol. The display of the values is defined in the CODESYS options in the Ladder editor (LD2) category.

Writing and forcing of values:

When a variable is currently forced, this is indicated directly before the forced value by the _cds_icon_forced_variable.png symbol. If a value has been prepared for writing or forcing, then this value is displayed directly after the actual value in angled brackets <value>.

Example 1. Examples

Forced variable

_ld_img_forced_variable.png

Prepared value

_ld_prepared_values.png

Constant value

_ld_img_constant_value.png


Color-coded representation of connections:

In the online view of a ladder diagram, the connecting lines are displayed in color: connections with the value TRUE are indicated by a thick blue line and connections with the value FALSE by a thick black line. In contrast, connections with an unknown or analog value are displayed normally as a thin black line.

Important

The value of the connections is not read from the monitored variables, but calculated in the programming system. This is not a genuine flow control.

Example 2. Example: Connecting lines and breakpoint positions
_ld_img_breakpoint_positions.png


Breakpoints:

Breakpoints are basically possible at positions where the values of variables can change (instructions), where the program branches, or where another POU is called.

In the editor, possible breakpoint positions are indicated by an empty gray circle. Set breakpoints are displayed as a solid red circle. See the figure above: "Example: Connecting lines and breakpoint positions" .

Possible breakpoint positions:

  • On a callable POU (function block, function, program, action, method). Not possible with operator blocks (example: ADD, DIV)

  • On assignments

  • Before parallel branches

  • At the end of the block at the position of the return to the calling block

    NOTE: CURRENTLY NOT YET IMPLEMENTED. In online mode, an empty network automatically opens here. It is indicated by RET in place of a network number.

  • On EN input and ENO output of a block

  • On the entire network

    Indicates only that a breakpoint is set in the network. No breakpoint can be set on the entire network.

Important

Breakpoints in methods: CODESYS automatically sets a breakpoint in all methods which can be called. Therefore, if a method managed by an interface is called, then breakpoints are set in all methods which occur in function blocks that implement this interface as well as in all derived function blocks that use the method. If a method is called by a pointer to a function block, then CODESYS sets the breakpoints in the method of the function block and in all derived function blocks that use the method.