Skip to main content

Work area

Every structured text file is presented as follows.

Figure 1: Structured Text File

The structured text editor has the following components:

1. ST Editor Toolbar

IconDescriptionShortcut
Go to last edited lineCtrl + Q
Search for selected charactersCtrl + F3
Go to next selection of found charactersF3
Go to the next selection of found characters (reverse)Shift + F3
Toggle highlighting of found character selections on and offAlt + Shift + H
Toggle frame selection on and offCtrl + Shift + R
Go to the previous line marker
Go to the next line marker
Toggle line marker on and off
Shift line leftAlt + Shift + ←
Shift line rightAlt + Shift + →
Comment
Uncomment

2. Initializing Local Variables

Local variables in Structured Text must be created and initialized at the beginning of the document, between the VAR and END_VAR keywords.

Examples:

(*Variables Initialization*)
VAR

A : INT;
B : INT := 100;
C, D : BOOL;
F : FB_CTU;

END_VAR

Function Implementation

ST instructions must be programmed after the END_VAR keyword, which closes the area designated for declaring local variables.