watch set - 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 set' command adds a trigger condition to all existing logpoints in the scope. Logpoints will update values only when the condition is valid.
The command is executed asynchronously. The possible responses are described here.

watch set --location <filepath>:<line> --callpath <cpFilepath>:<cpLine>,...

--location
The location where the trigger should be applied to. The location is specified by the ST file and line number. The location will be used to determine the scope (code-range) for which the condition will be applied.
The scope will be the equvilant to a program organization unit (Program, Method, Function, Function block). All logpoints within this scope will only update values if the set condition is fulfilled.
If the last logpoint in a scope gets removed, the trigger condition is also removed.

--callpath
Sets a trigger condition at the given location. The condition is a list of filepaths and linenumbers, seperated by commas.
Logpoints in this scope will generate values only if the POU items call stack is equal to the provided (concatenated) path.

Example:

watch add  src\helper\function.st:87 myVariable
watch set --location  src\helper\function.st:87 --callpath  src\main.st:24, src\caller.st:10

The logpoint in the function.st at line 87 will only print values to the command line when

  • the scope it is in is called from caller.st line 10 and
  • caller.st line 10 again has to be called from main.st line 24