-

WATCHES: Monitoring/Debugging the Application

Note
This topic only applies to the standard (non-safety-related) controller. The steps for the Safety PLC are described in the help chapter "Safety PLC Commissioning: From Compiling to Debugging ‣ Safety PLC Commissioning: From Compiling to Debugging
×‣ Connecting vs. Monitoring Mode vs. Debug Mode
×‣ Safety Cockpit: Controlling the Safety Application
×‣ Safety PLC Diagnostics out of the Safety Cockpit
×‣ Monitoring/Debugging the Safety PLC
×‣ Monitoring Mode: Displaying Online Values
×‣ Debugging Safety-Related Code: Forcing/Overwriting
×‣ WATCHES: Monitoring/Debugging the Safety-Related Application
×‣ Safety PLC Simulation
×
".

The WATCHES window can be used while PLCnext Engineer runs in debug mode. Here, you can collect variables to monitor their online values while the application is executed. This makes it unnecessary to open the individual code worksheets containing the variables to be monitored. Within the WATCHES window, forcing/overwriting of variables is possible.

Several independent watch lists can be defined. Each list can be saved and loaded. Furthermore, it is possible to read the current online value of list elements from the controller and use them as 'Set Value'.

The WATCHES window configuration (list of variables, number of watch lists etc.) is saved within the current PLCnext Engineer project and available when you load the project again.

The WATCHES window is located in the Cross Function Area at the lower screen border. You can hide/show the window by clicking the WATCHES window button on the Cross Function Area toolbar.

Note
The update rate of online values depends on the set 'Polling interval' which is specified in the 'Options' dialog. The higher the interval value, the less data is transferred in the background between PLCnext Engineer and the controller, i.e., the longer the time until the next online value update in online worksheets, the WATCHES window, and the LOGIC ANALYZER.
Therefore set the interval value as short as the Internet connection allows. See topic "TCP Communication Connection".

This topic contains the following sections:

Several independent watch lists

The WATCHES window provides the possibility to define up to 10 different watch lists where each list is placed in its own tab. Using the '+' icon, you can add a new watch list.

Each watch list is handled separately, i.e., the commands in the window toolbar and context menu relate to the active tab. The same applies when adding an element from a variable grid or the code via context menu.

Watch lists can be renamed and deleted via the context menu of the tab name. You change their order by dragging & dropping them.
The content of each list can be saved to and loaded from a file.

The watch lists are saved within in the PLCnext Engineer project and available when you load the project again.

Adding variables/ports to WATCHES

Note
The variables and ports added to the WATCHES window are saved within in the PLCnext Engineer project and available when you load the project again.

Variables/ports can only be added to the WATCHES window while PLCnext Engineer runs in debug mode. Adding is possible from the following editors in online mode:

You have two possibilities of adding variables:

Special cases

Special case: adding STRUCT or ARRAY variables

Special case: SFC code

A variable/port can only be added once to each watch list. Newly added variables/ports are always added at the end of a list.

Copying an element into another watch list

The WATCHES window content is saved locally on your computer when saving the project. This means that the watch list is restored in the WATCHES window when re-opening a project.

In addition, the content of each list can be saved to and loaded from an file.

Possible commands for the added elements

After adding elements to a watch list, you have the following possibilities (each of them applied to only one, several or all variables in a list):

Saving and loading watch lists

Note
The WATCHES window configuration (list of variables, number of watch lists etc.) is saved within the current PLCnext Engineer project and available when you load the project again.

Saving the whole contents of the active watch list to a file (*.wwr) makes it possible to "back up" a particular application state. Watch list files can be reloaded.

A *.wwr file has ASCII format with one line for each added variable. You can edit these values using a default text editor. As each line contains an automatically generated ID (supplemented by the instance path of the POU where the variable is used), it is not possible to manually insert new variables in a text editor.

How to save a watch list to a file

How to load a watch list file

Content of a watch list

Each watch list (tab) of the WATCHES window shows the following information for each inserted variable:

ColumnMeaning
NameVariable/Port name: in case of a function/function block input/output, the name is composed of the function/FB instance name and the input/output name separated by a dot. Example: P_GEN_1.Q.
ValueCurrent online value of the element. This is the value of the element between two task execution cycles.

The value can be edited and written to the controller as force or overwrite value (context menu command 'Overwrite/Force' or toolbar button ).

Forced values are shown in the following color gradients:

  Value forced to TRUE
  Value forced to FALSE
Set ValueThe values in this column can be read from the controller and kept as predefined values. The toolbar button fills the 'Set Value' in the entire active watch list. To fill only particular rows, mark them in the list and select the context menu command 'Fill selected Set Values'. (Multiselection of elements is possible by holding the <Ctrl> or <Shift> key down while left-clicking the rows.)

The Set Values can be used to overwrite the variables on the controller. The toolbar button writes the Set Values of the entire active watch list. To overwrite only particular variables, mark them in the list and select the context menu command 'Overwrite with selected Set Values' (multiselection as described above).
Data typeData type of the variable/port.
InstanceLocation where the variable is used, including the unique instance path.

Commands in the WATCHES window

Toolbar buttonContext menu commandShortcutDescription
--Removes all display formats invidually set for the elements and displays the values of the elements in their default format.

The command is only available if at least one element has a manually set display format.

See the section "Setting the display mode" in the topic "WATCHES: Monitoring/Debugging the Application" for details.
--Loads a saved *.wwr file and adds its content in a new watch list tab.
Overwrite/Force
(inside list)
<Ctrl> + <Alt> + <2>Overwrites or forces the selected element with the value entered in the 'Value' column.

The command is only available if one element is selected in the list.

Forced values are shown with a color gradient (see list above).

For detailed information on overwriting using the WATCHES window, see the topic "Debugging Code: Forcing/Overwriting".
Unforce Selected Variables
(inside list)
<Ctrl> + <Alt> + <3>Resets the forced value to the actual value. Only active if at least one forced variable is selected in the list.
--Loads the current value of all elements in the list from the controller and enters them into the 'Set Value' column.
-Fill selected Set Values
(inside list)
<Ctrl> + <Alt> + <4>Loads the current value of the elements selected in the list from the controller and enters them into the 'Set Value' column.
--Uses the value in the 'Set Value' column to overwrite all elements in the list on the controller.
-Overwrite with selected Set Values
(inside list)
<Ctrl> + <Alt> + <5>Uses the value in the 'Set Value' column to overwrite the elements selected in the list on the controller.
Save watch list
(on list tab)
-Saves the active watch list in a *.wwr file on disk or network drive.
See section "Saving and loading watch lists" for details.
-Load watch list
(on list tab)
-Loads the content of a *.wwr file into the active watch list.
See section "Saving and loading watch lists" for details.
-Rename
(on list tab)
-Allows to edit the watch list name.
-Delete
(on list tab)
-Deletes the watch list.
-Select All
(inside list)
<Ctrl> + <A>Selects all elements in the watch list .
-Collapse
(inside list)
-Collapses an expanded user-defined element, such as STRUCT or ARRAY.
-Delete
(inside list)
<Del>Removes the selected element from the watch list.

Multiselection is possible, by using the 'Select All' context menu item or by selecting individual variables while holding the <Ctrl> key down while left-clicking.

Setting the display mode

Some data types provide different possibilities of displaying their online values. To adapt the display, double-click the value of the variable. (Alternatively, right-click the variable and select 'Overwrite / Force' from the context menu or left-click the table line and press the shortcut <Ctrl> + <Alt> + <2>.) In the appearing Overwrite/Force control, click the drop-down arrow on the right and select the desired display format.

Note
Independently of the WATCHES display mode, the displayed format of online variables in debug mode can be set via the 'Extras > Options' menu item. In the 'Options' dialog, select the category 'Options | Online Values' and specify the number of visible digits. See section "Setting the online representation (format) of variables" for details.

Display modeavailable forMeaning
Textual (True / False)Boolean variablesDisplays the value TRUE or FALSE with different background colors.
LabelBoolean variables with defined pragmaDisplays the pragma label defined for the variable values TRUE/FALSE.
Label HighlightedBoolean variables with defined pragmaCombines the displays of the pragma label defined for the variable values TRUE/FALSE with the background colors for TRUE or FALSE.
LEDANY_BIT variables including BOOLDisplays an LED symbol instead of value or label:
FALSE = and TRUE =

In case of ANY_BIT variables > BOOL, one LED is shown per digit.
Example for a BYTE variable:

HexadecimalANY_BIT variables except BOOLDisplays the ANY_BIT variable as hexadecimal value with the prefix 16#.
DecimalANY_BIT variables except BOOL and ANY_REALDisplays the ANY_BIT variable as decimal value.
BinaryANY_BIT variables except BOOLDisplays the ANY_BIT variable as bit string with the prefix 2#.
Example for a BYTE variable:
ExponentialANY_REAL variablesDisplays the value in exponential representation.
Example for an LREAL variable:

The set display mode is stored in the project with the WATCHES list.

Note
You can remove all display formats individually set for the variables in the WATCHES list by clicking the 'Remove set formatters' button on the toolbar in the window.

Note
You can remove all display formats individually set for online variables in the project via the 'Extras > Options' dialog. In the category 'Online | Online Values', press the 'Reset' button under the 'Reset all formatters of current project' group to reset the format.