Tuesday, March 24, 2015

Addressing S7-300 Modules

Addressing S7-300 Modules

Slot Numbers
The slot numbers in the rack of an S7-300 simplify addressing in the
S7-300  environment. The position of the module in the rack determine the first
address on a module.

Slot 1
Power supply. This is the first slot by default.
A power supply module is not absolutely essential. An S7-300  can also be
supplied with 24V directly.

Slot 2
Slot for the CPU.

Slot 3
Logically reserved for an interface module (IM) for multi-tier configurations using
expansion racks. Even if no IM is installed, it must be included for addressing
You can physically reserve the slot (such as for installing an IM at a later date) if
you insert a DM370 dummy module.

Slots 4-11
Slot 4 is the first slot that can be used for I/O modules, communications
processors (CP) or function modules (FM).
Addressing examples:
• A DI module in slot 4 begins with the byte address 0 .
• The top LED of a DO module in slot 6 is called Q8.0 .

Four byte addresses are reserved for each slot. When 16-channel DI/DO
modules are used, two byte addresses are lost in every slot!

DI/DO Addressing in Multi-Tier Configurations

Multi-Tier Configurations
The slots also have fixed addresses in a multi-tier configuration.

• Q7.7 is the last bit of a 32-channel DO module plugged into slot 5 of rack 0.
• IB105 is the second byte of a DI module in slot 6 of rack 3.
• QW60 is the first two bytes of a DO module in slot 11 of rack 1.
• ID80 is all four bytes of a 32-channel DI module in slot 8 in rack 2.

Module Address Overview

Address  Overview
Views the I/O addresses of the station configured. Select: View -> Address Overview …

R Rack number
S Slot number of the relevant module
DPRelevant only when Distributed Peripherals (I/O) are used
IF Interface module ID when programming the M7 system (in C++).

Variable Addressing

Slot dependent Addressing 
The modules are assigned fixed slot-dependent addresses with the S7-300  (CPUs without DP interface) and S7-400 (without hardware configuration).

Variable Addressing
With the S7-300  (CPUs with integrated DP interface) and with the S7-400 you can assign parameters to the starting addresses of the modules.

What to Do
When you double-click a digital or an analog module, the parameter assignment
screen is opened. After you choose the "Addresses" tab, you can cancel
"System selection". You can now define the starting address in the "Start" box. If
the address is already used, an error message is triggered.
Part process images can be defined only in the S7-400 . That way, specific
inputs and outputs (such as time-critical signals) can be combined into one
group. A system function triggers the updating of a part process image in the
user program.

After a CPU memory reset, the parameters, and therefore also the addresses
are lost. This means that the slot-dependent addresses of the S7-300  or the
default addresses of the S7-400  are valid once more.

Friday, March 13, 2015

Hardware Configuration and Parameter Assignment

HW Configuration
The modules are supplied from the factory with preset parameters. If these
default settings are OK, a hardware configuration is not necessary.
A configuration is necessary:
• if you want to modify preset parameters or addresses of a module (such as
to enable the hardware interrupt of a module)
• if you want to configure communication connections
• with stations that have distributed peripherals (PROFIBUS-DP)
• with S7-400  stations that have several CPUs (multicomputing) or
expansion racks
• with fault-tolerant programmable logic controllers (option package).

Setpoint Configuration 
When you configure a system, a setpoint configuration is created. It contains a hardware station with the planned modules and the associated parameters. The
PLC system is assembled according to the setpoint configuration. During
commissioning, the setpoint configuration is downloaded to the CPU.

Actual Configuration
In an assembled system, the actual existing configuration and parameter
assignment of the modules can be uploaded from the CPU. This creates a new
HW station in the project.
A configuration upload is necessary, for example, if the project structure does
not exist locally at the PG. After the actual configuration is read out, you can set
parameters and add part numbers.

With the S7-400, the CPU can be assigned parameters in such a way, that
when there are differences between the setpoint configuration and the actual
configuration, the CPU startup is interrupted.
To call the HW Config tool, there must be a hardware station in the SIMATIC

Starting the HW Configuration Editor

HW Config
This tool helps you configure, assign parameters to and diagnose the hardware.

Starting HW Config
To start the HW Config tool:
• select a hardware station in the SIMATIC Manager and choose the Edit --> Open Object menu or
• double-click the hardware object.

"Hardware Configuration"
This is a window in the "HW Config“ application you use for inserting components from the "Hardware Catalog" window.
The title bar of this window contains the name of the project and the station

"Hardware Catalog"
To open the catalog:
• select the View -> Catalog menu or
• click the icon in the toolbar.
If “Standard” is selected as the catalog profile, all racks, modules and interface
modules are available in the "Hardware Catalog" window.
You can create your own catalog profiles containing frequently used elements
by selecting the menu options Options -> Edit Catalog Profiles.
You can add Profibus Slaves that do not exist in the catalog later on. To add
slaves, you use GSE files that are provided by the manufacturer of the slave
device. The GSE file contains a description of the device. To include the slave in
the hardware catalog, use the Options -> Install New GSE Files menu and then
Options -> Update Catalog. You will find the new devices in the catalog under
Profibus, additional field devices.

Generating a Hardware Setpoint Configuration

Generating a Setpoint  Configuration
This means specifying how the modules are to be arranged in the rack. This configuration, specified by you, is referred to as the setpoint configuration.

For example, you open a SIMATIC  300 station in the Hardware Catalog.
Opening the "RACK-300" folder shows the icon for a DIN rail. You can insert this
in the "Hardware Configuration" window by double-clicking on it (or using drag &
Two rack component lists then appear in the two-part window: a plain list in the
top part and a detailed view with order numbers, MPI addresses and I/O
addresses in the bottom part.

Power Supply
If a load current power supply is required double click or use drag & drop to
insert the appropriate "PS-300" module from the catalog in slot no.1 in the list.

You select the CPU from the "CPU-300" folder, for example, and insert it in slot
no. 2.

Slot No. 3
Slot no. 3 is reserved as the logical address for an interface module (for multitier
If this position is to be reserved in the actual configuration for the later
installation of an IM, you must insert a dummy module DM370 (DUMMY).

"Inserting" Modules
From slot no. 4 onwards, you can insert a choice of up to 8 signal modules
(SM), communications processors (CP) or function modules (FM) from the
HardwareCatalog using drag & drop or with a double-click.
The slots on which the selected module can be inserted are automatically
highlighted in green.

Friday, March 6, 2015

Copying a Block from the Standard Library

For later use, copy the FC105 block from the STEP7 "Standard Library" into the
Blocks folder of the Step7 Program "My_Program" in the project "My_Project".

What To Do
1. Open the "Standard Library" in the SIMATIC Manager:
File > Open... -> select the "Libraries" tab -> choose "Standard Library" in the
list -> confirm
2. In the project "Standard Library" open the Blocks folder of the S7 Program
"TI-S7-Converting Blocks"
3. Display your project called "My_Project" and the "Standard Library" at the
same time in two windows in the SIMATIC  Manager
Window > Arrange > Horizontally
4. Using drag & drop, copy the FC 105 block from the "Standard Library" into
your program folder "My_Program"
5. Close the library.

The FC 105 block is stored in the Blocks folder of your Step7 Program called
"My_Program" in addition to the still empty OB 1.

Libraries are used for storing blocks which contain standardized functions. You
can copy the blocks from the library into any project you wish. If the name
(number) of the block you are copying already exists, you can rename the library
block (number) when you insert the block into your program folder.

Performing a CPU Memory Reset and Warm Restart

You are to perform a CPU memory reset and check whether the memory reset
was successful.

What To Do
• Carry out the memory reset according to the steps in the slide above
• Check the success of the memory reset. The memory reset was successful
when only system blocks (SDBs, SFCs, SFBs) are left in the CPU
in the SIMATIC Manager, select the Step7 Program folder "My_Program" ->
switch to the Online view.

When the CPU memory is reset, all user data in the CPU are deleted.
To make sure that no “old” blocks are left in the CPU, a memory reset of the
CPU should be performed. The following takes place during a memory reset:
• All user data are deleted
(with the exception of the MPI parameter assignments).
• Hardware test and initialization
• If an Eprom memory card is installed, the CPU copies the EPROM contents
back into the internal RAM after the memory reset.
• If no memory card is installed, the preset MPI address is retained. If,
however, a memory card is installed, the MPI address stored on it is loaded.
• The contents of the diagnostic buffer (which can be displayed with the PG)
are retained.

Tuesday, March 3, 2015

Offline / Online View in the SIMATIC Manager

Offline View
In the project window of the SIMATIC  Manager, the offline view displays the
project structure stored on the hard disk of the programming device.
The " Step7 Program" folder contains the "Sources" and "Blocks" objects.
The "Blocks" folder contains the system data created with the HWConfig tool
and the blocks created with the LAD/STL/FBD Editor.

Online View
The online view shows the offline project structure in the left window and in the
right window it shows the blocks stored online in the selected CPU.
As a result, the " Step7 Program" seen in the online view only contains the "Blocks"
folder which contains the following objects:
• System data blocks (SDB)
• User blocks (OB, FC, FB)
• System blocks (SFC, SFB).

Changing Views
Changing between offline and online view takes place:
• through the View -> Offline or View -> Online menu items
• with the corresponding symbol in the toolbar:


You can arrange the "ONLINE" and "OFFLINE" views next to each other or
under each other when you use the Window -> Arrange option in the menu bar.

Standard Library

Libraries are used to store reusable blocks.The blocks can be copied into a
library from existing projects or they can be created directly in the library
independent of projects.

Standard Library
A Standard Library is installed when you install STEP 7. You can access this standard library from the SIMATIC  Manager (File -> Open -> Libraries) or from
the Block Editor (Overviews -> Libraries). The library contains the following S7

Communication Blocks:
FCs (functions) for communication between the CPU and the distributed I/O
via communication processors.

Organization Blocks: Organization blocks (OBs).

S5-S7 Converting Blocks:
Blocks that emulate STEP 5 standard function blocks and that are necessary for converting STEP 5 programs.

TI - Step7 Converting Blocks: Generally usable standard functions such as analog value scaling.

IEC Function Blocks:
Blocks for IEC functions (IEC: International Electrotechnical Commission), such
as for processing time and date information, for string processing and for
selecting maximum and minimum.

PID Control Blocks: Function blocks (FBs) for PID closed-loop controls.

System Function Blocks: System functions (SFCs) and System function blocks (SFBs).

Miscellaneous Blocks: 
FCs and Fs for switching between daylight savings time and and standard time
(summer and winter times).

Note Additional libraries are added when optional software is installed.