How to Enter a Statement in STL (GS 5.2)


You cannot insert STL instructions from the instruction tree, although they are listed there as a reference. You must type the STL instructions in the Program Editor window (STL editor).

To enter a statement in the STL editor:

1.Position the cursor at the beginning of a line.

2.Enter the instruction. (Example: LD)

3.Press the SPACEBAR or TAB key.

4.Enter the operand, which can be absolute (example: I0.0), symbolic (example: Input1), or a constant (example: 100).
(Example of full line, with instruction and address: LD I0.0)
Note: If a line has multiple operands, you can separate them by using a space, or a tab, or a comma.

5.If no comment is desired, press the ENTER key to move to the next line.

Do not use MEND, RET, RETI, SBR, or INT to terminate the POU s (OB1, subroutines, interrupt routines) of your program. These instructions are automatically inserted by the compiler; if you use them in your POUs, the compiler returns an error.


·Enter only one instruction and/or comment per line.

·To toggle between Insert Mode and Overstrike Mode when you are typing, press the INSERT key. Insert Mode is the default.

·To separate networks in your program, you can use the keyword NETWORK on the line that precedes the beginning of the instructions that make up the network. (Do not type a network number; the numbers are automatically added when you compile.)
Network 1 // This line introduces the first network of your program
LD I0.0 // Loads the value at I0.0
OI0.1 // Or with value of I0.1
// More instructions here: each network is composed of multiple instructions
Network 2 // Starts a new network of instructions
Separating networks is optional; it makes it easier to view an STL program with the LAD or FBD program editor.

·Use the scroll bars or the PAGE UP/DOWN keys to move through the program when your program becomes larger than one screen.

See Also:

Addressing Overview (GS 2.2)

How to Enter Program Comments in STL (GS 5.3)

Statement List Program Example (GS 5.4)