In online mode, the structured text editor (ST editor) provides views for monitoring, and for writing, and forcing the variables and expressions on the controller. Debugging (breakpoints, stepping, and so on) is available. See Breakpoint positions in ST Editor.
oFor information on how to open objects in online mode, refer to the description of the user interface in online mode.
oFor information on how to enter prepared values for variables in online mode, see Forcing of variables.
oThe editor window of an ST object also includes the declaration editor in the upper part. For information on the declaration editor in online mode, see Declaration Editor in Online Mode.
If the monitoring is not explicitly deactivated in the Options dialog box, small monitoring boxes will be displayed behind each variable showing the actual value.
Online view of a program object PLC_PRG with monitoring:
In addition to the possibility to enter a prepared value for a variable within the declaration of any editor, the ST editor offers double-clicking the monitoring box of a variable within the implementation part (in online mode). Enter the prepared value in the rising dialog box.
Dialog box Prepare Value
You find the name of the variable completed by its path within the Devices Tree (Expression), its type, and current value.
By activating the corresponding item, you can choose the following options:
opreparing a new value which has to be entered in the edit field
oremoving a prepared value
oreleasing the variable that is being forced
oreleasing the variable that is being forced and resetting it to the value it was assigned before forcing
To carry out the selected action, execute the command Debug > Force values (item Online) or press the F7 key.
Breakpoint Positions in ST Editor
You can set a breakpoint basically at the positions in a POU where values of variables can change or where the program flow branches out or another POU is called. In the following descriptions, {BP} indicates a possible breakpoint position.
Assignment:
At the beginning of the line. Keep in mind that assignments as expressions define no further breakpoint positions within a line.
FOR-loop:
1.before the initialization of the counter
2.before the test of the counter
3.before a statement
{BP} FOR i := 12 TO {BP} x {BP} BY 1 DO
{BP} [statement1]
...
{BP} [statementn-2]
END_FOR
WHILE-loop:
1.before checking the condition
2.before an instruction
{BP} WHILE i < 12 DO
{BP} [statement1]
...
{BP} [statementn-1]
END_WHILE
REPEAT-loop:
obefore checking the condition
REPEAT
{BP} [statement1]
...
{BP} [statementn-1]
{BP} UNTIL i >= 12
END_REPEAT
Call of a program or a function block:
At the beginning of the line.
{{BP} POU( );
At the end of a POU:
When stepping through, this position will also be reached after a RETURN instruction.
Breakpoint display in ST
Breakpoint in Online Mode |
Disabled Breakpoint |
Program Stop at Breakpoint |
---|---|---|
|
|
|
NOTE: A breakpoint will be set automatically in all methods which may be called. If an interface-managed method is called, breakpoints will be set in all methods of function blocks implementing that interface and in all derivative function blocks subscribing the method. If a method is called via a pointer on a function block, breakpoints will be set in the method of the function block and in all derivative function blocks which are subscribing to the method.