0% found this document useful (0 votes)
245 views

PLC Basic STEP7

STEP 7 is programming software for SIEMENS PLCs that provides configuration, programming, and parameterization functions. It supports the engineering workflow from configuration to commissioning. STEP 7 can be used offline for editing programs without a connected PLC or online for downloading programs to a connected PLC. The software uses symbols to represent control components and instructions in ladder logic programs, such as normally open and normally closed contacts, coils, and boxes for instructions. Programs are created in STEP 7 and downloaded to a PLC connected via an MPI interface.

Uploaded by

ArevaLema
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
245 views

PLC Basic STEP7

STEP 7 is programming software for SIEMENS PLCs that provides configuration, programming, and parameterization functions. It supports the engineering workflow from configuration to commissioning. STEP 7 can be used offline for editing programs without a connected PLC or online for downloading programs to a connected PLC. The software uses symbols to represent control components and instructions in ladder logic programs, such as normally open and normally closed contacts, coils, and boxes for instructions. Programs are created in STEP 7 and downloaded to a PLC connected via an MPI interface.

Uploaded by

ArevaLema
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 79

Moving forward through Continuing Technical Education Program

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

What is STEP 7?

STEP 7 is the programming software for SIEMENS PLC S7-300, S7-400, and C7.
STEP 7 provides you with the entire functionality required for configuring,
programming, and assigning parameters to S7-300, S7-400, and C7. The
programming software gives you effective support when solving your
automation task.

The most important features of STEP 7:

1. STEP 7 runs under Window XP or 2000 and is as easy to operate as other


Windows applications.
2. You can work with object – orientation using STEP 7. All objects are
represented by symbols on the graphical user interface.
3. You will recognize the STEP 7 objects from your everyday working world:
they include stations, modules, and programs.
4. STEP 7 supports you with a user–friendly, context – sensitive online help
functions that gives you valuable information and tips.
5. STEP 7 offers functions for all phases of an automation project – from
configuring to commissioning, testing and servicing, and therefore
supports the complete engineering workflow.

The programming software can be run OFF-line or ON-line. OFF-line


programming allows user to edit the ladder diagram and perform a number
of maintenance tasks. The PLC does not need to be connected to the
programming device in this mode. ON-line programming requires to PLC to
be connected to the programming device. In this mode program changes
are downloaded to the PLC. In addition, status of input/output elements can
be monitored. The CPU can be started, stopped or reset.

Symbols

In order to understand the instruction a PLC is to carry out, an understanding


of the language is necessary. The language of PLC ladder logic consists of a
commonly used set of symbols that represents control components and
instructions.

Contacts

One of the most confusing aspects of PLC programming for the first-time users
is the relationship between the devices that controls a status bit and the

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 1
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

programming function that uses a status bit. Two of the most common
programming functions are normally open (NO) contact and normally closed
(NC) contact. Symbolically, power flows through these contacts when they
are closed. The normally open contact (NO) is true (closed) when the input or
output status bit controlling the contact is 1. The normally closed contact
(NC) is true (closed) when the input or output status bit controlling the
contact is 0.

When scanning a sensor in a user program, you must take account of


whether the sensor is an NO contact or an NC contact. Depending on the
sensor type, there is a different signal state at the relevant input when the
sensor is activated: “1” for an NO contact and “0” for an NC contact. The
CPU has no means of determining whether an input is occupied by an NO
contact or by an NC contact. It can only detect signal state “1” or signal “0”.

If you structure the program in such a way that you want a scan result of “1”
when a sensor is activated, in order to combine that scan result further, you
must scan the input differently for different kinds of sensors. NO contacts and
NC contacts are available to you for this purpose. An NO contact returns “1”
if scanned input is also “1”. An NC contact returns “1” if scanned input is “0”.
In this way, you can also directly scan inputs that are trigger activities when
they are “0” (zero-active input) and subsequently re-gate the scan result.

Coils

Coil represents relays that are energized when power flows to them. When a
coil is energized, it causes a corresponding output to turn on by changing the
state of the status bit controlling that output to 1. That the same output status
bit may be used to control normally open and normally closed contacts
elsewhere in the program.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 2
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 3
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Boxes

Boxes represent various instruction or functions that are executed when


power flows to the box. Typical box functions are timers, counters, and math
operations.

How do you work with STEP 7?

In order to program a SIMATIC S7-300/400 from the PC or PG, an MPI


connection is needed. MPI stands for Multi Point Interface and is a
communication interface that has connection for up to 32 devices (e.g. PCs,
HMI system, etc.). It is used with HMI (Human Machine Interface) systems to
program, serve and observe data exchange between SIMATIC S7 CPUs.

Each SIMATIC S7-300/400 possesses an integrated interface.

There are many possible ways to attach a PC or laptop to an MPI:


- Integrated ISA-Communication processors for the PG
- ISA-Communication processors for the PC (e.g. MPI-ISA-Card)
- PCI-Communication processors for the PC (e.g. CP5511)
- Adapter for the communication over the serial/USB interface of a
PC or laptop (e.g. PC-Adapter)

The following steps below describe the calibration and parameters of a PC-
Adapter for a PC.

1. Call Set PG-PC-Interface (→ Start → SIMATIC → STEP 7 → Set PG-PC-


Interface).

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 4
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

2. The module Select is available as the MPI-interface. (→ Select)

Choose ‘Select’

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 5
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

3. Select the desired module e.g. choose PC-Adapter and Install (→ PC-
Adapter → Install).

Choose ‘Install’

Choose ‘PC Adapter’

4. Make sure the desired module is present (→ PC Adapter → Close).

‘PC Adapter’ Board 1


should be present

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 6
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

5. Choose Properties of PC-Adapter (MPI) (→ PC Adapter (MPI) → Properties).

Choose ‘Properties’

Choose ‘PC Adapter (MPI

6. Set the COM-Port and the Transmission Rate of the serial interface.

COM-Port

Transmission rate

Note: The transmission rate must be suitably adjusted for the PC adapter!
Older PC adapters (PC/MPI cable) should only be processed with a slower
transmission rate of 19200 bits/sec.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 7
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

7. Set the MPI-Address, Timeout, Transmission Rate, and Highest Node


Address

MPI-Address of the
PC/PG

Note: It is recommended to use the preset values!

8. Accept the configuration (→ OK → OK).

9. After the values have been configured, double click on the SIMATIC
Manager icon (→ SIMATIC Manager).

10. The plug placed from the MPI interface of the PC will appear on the MPI
interface of the CPU and switch the voltage supply of the PLC on. The MPI
interface is found behind the front flap of the CPU in the form of a 9 pin D
sub socket.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 8
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 9
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

11. When the button - Accessible Nodes is clicked and all parameters
were correctly selected, the screen will display the following picture with
a folder for the reached MPI interface. The MPI-address of the CPU is also

shown, which is calibrated with a 2 (→ ).

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 10
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Accessible Nodes

Starting up the software

You can start up the software quite simply by double-clicking on the icon
for the SIMATIC Manager, after double-clicking icon, the SIMATIC Manager
window will appear as shown example on the next page.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 11
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

The SIMATIC Manager window

Or from the task bar

Will open the window


of SIMATIC Manager
shown on the next
page

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 12
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

The SIMATIC Manager window

SIMATIC Manager

The SIMATIC Manager is the entry point for programming with STEP 7. It shows
a hierarchical representation of all the objects in a project, which enable you
to access all the functions you require to solve your automation task.

Starting from the SIMATIC Manager, you can:


- Configure and assign parameters to your PLC S7-300 or S7-400
- Program your PLC S7-300 or S7-400

SIMATIC Manager Menus and Toolbars

Title bar - the title bar contains the window title and buttons for
controlling the window.

Menu bar - contains all the menus available for the current window.

Tool bar - contains the most frequently used tasks as symbols. These
symbols are self explanatory.

Status bar - displays the current status and further information.

Task bar - the task bar contains all open applications and windows as

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 13
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

buttons. The task bar can be positioned on either side of the


screen by using the right mouse button.

Title bar

Menu bar

Tool bar

Status bar Task bar

Programming exercise

Your task is to create an automation solution for a traffic light control system.
It will be easier for you if you acquire and understand the following basic
information

- What object you require for working with STEP 7 and


- How you can arrange and handle these objects.

Which STEP 7 objects should you know?

Introduction

The table below shows you the STEP 7 objects that you should know for TLIGHT
programming example.

You can see from the table which symbols are assigned to the individual
objects and what they mean:

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 14
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Creating objects

You create objects as projects via the menu command File → New… these
objects can in turn contain other objects, such as programs and blocks. You
can assign these via commands in the Insert menu. Blocks contain no further

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 15
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

objects. Opening a block starts the assigned editor with which you can then
edit the contents of the block.

Representing objects

You can change the representation of the objects and set the object
properties in various dialog boxes.

Action with objects

You can access to all the processing functions via STEP 7 objects:

1. You can create and open objects.


2. You can rename and delete objects.
3. You can edit and save objects.
4. You can cur, copy, and paste objects.
5. You can print and achieve objects.

The most important objects is a ‘Project’

With STEP 7, you can structure a system into project. A project contains the
entire database for an automation solution. Creating a project or a project
structure is therefore an essential prerequisite for working with STEP 7.

This is what a project structure looks like

On the next page, you will find out how to create a project and a station for
the TLIGHT sample program.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 16
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Introduction

For the TLIGHT sample program, you need a project structure in which you
can store the relevant data for this control task.

You have already learned on the previous page what a project structure look
like. Now make one yourself.

How do you proceed?

Step 1

1. Click on the menu command File → New → Project … in the SIMATIC


Manager or click on the relevant icon in the toolbar. In the next dialog
box, enter the name ‘TLIGHT’ and click on “OK” to create the project.

Result

The new project with the name ‘TLIGHT is displayed. You can now insert
objects.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 17
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Write ‘TLIGHT’

Confirm

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 18
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Step 2

2. Add a station to the open project with the menu command Insert →
Station → SIMATIC 300 Station.
In the project window, click on the “+” in front of the project symbol if
the station is not displayed.

Result

The station and its name are displayed in the project window.
You have now inserted a hardware station in the project “TLIGHT”.

On the next page, show the Step 2 sequence.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 19
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Result

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 20
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Click the + symbol in front of the folder project TLIGHT, then SIMATIC 300
station is shown while on the right side of the window show the hardware icon
for the station. The result is shown below.

Shown above, the station and its name are displayed in the project window.
You have now inserted a hardware station in the project “TLIGHT”.

Configuring and Assigning parameters to your S7-300 and S7-400

What does configuring mean?

‘Configuring’ is arranging the modules in a configuration table. Just as in


actual system, you arrange the modules on a mounting rack using STEP 7.
You can select the modules from an electronics catalog and enter them in
the relevant slot in the configuration table. The slot in the configuration table
should correspond to the real slot on the mounting rack. STEP 7 then
automatically assign an address to each module in the configuration table.

What does assigning parameters mean?

‘Assigning parameters’ means setting the characteristic and behavior of


modules.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 21
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

How to configure and assign parameters

Prerequisites

Before you can enter a new configuration and assign parameters to the CPU
of your S7-300 or S7-400, you must have created a project and selected the
object that you want to configure (here, your SIMATIC 300 or 400 station).

To make sure that there are no ‘old’ blocks in your CPU, you should perform a
memory reset before downloading the new configuration to the CPU.

Basic procedure

We aim to show you the basic procedure for configuring and assigning
parameters using the TLIGHT sample program. The figure below gives you an
overview of this procedure:

Procedure for configuring and assigning parameters

Since we have already created the TLIGHT project, we can start right away
with the memory reset of our SIMATIC 300 or 400 stations.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 22
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

First perform a memory reset of your CPU!

Introduction

Before downloading our configuration data to the CPU, the S7-300 or 400
must perform a CPU memory reset to make sure that it does not contain any
‘old’ blocks.

Resetting the CPU Memory using the key switch located in front of the CPU
module.

Step 1 - Turn the key to the STOP position


Step 2 - Turn the key to the MRES position. Hold the key in this position
until the STOP LED comes on for the second time and remains
on (this takes 3 seconds).
Step 3 - Within 3 seconds you must turn the switch back to the MRES
position and keep holding it until the STOP LED flashes (at 2 Hz).
When the CPU has completed the reset, the STOP LED stops
flashing and remains lit (ON).
The CPU has reset the memory.

Figure below – show the sequence of resetting the memory.

Resetting memory by means of STEP 7 software

How do you proceed?

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 23
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Step 1

Click on the menu command PLC → Display Accessible Nodes or on the tool

bar click in the SIMATIC Manager and select the MPI address of your CPU
in the subsequent dialog box to established an online connection.

Result
An online connection to your CPU now exists.

Step 2

Display the current operating mode of your CPU, in the Accessible Nodes –
MPI window, click on the “ + “ in front of the Accessible Nodes Symbol, then
click MPI = 2 (directly). Click on the menu command PLC → Operating mode.

Result
The current mode of your CPU is displayed.

Step 3

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 24
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Set the CPU to STOP by clicking ‘Stop’ button and confirm with “yes”. Exit the
dialog box by clicking on “Close”.

Result

The CPU goes to STOP.

STEP 4

Call the “Memory Reset’ function with the menu command PLC →
Clear/Reset… and confirm.
The key switch on your CPU must be in the position “RUN-P” or “STOP”.

CPU 315-2 DP left without flash memory, right with flash memory

Result

The following process now takes place in the CPU:


- The CPU is reset and the entire user program is deleted.
- The system parameters and the CPU and module parameters are
reset to the default settings.
- The CPU breaks off all existing connections.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 25
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Mode selector switch as shown above

Each CPU possesses a code switch for the switching of the mode of
operation. Certain programmed functions are allowed depending upon the
position of the code switch. The following modes of operation are possible:

RUN-P - Program runs; All PG functions are allowed.


RUN - Program runs; Only read PG functions are allowed.
STOP - Program does not run; All PG functions are allowed.
MRES - With this position, one can accomplish a reset as described in
the previous pages.

Two types CPU design CPU315-2 DP

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 26
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

S7-300, CPU 31xC and CPU 31x

Memory reset by means of the CPU mode selector switch

When to reset CPU memory

How to reset memory

Resetting CPU memory with mode selector switch

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 27
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Using the mode selector switch to reset the memory

What happens in the CPU during memory reset?

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 28
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

CPU 313C-2 DP left without flash memory, right with flash memory

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 29
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Rules for arranging modules using S7-300 PLC.

Slot rules for S7-300 PLC

Rack 0

Slot 1 - Power supply only (for examples 6ES7 307-…) or empty.


Slot 2 - CPU only (for example 6ES7 314-…)
Slot 3 - Interface module (for example 6ES7 360-…) or empty
Slot 4 through 11 - Signal or function modules, communication processor,
or free.
Rack 1 to 3

Slot 1 - Power supply module only (for example 6ES7 307-…) or


Empty.
Slot 2 - Free
Slot 3 - Interface module
Slot 4 through 11 - Signal or function modules, communication processor
(dependent on the inserted interface module) or free.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 30
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 31
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 32
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Below are the hardware’s of SIEMENS PLC S7-300, which we will use as a
reference for the duration of this discussion.

Power supply PS 307 CPU315 2 DP

Please pay attention to this ordering number which you will use during PLC
hardware configuration

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 33
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Digital Input Digital output Input/Output Analog input


module module module module

Please pay attention to this ordering number which you will use during PLC
hardware configuration

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 34
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

How do you configure and assign parameters to your S7-300 and S7-400?

How do you proceed?

STEP 1

Select the SIMATIC 300 station (1) in your project and call up the
configuration table with the menu command Edit → Open Object.

Edit → Open Object.

As shown example on the next page.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 35
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Result

The configuration table appears on the screen with the working window and
the “Hardware Catalog” window containing all the available modules. If the
hardware catalog is not displayed, you can open it with “Ctrl + K” of on the

tool bar with “Hardware Catalog” symbol .

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 36
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 37
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

STEP 2

In the hardware catalog, select the mounting rack via (1)SIMATIC 300 → (2)
RACK 300 → (3)RAIL and drag and drop it into the working window or double
click the rail icon. Afterwards, a configuration table for the structure of the
RACK 0 is blended in automatically.

Result

A table is displayed showing the rail and its slots.

On the next page, the configuration table.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 38
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Now all modules which are in the material rack can be selected and inserted
in the configuration table from the hardware catalog. To perform this action,
you must click on the indicator of the respective module, hold the mouse
button and drag & drop the item into the configuration table.

STEP 3

We will begin with the power supply PS 307 2A, first select first (1st) slot on
configuration table (highlighting that slot) then proceed with (→ (1) SIMATIC
300 → (2)PS-300 → (3)PS 307 2A).

Note:

If your hardware differs from what is shown, then you must select the
appropriate modules from the catalog and insert them into the rack.

The part numbers of individual modules, which are found on the


components, are indicated in the footer of the catalog.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 39
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Note:

The selected module can inserted in the slot by drag & drop method or by
double clicking the icon of the module selected.

We have selected the power supply PS 307 5A with the ordering number 6ES7
307-1EA00-0AA0 base on the hardware installed on the SIEMENS PLC S7-300.
For reference of PLC S7-300 please see page 32. Ordering number please see
Short information of the selected module on the same page.

The next page show the power supply module is inserted now in the first slot
of the configuration table.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 40
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

The PS 307 5A power supply module is inserted now in the first slot.

In the next step, we drop the CPU 315-2DP into the second (2nd) slot card
location. This allows for the part number and version of the CPU to be read
off.

Select the second slot (2nd) then proceed as follows:

→ SIMATIC 300 → (1) CPU-300 → (2) CPU 315-2DP → (3) 6ES7 315-2AF01-0AB0

The next page will show the sequence.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 41
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

In the following dialog the integrated PROFIBUS – interface is adjusted.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 42
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

We will not be adjusting anything here, click OK (→ OK).

Result shown below

Showing CPU 315-2 DP inserted in the 2nd slot of the configuration table

The next step we drag the input module for 32 inputs into the fourth (4th) slot
card location.

Select 4th slot, digital input (→ (1) SIMATIC 300 → (2) SM-300 → (3) DI-300 →
(4) SM 321 DI32XDC24V).

Note:

Slot card location number 3 (3rd) is reserved for connection modules and
must always remain empty. The part number of the module is indicated in the
footer of the catalog.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 43
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 44
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

The next step we drag the output module for 32 inputs into the fifth (5th) slot
card location.

Select 5th slot, digital output (→ (1) SIMATIC 300 → (2) SM-300 → (3) DO-300
→ (4) SM 322 DO16XDC24V/0.5A).

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 45
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Once the configuration table slots are completed, click save and compile
icon to save the hardware configuration and click the download icon
to download the hardware configuration to PLC.

The code switch by the CPU should remain on STOP! ( → → )

Save and compile sequence shown on the next page and following next
page show the download sequence.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 46
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 47
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 48
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 49
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Programming Logic Block with STEP 7

Introduction

You can program your programmable logic controller quite easily by


creating a user program that you download to the CPU of your S7-300 or S7-
400. The user program you have to create consists of different blocks which
enable you to structure your program. For the TLIGHT sample program, you
require only two blocks:

- An organization block (OB) for cyclic program execution and


- A function block into which you enter the actual program.

What is an Organization Block (OB)?

An organization block (OB) is the interface between the operating system of


the CPU and the user program. The order in which the user program is
executed is defined in OB.

What is a Function (FC)?

A function (FC) is a logic block without ‘memory’ which can nevertheless


transfer parameters. This block is specially suitable for programming frequently
recurring function. The local data of a function are lost after the processing of
the function.

What is a Function Block (FB)?

The function block has an assigned memory area. If a FB is invoked (call on),
a data block (DB) can be assigned to it. The data in this instance DB can be
accessed via calls out of the FB. A FB can be assigned to different DBs.
Further FBs and FCs in a function block can be called on via block call
instruction.

What is a Data Block (DB)?

DBs are used in order to provide a memory location for the data variables.
There are two types of data blocks. Shared DBs in which all OBs, FBs and FCs
read the stored data or can write data into DB themselves and Instance DBs
that are assigned to a certain FB.

What are System Blocks?

System modules are finished functions that are stored in the CPU. These
blocks can be call on by the user and utilized in the program.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 50
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

- SFB (system function block) function block that is stored in the


operating system of the CPU and that can be called on by the user.
- SFC (system function) function that stored in the operating system of
the CPU and that can be called on by the user.
- SDB (system data block) memory area in the program that are
created by different STEP 7 tools (e.g. S7 configuration,
communication, configuration ….) in order to store data for the
automation system.

Every CPU puts different system modules at the user’s disposal. Which ones
exactly can be taken from the STEP 7 reference manuals?

Basic procedure

Using the TLIGHT sample program, we aim to show you the basic procedure
for programming blocks.

How do you create the required blocks?

Program an organization block (OB1) and a function (FC1) for the TLIGHT
sample program.

How do you proceed?

Step 1

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 51
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Open the TLIGHT project in the SIMATIC Manager with the menu command
File → Open → Project …

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 52
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

The project window for the TLIGHT sample program is opened offline.

Step 2

Open the folder of the TLIGHT project down to the lowest level by clicking on
“+” and select the “Blocks” folder.

Result

The OB1 stored in the “Blocks” folder is displayed offline.

Step 3

Insert a function with the name FC1 using the menu command Insert → S7
Block → FC. In the dialog box which then appears, select the programming
language you require (LAD), and confirm with “OK”.

Result

FC1 and OB1 are displayed offline in the project window of the SIMATIC
Manager.

Next page, shown the sequence.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 53
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 54
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Result

FC1 and OB1 are displayed offline in the project window of the SIMATIC
Manager.

What are STL, LAD, and FBD?

STL = Statement List


STL stands for Statement List and is a textual programming language in STEP 7.
The syntax of the statement is close to machine code: Instructions or
operations are followed by addresses. You can use this to program your
control task in STL for optimal memory capacity and runtime.

LAD = Ladder Logic


LAD stands for Ladder Logic and is a graphical programming language in
STEP 7. The syntax of the statements is similar to a circuit diagram and enables
you to easily follow the signal flow between conductor bars via contacts,
complex elements and coils.

FBD = Function Block Diagram


FBD stands for Function Block Diagram and is also a graphic programming
language in STEP 7. The statements are represented as logic boxes, similar to

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 55
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

those in Boolean algebra. As with the wiring diagrams in digital technology,


you can follow the signal flows by means of the boxes.

STL, LAD, and FBD are integrated into STEP 7


STL, LAD, and FBD are integrated into the STEP 7 Standard software. So after
you have installed STEP 7, all the editor, compiler, and test functions of STL,
LAD, and FBD are available to you.

You can change the language setting for a block using the View menu and
can switch between STL, LAD, and FBD.

Starting STL, LAD, and FBD


If you double-click on the FC1 which has already been programmed, the
language editor you have assigned (STL, LAD, or FBD) will be started and a
split window appears with:

- The variable declaration table of the block in the upper half and
- The code section of the block in the lower half of the window. This is
where you write your program.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 56
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Variable Declaration Table


The variable declaration table contains the parameters local variable for the
block.

Code Section
In the code section, you enter the program for your block as STL statements
or as LAD and FBD elements in networks. The incremental STL, LAD, and FBD
editor executes a syntax check immediately after each statement or element
is entered and displays any error in red italics. Any such syntax errors must be
corrected before saving the block.

In the TLIGHT sample program, the code section consists of several networks,
which in turn contain a list of statements or a circuit.

Components of the Code Section


In the code section of a block, you can edit the block title, block comments,
network title, network comments, and STL statements or LAD/FBD elements
within individual networks, as shown in the next page.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 57
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 58
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

How do you Program a Block in LAD?

Prerequisite

You have created OB1 and FC1 as blocks and you have assigned the
incremental LAD editor as the language editor.

Starting the LAD Language Editor

If you double-click on the FC1 which has already been programmed in the
SIMATIC Manager, the assigned LAD editor is started and you can program
the block.

Rules for Entering LAD Elements

A LAD network or circuit can consist of several elements in several branches.


All elements and branches of such a network must be linked together. The
left conductor bar does not count as a connection.

There are some rules to observe when programming in LAD:

- Each LAD network must be terminated with a coil or box.


- Branches that could result in current flow in the opposite direction
cannot be edited.
- Branches that would cause a short-circuit cannot be edited.

Don’t worry. If you make any errors in entering the LAD statements, error
messages will bring them to your attention!

Methods of Entering LAD Elements

There are the following methods for inserting LAD elements:

- You can enter NO contacts, NC contacts, or coils via function keys


F2, F3, or F7 or you can select the icons for NO contacts, NC
contacts, or coils from the toolbar.
- You can select and insert LAD elements with the menu command
Insert → LAD Element.
- In addition, you can select and insert program elements, for
example, timers from a catalog. Open the “Program Elements”
catalog with the keys “Ctrl + K” or using the corresponding icon in
the toolbar.

How do you proceed?

Step 1

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 59
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Start the assigned LAD editor by double-clicking on FC1 in the SIMATIC


Manager.

Result

FC1 is opened and a split window appears with:


- The variable declaration table and
- The code section of the block.

See the next page for the result.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 60
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Step 2

Programming a series circuit in ladder logic

Select the current path for your first element.

As shown on the next page.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 61
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 62
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 63
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 64
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

You have now completed programming a series circuit.

Step 3

Programming a parallel circuit in ladder logic

Insert new Network 2

Network 2 shown inserted on the next page.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 65
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 66
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 67
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 68
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 69
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 70
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Programming of parallel circuit in ladder logic is complete.

For our TLIGHT sample program, a timer is needed as on-delay timer. This
called S_ODT and can be found in the catalog under the point Timers. (→
Timers → S_ODT)

First insert new Network 3 – On delay timer

A further network is registered by clicking on the symbol in the menu bar.

The timers need to be designed with T1 and be registered with a value of 5


seconds in the S5 Time-Format S5T#5S

Note:
In order to give a time to a timer, the following syntax must be used:

S5T# 5S

S5T# is the first format and directly after it the time (here 5 seconds) is
entered. The time can also be given as milliseconds (ms), minutes (m), and
hours (H). These units can also be indicated together (e.g. S5T#3M_3S)

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 71
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 72
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Step 4

Save the complete and correctly created FC1 with the menu command File
→ Save

Result

The block is saved

Step 5

Then program OB1 in the same way

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 73
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 74
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 75
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

After saving all the blocks were ready to download our user program to the
PLC.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 76
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Basic procedure for downloading and testing

Introduction

You cannot test your program until you have downloaded it to the CPU of
your PLC, example S7-300 or S7-400.

You can download either individual blocks or complete user program to the
CPU of your programmable logic controller. Only individual blocks can be
tested.

Basic procedure

We aim to show you the basic procedure for downloading and testing using
the TLIGHT sample program. The figure below gives a task-oriented overview:

Procedure for Downloading and Testing the User Program

Prerequisites

The following prerequisites must be fulfilled before you can download the
user program to your PLC.
- There must be an online connection between your programming
device and your PLC.
- The program to be downloaded must have been compiled without
errors.
- The CPU of your PLC must be in STOP state.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 77
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

What to load and order of calls

To test individual blocks, you must always load OB1 with all the blocks called
in it. These blocks must be in reverse call order.

For the TLIGHT sample program, download the FC1 you have created and
the OB1 to your CPU.

As shown example below.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 78
Moving forward through Continuing Technical Education Program
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

After completing the downloading the user program or the created program
title “TLIGHT”, were ready to test the program on the PLC.

Switch the PLC to RUN position, the program should work.

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

TEKHNIK Automation Services Training Technology were at best


Calamba City, Laguna 4027
Philippines 79

You might also like