Influencing policy (training slides from Fast Track Impact)
CLP S7 300 E S7 400
1. S7- SCL and SIMATIC Manager
SIMATIC
S7
Siemens AG 2000. All rights reserved.
Date:
6.10.00
Filename:
2. The Installation of SCL
SW prerequisites
Operating system
WINDOWS 95 / 98 or
WINDOWS NT
SIMATIC S7 Basis package
STEP7 V3.2, V4.x or V5.x with authorisation
Authorisation for SCL
HW prerequisites
PG or PC
Pentium processor recommended
with at least 32 Mbytes RAM (with WINDOWS NT
64 Mbytes min.)
SCL requires approx.10 MByte of hard disk space
MPI connection
SIMATIC
S7
Siemens AG 2000. All rights reserved.
Date:
6.10.00
Filename:
3. SCL programs in the SIMATIC Manager
The SCL
Compiler also
refers to the
symbol table
The SCL source files are located here
The SCL Compiler saves the blocks here
SIMATIC
S7
Siemens AG 2000. All rights reserved.
Date:
6.10.00
Filename:
5. Structure of an SCL program
Several source files for complete program
One source file for
complete program
.
FB22
.
.
.
FC2
.
.
.
OB1
.
SCL source3
SCL source2
SCL source1
OB1 and FC2 and FB22
and instance DB
SCL source file
SIMATIC
S7
FB
22
Siemens AG 2000. All rights reserved.
FC
2
OB
1
InstanceDB
Block container
offline
Date:
6.10.00
Filename:
6. Structure of an SCL program
Several source files for complete program
Control file for the
SCL compiler
SCL source3
SCL source2
SCL source1
SCL source3
SCL source2
SCL source1
in source file container
OB
1
FC
3
FC
5
SCL Make file
OB
32
FC
17
FB2
2F
C2
DB
2
DB
3
FC
77
FC
78
Instance
DBs
in source file container
Block container offline
SIMATIC
S7
Siemens AG 2000. All rights reserved.
Date:
6.10.00
Filename:
8. Importing and exporting SCL source files
SIMATIC
S7
Siemens AG 2000. All rights reserved.
Date:
6.10.00
Filename:
9. Compiling SCL source files
SIMATIC
S7
Siemens AG 2000. All rights reserved.
Date:
6.10.00
Filename:
10. Compiling SCL source files
Double
click
SIMATIC
S7
Siemens AG 2000. All rights reserved.
F1
Date:
6.10.00
Filename:
11. Loading the compiled blocks
SIMATIC
S7
Siemens AG 2000. All rights reserved.
Date:
6.10.00
Filename:
Editor's Notes
ContentsPage
Installation of SCL2
Settings3
SCL programs in the SIMATIC Manager4
Structure of an SCL program 5
source files, make file
Block libraries7
Exporting and importing SCL source files8
Compiling SCL source files, error messages9
Loading the compiled blocks11
RecommendationSTEP 7 Basis and SCL do run on 80486 processors with 16 MByte RAM. However, in order to be able to work comfortably, you should use a PC with a 133 MHz Pentium processor and at least 32 Mbytes of RAM.If you are running WINDOWS NT, you should have at least 64 Mbytes of RAM.
InstallingS7-SCL can only be installed once STEP 7 Basis has been completely installed. S7-SCL is automatically installed on the same drive as STEP 7, e.g e:SiemensStep7S7scl.a) With WINDOWS system controls b) Double click on SETUP.EXE in Explorer
NotesIn the directory above, you will find the file Readme.wri, which contains important information on S7-SCL, such as what is supplied, installation, limitations, new features, DIN EN 61131-3, debugger, tips
AuthorisationIf there is no authorisation for SCL on the hard drive, the installation routine automatically requests the authorisation diskette and transfers the authorisation onto the hard drive.This step can also be carried out manually in advance, or retroactively at a later date: Start / Simatic / AuthorsWAlways save authorisations on drive C:!
UninstalliingWith WINDOWS system controls
For orientationThe S7-SCL options package is integrated into the SIMATIC Manager. This means that you can work in a familiar environment.
Symbol tableThe S7 program container includes a table of symbols that apply to all underlying STL, LAD, FDB and SCL programs.It contains names for components such as OBs, FCs, FBs, DBs and UDTs, and for global variables, such as inputs and outputs, markers, timers and counters.It is worthwhile creating the symbol table before beginning actual programming in SCL.
Source file containerBefore you can write an S7-SCL program, you must generate an SCL source file. The simplest way to do this is using the SIMATIC Manager.Click on the source file container with the right mouse button:Source files > Insert new object > SCL source file.
Double clicking on the SCL source file starts the SCL Editor.The SCL Compiler generates blocks, which are saved in the block container.
Block containerThis is where all blocks are saved that are generated by STL, LAD, FDB or SCL. Prepared blocks (e.g. SFCs and SFBs) that are accessed in an SCL program must also be saved here because the compiler must know the input and output parameters of these blocks.
SettingsBefore working with SCL, it is sensible to check and adjust some individual settings.Adjustments can be made via the menu item Options > Customize...
Create blockIt is possible to switch off the option that asks whether you wish to overwrite an existing block, which can often be annoying.
Compiler- Maximum number of errors: Terminates compilation if too many errors occur
-Object code : Create code that can run on an AS yes/no
-Optimisation: Generate shorter code (always activate)
-Array limits: The field limits are monitored at runtime
-Debug info: Create test information for high level language debugger
-OK-Flag: At runtime, each command with an error sets the OK variable to FALSE.-Maximal string length The default setting of 254 characters can be reduced here.
Editor-Save before compiling is very sensible-Line numbers in the protocol are helpful-Tab settings and font can be set individually
Structure of anAn SCL program consists of one or more SCL source files.
SCL programThese source files can also be edited with other ASCII editors as well as the SCL editor. Whether you use one or more source files depends on the objectives. If individual blocks such as FCs and FBs should be created, you select one source file per block. However, if a complete program or part of a program is to be created, one source file will contain several blocks.
SequenceWithin the source files, attention must be paid to the sequence in which the blocks are called up. If, for example, OB1 calls up the FC2, which then calls up the FB22, FB22 must be compiled first, followed by FC2 and finally OB1. This means that FB22 must be before FC2 in the source file, and FC2 before OB1. Any required instance DBs are created automatically.
Blocks in other languages
In an SCL program, blocks created in other languages can also be called up. When the SCL source files are compiled, these blocks must already be in the block container.
IEC functionsIEC blocks from the IEC library are required for comparative expressions with operands of DATE or STRING type. They must be copied into the block container in advance.
Structure of an SCL Make file
An SCL program can be distributed over several SCL source files. The SCL Make file lists the individual SCL source files in the sequence they are compiled when the compiler is called.
SequenceIf, for example, SCL source3 contains blocks that are called from SCL source2, SCL source3 must appear before SCL source2 in the SCL Make file list, i.e. it must be compiled first.
Open libraryIn theSIMATIC Manager, you can use the menu item File > Open > Libraries to open an installed library and copy the blocks required into the block container. The symbol table for the S7 program is then automatically updated, i.e. the block copied is entered with its name.
Create libraryIn theSIMATIC Manager, you can use the menu item File > New > Libraries to create a library of your own. A new S7 program is then added to this library. The blocks required are copied into the block container and entered into the symbol table of the library.
Exporting SCL source fileFiles that have been created using the SIMATIC Manager and edited with the SCL editor are saved in the project. If you want to continue editing one of these source files at another PG or PC, you will need to export the source. But not using Explorer, using the STEP7 Manager:Select source file > right mouse button > Export source file ...The exported file is given a SCL extension and can be edited further with any ASCII editor.
Importing SCL source files Conversely, an externally edited source file can be imported:Click on source file container with right mouse button > Insert new object > External source file....
Syntax CheckThe SCL Editor does not perform a syntax check; the first check is done during comilation.
CompilingBefore you can run your program or test it, you need to compile it. To activate the compilation process, select Compile in the File menu, or click on the symbol on the function bar.
The compiler has the following properties:
The compiler works in batch mode, i.e. it processes an SCL source file as a unit. It is not possible to compile individual blocks within an SCL source file.
The compiler checks the syntax of an SCL source file and then displays any errors that occurred during compilation.
The compiler generates machine code or test information if the SCL source file is free of errors and the appropriate options have been set. The Debug Info option must be selected for any program that you wish to test at a high level at a later date.
Compiled blocks
If your SCL source file has been compiled with no error messages, and if the Create object code option was set in the compiler options, the compiled blocks are stored in the corresponding block container.
SettingsMenu Options > Customize... > Editor Tip: Set the Save before compiling option.
Error messagesIf your SCL source file contains syntactic errors, the compiler displays a window with the errors and warnings found.
Each error message is given with the corresponding row and column position, and a short description. You can obtain a more detailed description by selecting the message in question and clicking on the Help text button.
Double clicking on error messages
Double clicking on an error message positions the input cursor at the point in the SCL source file where the error occurred.
Please take the error messages and the corresponding help seriously. They provide significant information!
In almost all instances, you will be able to locate the errors in front of the cursor!
Loading the compiled user program
Once your SCL source file has been compiled with no errors, you can load the blocks saved in the block container by the SCL compiler onto the target system. To do this, select menu item PLC > Download, or the symbol on the menu bar.If additional blocks are to be transferred, use the SIMATIC Manager.
NoteIt is advantageous to load the blocks while the operational status is STOP, as errors can occur if an old program is overwritten when the operational status is RUN.