1. Instruction List Editor
1. Instruction List Editor
Our software Statement Table (STL) editor allows you to create control programs by using textual STL instruction mnemonics and parameters. Usually, STL editors are more suitable for experienced programmers who are familiar with PLC and logic programming. The STL editor also allows you to create programs that cannot be created through ladder logic or function block diagram editors. This is because you are programming in the native language of the CPU, rather than in a graphics editor where certain restrictions must be applied in order to compile graphics correctly.
图1 STL sample
Text based statements are similar to assembly language programming. The CPU executes each statement in the list from top to bottom. After all program segments are processed, execution will restart from the top of the list. The S7-200 CPU uses a logic stack to solve AND/OR control logic. The LAD and FBD editors automatically convert AND/OR graph logic into STL instructions, which use a logic stack to execute equivalent logic. In STL programming, stack instructions must be used and stack operations must be handled personally.
All LAD and FBD programs must be successfully converted to STL programs, as what is actually downloaded to the PLC is the STL version of the LAD or FBD program.
The following figure shows a simple program in LAD and the corresponding program in STL.
图2 LAD sample
图3 instruction list sample
The following table shows what happens in a 32-bit logical stack:
| stack | LD M0 | LD M1 | LD M20 | A | OLD | ALD |
|---|---|---|---|---|---|---|
| S0 | M0 | M1 | M20 | M20 AND M21 | (M20 AND M21) OR M1 | M0 AND [(M20 AND M21) OR M1] |
| S1 | - | M0 | M1 | M1 | M0 | - |
| S2 | - | - | M0 | M0 | - | - |
| . | - | - | - | - | - | - |
| S31 | - | - | - | - | - | - |
1.1. key points
The key points to consider when choosing an STL editor include:
STL is most suitable for experienced programmers.
STL can sometimes solve problems that cannot be easily solved with LAD or FBD editors.
Programs created through STL editors may result in program sizes smaller than those of equivalent control logic created in LAD or FBD editors.
You can always use the STL editor to view or edit programs created through the LAD editor or FBD editor, otherwise it may not be correct. Cannot always display programs written using STL editor using LAD editor or FBD editor.