The text of a manual · part 12 of 50
Festo Software Tools: Statement list and Ladder diagram for SF 3, FST 200 Manual, pages 111 to 120
Pages 111 to 120 of 496
The original document is the PDF (3.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Festo FPC-202
Page 111
FST 200-STL
4. Programming in the statement list
4.1.6 Editing commands You can access the following functions through the editing commands: • Search commands (see section 6.1.1) • Block commands (see section 6.1.2) • Tab commands (see section 6.1.3) • Delete program lines, insert lines or restore modified lines • Toggle the cursor between a line and a block. The first three items are explained in the Text editor chapter.
You switch to the editing commands when you activate the Editing commands option in the STL editor as shown in Fig. 4.4. Fig. 4.6 illustrates the associated assignment of the function keys.
9610a
4-15
Page 112
FST 200-STL
4. Programming in the statement list
Fig. 4.6: Editing commands Insert line Selecting this function once causes a line to be inserted before the line in which the insertion mark is located. Delete line Selecting this function causes the line in which the insertion mark is located to be deleted. Restore line Select this function if you have modified the content of a line, but wish to restore it to its original state.
4-16
9610a
Page 113
FST 200-STL
4. Programming in the statement list
Toggle cursor You can change the appearance of the insertion mark. Normally, the insertion mark is shown as a line beneath the text character. Activating this function causes it to be shown as a flashing rectangle. This appearance gives a better display on some monochrome monitors. Selecting the function again returns the insertion mark to its line representation. 4.1.7 Additional commands Switch to the additional commands by selecting function F7 in the STL editor (see Fig. 4.4). The Additional commands window will then be displayed at the bottom right of the screen.
Fig. 4.7: Additional commands You may select the various menu items by the methods described above.
9610a
4-17
Page 114
FST 200-STL
4. Programming in the statement list
Syntax test This function starts a test of the program displayed in the editor. The function checks notation (syntax) and simple forms of correct sequencing from the point of view of programming (semantics). Allocation listing ON/OFF This function toggles automatic allocation list entry during program input on or off. The system displays the status valid after the function has been activated. If you have selected Allocation listing ON, a window will appear each time you press ENTER in which you can enter the absolute or symbolic operand together with a brief comment (see section 4.2.4). Format file When this function is selected, the program called by the STL editor is put into a uniform format. This format is similar to the program code layout in this manual. Module call This function provides assistance in the entry of module calls. It provides a pre-formatted screen with fixed input fields (see section 4.5). Unused entries in allocation list Selecting this function causes the memory capacity still available for the allocation list to be displayed. Edit allocation list This function switches you over to the relevant allocation list editor. You will be able to modify the entries there (see section 4.6).
4-18
9610a
Page 115
FST 200-STL
4.2
4. Programming in the statement list
Editing an STL program At this point, we repeat all the steps you will have to carry out to access the STL editor. • Create a project or select an existing project in project management. • Activate the STL editor in the screen illustrated in Fig. 4.1. • Select an existing program or create a new program. • The STL editor now appears and you can write a program or edit an existing program. The various instructions, with the exception of the operands, can be entered easily using the preset function keys or typed in from the keyboard.
General program structure A control program in STL is composed of a number of instructions. Consider the following short program for instance: STEP <Label> IF AND THEN SET OTHRW SET ...
Switch1 I1.1 O1.0 Horn
Each separate line represents one instruction for the controller.
9610a
4-19
Page 116
FST 200-STL
4. Programming in the statement list
An instruction of this type is composed of: • STL commands (IF, AND, THEN, SET, OTHRW) • Specific function units such as inputs or outputs (known as operands) • Their addresses (1.0, 1.1) The addresses indicate which input or output on which I/O module should be addressed. In the example described above, this means: I1.1 is input 1 on I/O module 1 O1.0 is output 0 on I/O module 1 Switch1 and Horn are symbolic operands.
When you enter a program, you must always make sure that you write the operands and their related addresses together. They may never be separated by a space. The full structure and syntax of an STL program is shown in appendix A.3. When entering a new program, you may write it as: • A step program • A logic program • An execution statement.
4-20
9610a
Page 117
FST 200-STL
4. Programming in the statement list
4.2.1 Step program A step program can contain up to 255 steps (1...255). You may label each step with a symbolic step label. The steps will be numbered consecutively when the program is compiled if they are not already labelled in this way. You can use branching in a step program (JMP TO step label). This causes your program to be continued with a step other than that immediately following. A step consists of one or more statements. A complete statement contains an IF statement, a THEN statement and possibly an OTHRW statement. The first statement in each step may be an incomplete statement. This would be a pure execution statement (THEN...). This THEN statement is always executed without an input condition. The program is executed step by step. A subseqent step will only be executed if it has been possible to execute a THEN or OTHRW instruction in the last statement of the current step.
9610a
4-21
Page 118
FST 200-STL
4. Programming in the statement list
Example of a simple step program: STEP Label1 IF THEN SET OTHRW RESET STEP Label2 THEN RESET IF THEN SET SET OTHRW SET JMP TO STEP Label3 IF AND THEN SET STEP Label4 ...
I1.0 F1.5 F1.5 F0.0 F1.5 O0.7 F0.0 O0.0 Label1 F0.0 I0.0 O0.4
4.2.2 Logic program A logic program is made up of pure statements, i.e. it is programmed without step labels. A logic program is thus identical to a step from a step program. Here, you no longer have the opportunity of setting up branches.
4-22
9610a
Page 119
FST 200-STL
4. Programming in the statement list
The first statement in a logic program can be an incomplete statement. You must write all subsequent statements as complete statements (see appendix A.3). You must enter a PSE (processor interrupt) in the last statement if the logic program is to be processed in any number of cycles. This statement will have to be structured in such a way that this processor interrupt always happens. The program is processed cyclically. The THEN statement for which the condition is fulfilled will be executed. Example of a logic program: THEN IF THEN IF THEN OTHRW
RESET N SET SET SET RESET
... ... IF THEN OTHRW
9610a
AND SET PSE PSE
F0.0 I1.0 O0.7 I1.7 O1.7 F0.0 O1.7
F0.0 I1.0 O1.0
4-23
Page 120
FST 200-STL
4. Programming in the statement list
4.2.3 Execution statement An execution statement is basically structured in the same way as an incomplete statement in a logic program. The first THEN statement is omitted. Here all instructions entered are executed without an input condition. A program branch is not possible in this case. You will receive an error message if you enter an IF statement later. Example of an execution statement: SET RESET LOAD TO SET CMP2 ...
F0.0 O1.0 V50 TW7 T7
4.2.4 Allocation list entry during editing You can enter the operand in an allocation list after each carriage return during program input. To do this, however, you must previously have selected Allocation listing ON under the additional commands. This is indicated by an entry to the left of the header line. Refer to section 4.6.1 in this respect. You cannot make an entry here if you have selected Allocation listing OFF under the additional commands. If you now conclude a program line with the ENTER key, the program checks whether the operand has already been entered in an allocation list.
4-24
9610a