Beruflich Dokumente
Kultur Dokumente
LAD Ladder Diagram is very similar to a circuit diagram. Symbols such as contacts and
coils are used. This programming language appeals to those who ‚grew up‘ with
contactors.
STL The Statement List consists of STEP 7 instructions. You can p program
g fairly
y freely
y
with STL (sometimes to the point of being unable to follow it anymore). This
programming language is preferred by programmers who are already familiar with
other programming languages.
FBD The Function Block Diagram uses “boxes” for the individual functions. The character
in the box indicates the function (e.g. & --> AND Logic Operation). This
programming language has the advantage that even a “non-programmer” such as a
process engineer can work with it. Function Block Diagram is available as of
Version 3.0 of the STEP7 Software.
Program When using the LAD and FBD programming languages you can insert simple
Elements graphical program elements directly into the program from the toolbar.
You can click the "Program
g Elements" icon to open
p another window containing
g more
program elements. The contents of this window depend on the programming
language selected (LAD/FBD/STL).
Declaration Table The declaration table belongs to the block. It is used for declaring variables and
parameters for the block.
The declaration table is discussed in detail in the chapter ”Functions and Function
Blocks".
Program The contents of the "Program Elements" window depends on the programming
Elements language selected.
You can double-click elements in the list ("browser") to insert them into the program
at the cursor position.
You can also insert elements by drag&drop.
drag&drop
LAD/FBD => STL You can convert program sections that have been written in the graphical
programming languages into STL. You should, however, be aware that the result of
this conversion is not always the most efficient solution in Statement List.
STL => LAD/FBD It is not always possible to convert program sections written in STL into LAD or
FBD. The sections of the program that cannot be converted are left in STL.
No sections of the program are lost on conversion.
You can insert other program elements from the browser in the "Program Elements"
window:
• in
i any position
iti with
ith d
drag&drop
&d
• in a selected position by double-clicking the element in the browser.
Networks When you click the "New Network“ icon in the toolbar, a new network is
added after the current network.
Note If you want to insert a new network before NW1, you must select the block name
("FC1: Plant" in the example above) before you click the "New Network" icon.
Empty Box You can use the Empty Box to insert LAD or FBD elements more quickly. The
elements can be inserted directly without having to select them from the browser.
After you have selected the position in the network where you want to insert an
element, click on the “Empty Box“ icon in the toolbar.
By entering the first letters of an element name, a list with the elements which start
with these letters appears and you can make a selection.
Program Elements When you are using the STL Editor, the "Program Elements" window contains only
a list of the existing blocks which can be called from the current block.
Networks Networks are inserted in the same way as in the LAD/FBD Editor (see previous
page).
Making Changes You use the "Insert" key to toggle between "Overwrite" and "Insert" mode.
The current setting appears in the status bar.
Before you do this, you must select the blocks you want to download:
• All blocks: Select the "Blocks" object in the left-hand pane of the
project window.
• Several blocks: Hold down the CTRL key and select the blocks you
want.
• One block: Select the block.
Activation / There are two ways of activating/deactivating the “Monitor" test function:
Deactivation
• click the “Spectacles“ icon
• select the menu options Debug -> Monitor.
View The program status is displayed in different ways depending on the programming
language selected (LAD/STL/FBD).
When the monitoring function is activated, you cannot change the programming
language in which the block is viewed (LAD/FBD/STL)..
Note You will find more information about testing programs in the chapter "Test
Functions".
Insert/Over-write The insert mode is set by default for LAD or FBD. By pressing the „Insert (Ins)“ key,
you activate the over-write mode. After that, you can, for example, modify the type
of timer for a timer (e.g. change ON delay to OFF delay), without rewiring the inputs
and outputs.
Result You will use one of the following representations when writing your program.
Example of an STL statement with German mnemonics:
U E 1.0 // UND Eingang 1.0
Example of an STL statement with English mnemonics:
A I 1.0 // AND Input 1.0
What to Do 1. In the SIMATIC Manager, double-click on the “Blocks” folder in the program
“My_Program” to open it.
2. Select the menu options View -> Offline
or alternatively:
2a. Click on the Offline icon in the toolbar.
3. Open FC 1 (and the LAD/STL/FBD Editor) by double-clicking its block icon.
4. Select the menu options View -> LAD in the LAD/STL/FBD Editor.
5. Enter the program shown below
in Ladder Diagram using the icons
in the toolbar.
Editing
g Tips
p To p
position the first element, move the cursor to the network line.
Position the cursor above the symbol concerned (using the mouse or the TAB key) to
enter the addresses.
You can use the TAB key to jump from one element to another.
Result Your program will be displayed in one of the following programming languages:
LAD:
I 0.0 I 0.1 Q 8.0 (Q 4.0)
STL: A I 0.0
AN I 0.1
= Q 8.0 (Q4.0)
FBD:
I 0.0 &
Q 8.0 (Q4.0)
I 0.1 =
What to Do 1. Select the menu options File -> Save or click the “Save” icon
or
2. Select the menu options File -> Save As and enter the details.
Result 1. The program block is saved with the block name you specified when you
opened itit.
2. With Save As, the program block is saved with the new name you enter.
If you answer “Yes", the block already in the CPU will be overwritten and lost. If
you answer "No", the old block will remain in the CPU and the new one will not be
downloaded.
Choose “Yes" for this exercise, so that you can then test the block you have
edited.
What to Do 1. In the LAD/STL/FBD Editor, open the OB 1 block from the S7 Program
"My Program".
2. Select a location in the rung of Network 1.
3. Open the "Program Elements" browser by clicking on the icon.
4. Open the "FC Blocks" entry in the browser and using the mouse drag FC 1
to Network 1 in OB 1.
5. Save the FC 1 block.
6. Download the block to the CPU.
Result The OB 1 block is cyclically executed in the CPU; and therefore also the FC 1
function.
Result Depending on the switch settings at inputs I 0.0 and I 0.1, you will see one of the
displays shown in the slide.
Result The output can also be controlled with the condition in the parallel branch.
Data Blocks You can display data blocks in the following views:
• declaration view or
• data view .
New Block You use the “STL”, “LAD”, “FBD” buttons to select the language in which you want
to write a new block.
Multi-instance function blocks are discussed in an advanced p
programming
g g course.
Width of Address You can set the limit for the maximum number of characters in an address name
Field to a number between 10 and 24. This changes the width of the program element in
LAD and FBD. With symbolic representation, a line break takes place according to
the Width of Address Field.
Line/Color You use this box to choose how you want the following to be displayed
• Selected Element (color)
• Contacts (line)
• Status Fulfilled (color and line)
• Status Not Fulfilled (color and line)
Type Check When you edit a block, the type of address entered in bit logic instructions is always
checked.
You can deactivate the Type Check for Addresses for comparisons, mathematical
operations etc. ( for experienced users only! ).
Store Process The "Store Process Diagnostics Data" option is only relevant when using the
Diagnostics Data "PDIAG" option package and is not dealt with in this course.