Monitoring in Programming Objects

Requirement: An application is loaded and started on the PLC. In the CODESYS Development System, you want to use the POU editors for monitoring the current values that have the variables on the PLC.

  1. Make sure that the Enable inline monitoring option is selected in Tools ‣ Options (category Text Editor - Monitoring).

  2. Click Debug ‣ Display Mode ‣ Decimal to set the display format of the values.

  3. Click the POU in the Devices or POUs view to display the variable values in the declaration and implementation parts. The following sections include general descriptions, as well as features depending on the type of POU and programming editor.

Monitoring in the declaration editor

The current variable value is shown in the Value column (3). You can write and force a value in the Prepared value (4) column. A red forced symbol ( 73d1abe86e9b7ec4c0a8640e00062d91_1be3410320a9f660c0a8640e008f7a40 ) is prepended to forced values.

../_images/c6ae89f1093b097cc0a8640e00a7c956

If the expression is an array, then you can double-click the Data Type column to open a dialog for defining the range of the array index to monitor.

If the expression is an interface reference, then it can be expanded. If the interface points to a global instance, then this global instance is displayed as the first entry below the reference. If the interface reference changes, then the displayed reference is collapsed.

See also

Monitoring in the implementation part (inline monitoring)

Inline monitoring is the display of variable values in the implementation part. Depending on the implementation language, the following displays are possible:

  • A small rectangle after the variables or in its own column (IL tabular editor): 73d1abe86e9b7ec4c0a8640e00062d91_49ce43dd67a213d0c0a8640e01d73fdf .
  • In network editors and CFC, the color of the connecting lines (in the LD editor, the fill color of the contact or coil element) indicates the current Boolean value: blue for TRUE, black for FALSE.
  • SFC editor: Transitions with TRUE and active steps are filled blue.

For forcing and writing, prepared values are added in angle brackets to the inline monitoring view next to the current variable value In the LD editor, the current prepared value (TRUE or FALSE) is shown for contacts and coils in a small view next to the element.

Forced values are prepended with a red forced symbol ( 73d1abe86e9b7ec4c0a8640e00062d91_1be3410320a9f660c0a8640e008f7a40 ), as in the declaration editor. Note: In the implementation part of the SFC editor, only forced transaction values can be marked by a red fill in the transition element.

See below for monitoring values of functions and properties.

Monitoring in the ST editor

../_images/83e6dd4561dee4a2c0a8640e014320ca

Monitoring in the LD editor

../_images/5cb22afa6773a1acc0a8640e0079ec6d

Monitoring in the SFC editor

../_images/e65c1cde678e282ac0a8640e01275244

Note

You deactivate the inline monitoring function in Tools ‣ Options (category Text editor / Monitoring).

See also

Monitoring for function block variables

When you open the editor view for a function block in online mode, you are prompted whether to open the view of the base implementation or of a block instance. In the base implementation, monitoring is possible only when a breakpoint is set. If you set a breakpoint in the base implementation, then it is set for all instances. In the base implementation view, the values are displayed first for the instance that is processed first in the program flow.

See also

Monitoring for return values from functions

In a function POU, the current variable values are displayed only when a breakpoint is set.

In the ST editor, the current return value of the function is displayed in inline monitoring at the position in the POU where a function was called when the following conditions are met:

  • The value can be interpreted as a 4-byte numeric value (for example, INT, SHORT, or LONG).
  • The {attribute 'monitoring' := 'call'} attribute is inserted in the function declaration.

See also

Monitoring for property variables

When you insert either the {attribute 'monitoring' = 'variable'} attribute or {attribute 'monitoring' = 'call'} attribute into the properties declaration, you can monitor variables in properties that belong to a function block

See also