watch add - Manual - Structured Text Debugger - The SIMATIC Debugger. Enables debugging source code on the PLC and is needed to run the debugger extension. - Debugger (sdb),tool

Structured Text Debugger CLI Tool (sdb)

Portfolio
SIMATIC AX
Product
Structured Text Debugger
Software version
1.3.6
Edition
11/2024
Language
English (original)
Package Name
@ax/sdb

The 'watch add' command creates a logpoint and observes variables at a specific code location. The location can be specified by providing the file and line. The values returned from a logpoint are always retrieved before the execution of the selected \<line> or \<function>.
The command is executed asynchronously. The possible responses are described here.

watch add <filepath>:<line>[:<checksum>] <variables>

\<filepath>
The path to the ST file in which a location is to be debugged. When using a relational path, the debugger will try to find the right file.

\<line>
The line number in the file specified with 'filepath'. The first line in a file is always 1.

\<checksum>
optional
The MD5 checksum of the source file. You will need ST Compiler v2.x or later for this to work. The "watch add" command will fail if the checksum does not match the checksum from the debug information.

\<variables>
A list of variables to debug, separated by semicolons. The variables can be either symbolic or absolute addresses. For example, 'watch add myFunction var1;var2;%IW0\:int'. The values displayed on executing this command are retrieved before the line specified in the 'line' parameter is executed.
When monitoring an array, the array is shown with all indices available according to the byte-alignment made by ST Compiler. For further information regarding the alignment of data types, see Types and Variables.