This chapter introduces you to using SCL. It provides information about the SCL Editor user interface.
Section Description Page
4.1 Starting the SCL Program 4-2
4.2 Customizing the User Interface 4-3
4.3 Working with the SCL Editor 4-5
Introduction
Chapter Overview
4
4.1 Starting the SCL Program
Once you have installed the SCL software on your programming device/PC, you can start SCL USING the Start button in the Taskbar of Windows 95 (entry under “SIMATIC / STEP 7”).
The quickest way to start SCL is to position the mouse pointer on an SCL source file in the SIMATIC Manager and double-click on it. For more information, refer to the user manual /231/.
Figure 4-1 shows the SCL window after the program has been started.
SCL: Programming S7 Blocks File View Help
Press F1 for help. NUM
Figure 4-1 SCL Window
Note
Precise details of standard operations and options in Windows 95 are given in your Windows 95 documentation or the online Windows 95 Tutorial.
Starting from the Windows Interface
Starting from the SIMATIC Manager
4.2 Customizing the User Interface
The SCL windows consist, as do other STEP 7 windows, of the following standard components (see Figure 4-2):
S Title bar:
Contains the window title and window control buttons S Menu bar:
Shows all menus available in the window concerned S Toolbar:
Contains a series of buttons which provide shortcuts to frequently used commands
S Working area:
Contains one or more windows in which you can edit program code or read compiler information or debugging data
S Status bar
Displays the status of and other information relating to the active object
Title bar Menu bar Toolbar
Working area
Status bar
SCL: Programming S7 Blocks File View Help
Press F1 for help. NUM
Figure 4-2 Components of the SCL Window Overview
Using SCL
The following components can be customized to your own personal specifications:
S Display of the toolbar S Display of the breakpoint bar S Display of the status bar
You can choose to display or hide the toolbar by selecting or deselecting the menu command View " Toolbar. When the function is activated, a check mark appears next to the command.
You can choose to display or hide the breakpoint bar by selecting or deselecting the menu command View " Breakpoint Bar. When the function is activated, a check mark appears next to the command.
Similarly, you can choose to display or hide the status bar by selecting or deselecting the menu command View " Status Bar. When the function is activated, a check mark appears next to the command.
The Editor and the Compiler allow you to make certain settings which will make your job easier.
S Settings when creating blocks S Editor settings
S Compiler settings
You can, for example, decide whether existing blocks are overwritten or not when compiling. To do this, select the menu command Options " Customize and click the“Create Blocks” tab in the “Customize” dialog box. The options are described in detail in Section 5.5.
You can also adapt the compilation process to your own requirements. A detailed description of the options is given in Section 5.5.
Select the menu command Options " Customize and click the “Compiler”
tab in the “Customize” dialog box.
You can specify the tab indent width, save before compiling, and display line numbers settings and other options. To do this, select the menu command Modifying
4.3 Working with the SCL Editor
The SCL source code consists primarily of running text. When entering text, the SCL Editor provides assistance in the form of word processing functions adapted specifically to SCL requirements.
The source object for your user program is typed in the workspace using the keyboard. You can open more than one window for the same source object or open a number of windows each containing different source objects. The window arrangement can be controlled by means of the commands in the Window menu.
File Edit Insert PLC Debug View Options Window Help
FUNCTION_BLOCK FB11 VAR
I:INT;
Array:ARRAY[1..10,1..20] OF REAL;
CONTROLLER:
ARRAY[1..3,1..4] OF INT:=–54, 736, –83, 77, –1289, 10362, 385, 2, 60, –37, –7, 103;
Press F1 for help. Insert 0:0 Offline
SCL: Programming S7 Blocks – proj1\...\Source File1
proj1\SIMATIC 300 Station(1)\CPU314(1)\...\Source File1
Figure 4-3 SCL Editor Window
In SCL you can select text by positioning the cursor at the beginning of the section you wish to select and then pressing and holding the left mouse button while dragging the highlight so that it covers the whole of the desired section of text.
You can also:
S Select the complete source code text by selecting the menu command Edit " Select All.
a The menu command Edit Find/Replace opens a dialog box in which you can enter a character string you wish to find or replace with different text.
Inserting templates enables you to program more efficiently and makes it easier to avoid syntax errors. In SCL you can
S Insert templates for blocks by selecting the menu command Insert Block Template.
S Insert templates for control structures by selecting the menu command Insert Control Structure.
Text can be cut, copied, pasted and deleted in the normal way. The relevant commands are to be found in the Edit menu.
In most cases, you can move and copy objects by “dragging and dropping”
with the mouse.
With the menu command Edit Go To ..., a dialog box is opened in which you enter the number of the row at which you want to position the insert cursor, and then confirm with “OK”.
With the menu command Edit Undo, you can reverse an action, for example, undelete a row. The menu command Edit Restore enables you to restore an action that was undone.
Search and Replace
Inserting Templates
Cut, Copy, Paste and Delete
GO TO
Undo, Restore