S7-300 Automation System:
Getting Started CPU 31x:
Commissioning
_
_________________
_
_
_________________
_
_
_________________
_
_
_________________
_
SIMATIC
S7-300
S7-300 Automation System:
Getting Started CPU 31x: Commissioning
Getting Started
08/2011
A5E00164278-05
Introduction
1
Preparation
2
Units
3
Further Information
4
Legal information
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.
CAUTION
without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.
NOTICE
indicates that an unintended result or situation can occur if the relevant information is not taken into account.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will
be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to
property damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions.
Qualified personnel are those who, based on their training and experience, are capable of identifying risks and
avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended
or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Siemens AG
Industry Sector
Postfach 48 48
90026 NÜRNBERG
GERMANY
A5E00164278-05
Ⓟ 09/2011
Copyright © Siemens AG 2011.
Technical data subject to change
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 3
Table of contents
1 Introduction................................................................................................................................................ 5
2 Preparation................................................................................................................................................ 7
3 Units ........................................................................................................................................................ 11
3.1 1. Step: Installing and Grounding the Rail ...................................................................................11
3.2 2. Step: Wiring modules...............................................................................................................13
3.3 3. Step: Commissioning the Hardware ........................................................................................14
3.4 4. Step: Configuring hardware in HW-Configuration of STEP 7..................................................15
3.5 5. Step: Programming a circuit.....................................................................................................16
3.6 6. Step: Test Run .........................................................................................................................18
4 Further Information .................................................................................................................................. 19
Table of contents
S7-300 Automation System: Getting Started CPU 31x: Commissioning
4 Getting Started, 08/2011, A5E00164278-05
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 5
Introduction 1
Contents of this Getting Started Manual
Using a specific example, this "Getting started" manual guides you through six
commissioning steps to implement a functional application. While working through the
example, you will learn the basic hardware and software functions of your CPU 31x.
This process will take one to two hours, depending on your experience.
Introduction
S7-300 Automation System: Getting Started CPU 31x: Commissioning
6 Getting Started, 08/2011, A5E00164278-05
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 7
Preparation 2
Scope
These instructions apply to the following CPUs:
CPU SIMATIC Micro Memory Card
required for operation?
As of firmware
version
312 yes V3.3
314 yes V3.3
315-2 DP yes V3.3
317-2 DP yes V3.3
315-2 PN/DP yes V3.2
317-2 PN/DP yes V3.2
319-3 PN/DP yes V3.2
The order number can be found in the manuals, e.g. the operating instructions CPU 31xC
and CPU 31x: Installation (http://support.automation.siemens.com/WW/view/en/13008499).
Requirements
You need to have a basic understanding of electronics/electrical engineering. You must also
be familiar with the Microsoft® Windows™ operating system.
WARNING
Operation of an S7-300 as part of plants or systems is subject to special rules and
regulations, which depend on its field of application. Please make sure that you adhere to
the applicable safety and accident prevention regulations, for example IEC 204 (emergency
stop systems).
You risk severe injury, or damage to machines and equipment if you ignore these
regulations.
Preparation
S7-300 Automation System: Getting Started CPU 31x: Commissioning
8 Getting Started, 08/2011, A5E00164278-05
Material and tools required
Quantity Item Order number (Siemens)
1 Mounting rail e.g. 6ES7390-1AE80-0AA0
1 Power supply (PS) module e.g. 6ES7307-1EA01-0AA0
1 CPU 31x, e.g. CPU 317-2 PN/DP e.g. 6ES7317-2EK14-0AB0
1 SIMATIC Micro Memory Card
Note:
The SIMATIC Micro Memory Card is required for
operation of certain CPUs (see Scope).
e.g. 6ES7953-8LL20-0AA0
1 Digital input module (DI) with bus connector e.g. 6ES7321-1BH02-0AA0
1 Digital output module (DO) with bus connector e.g. 6ES7322-1BH01-0AA0
2 Multipin front connector with screw-type contacts e.g. 6ES7392-1AM00-0AA0
1 Programming device (PG) with MPI interface and
STEP 7 software as of V5.5 + SP 1 or V5.5 with HSP
199 installed and PG cable or
PC with suitable interface card
depending on the configuration
Various M6 screws and nuts (lengths depend on place of
installation) and matching wrench / screwdriver
commonly available
1 Screwdriver with 3.5 mm blade commonly available
1 Screwdriver with 4.5 mm blade commonly available
1 Side cutter and cable stripper commonly available
1 Crimp tool for wire ferrules commonly available
X m Cable with 10 mm2 cross-section for grounding the rail
and suitable cable lug for M6 screw. Length of cable
depends on local requirements.
commonly available
Approx.
2 m
Flexible cable with 1 mm2 cross-section and suitable
ferrules with insulated collar, length 6 mm
commonly available
X m 3-wire flexible power cable (230/120 V AC) with
"Schuko" plug; length to suit local requirements with
suitable wire-end ferrules with shrouded contacts.
commonly available
2 Single--pole ON button (24 V) commonly available
Preparation
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 9
Layout of the example
'2',36
&38
31'3
Mounting rail
Power supply ON/OFF
LEDs
SIMATIC Micro Memory Card
Mode selector
PG cable for connecting to the MPI interface
Programming device (PG) with STEP 7 software
Figure 2-1 Sample layout (certain details of the CPUs may differ from the above illustration)
Preparation
S7-300 Automation System: Getting Started CPU 31x: Commissioning
10 Getting Started, 08/2011, A5E00164278-05
89
1
10
6
7
5
2 3 4
99
/ 1
0
/
;
'&9
0
;
;
35
35
3
3
31/$1
;;;
;;;
;
03,'3
;
/
/
/
0
0
Power supply (PS) module
CPU 317-2 PN/DP
PROFINET port 1
Port 1 status is signaled by a two-colored LED (green/yellow):
LED lights up green: LINK to a partner is active
LED changes to yellow: Active data traffic (RX/TX)
R: Ring port for setting up a ring topology with media redundancy
PROFINET port 2
Port 2 status is signaled by a two-colored LED (green/yellow):
LED lights up green: LINK to a partner is active
LED changes to yellow: Active data traffic (RX/TX)
R: Ring port for setting up a ring topology with media redundancy
MAC address and 2D bar code
2. Interface X2 (PN), with dual-port switch
1. Interface X1 (MPI/DP)
Power supply connection
Connecting cables between PS and CPU
Strain relief
Figure 2-2 Wiring the power supply and CPU (front cover open)
Functionality of the example
The output can be switched by pressing the buttons when the diode on the output module is
lit.
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 11
Units 3
3.1 1. Step: Installing and Grounding the Rail
Installation sequence
From left to right: Power supply PS 307 - CPU 317-2 PN/DP.
The configuration diagram gives you an overview of the overall configuration.
Install and ground the mounting rail
1. Screw on the mounting rail (screw size: M6). Make sure to maintain a minimum clearance
of 40 mm above and below the mounting rail.
When mounting it on a grounded metal panel or on a grounded equipment mounting
panel, make sure you have a low-impedance connection between the mounting rail and
the mounting surface.
2. Connect the rail to the protective conductor. An M6 protective conductor screw is
provided on the mounting rail for this purpose.
Stipulated cross-section of the cable connection to the protective conductor: at least
10 mm2.


Units
3.1 1. Step: Installing and Grounding the Rail
S7-300 Automation System: Getting Started CPU 31x: Commissioning
12 Getting Started, 08/2011, A5E00164278-05
Installing modules on the mounting rail
1. First of all, insert the power supply module. Slide it to the left as far as the grounding
screw of the mounting rail. Fasten the power supply module.
2. To connect further modules, insert a bus connector into the CPU.
3. Hang in the CPU (1).
4. Slide it up to the left-hand module (2).
5. Now you can swivel the CPU down (3).
6. Tighten the modules with a torque of 0.8 to 1.1 Nm.
7. Insert a SIMATIC Micro Memory Card into the CPU (4).
Delete the content of a SIMATIC Micro Memory Card with unknown content before you
use it in the programming device.
8. You also need to install digital input and output modules to the right of the CPU. To do
this, repeat steps 2 to 6 as applicable.
Units
3.2 2. Step: Wiring modules
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 13
3.2 2. Step: Wiring modules
WARNING
Ensure the S7-300 is completely disconnected before wiring!
You may come into contact with live wires if the S7-300 is connected to the power supply.
Wiring the power supply and CPU
1. Open the front panels of the power supply and the CPU.
2. Detach the strain relief clip from the power supply.
3. Strip the flexible power cable.
4. Correctly crimp on wire-end ferrules.
5. Connect the ferrules to the power supply (blue to terminal M, black to terminal L1,
protective conductor to terminal PE).
6. Screw the strain relief clamp in place.
7. Next, wire the power supply to the CPU. Use flexible cable with a conductor cross-section
of 1 mm2.
Strip the ends to a length of approx. 6 mm. Crimp wire-end ferrules to the ends. Connect
power supply terminals L+ and M to the terminals on the CPU.
Wiring the Digital Input and Output Modules
1. Open the front panels of the digital input and output modules.
2. Push front connectors into the DI and the DO until they snap into position. The front
connector still protrudes from the module in this wiring position, and is not yet connected
to the module.
3. Cut around 10 wires (1mm2) to length (20 cm), and attach ferrules to the ends.
4. Wire the front connector for the digital input module as follows:
Terminal L +: To terminal L+ of the power supply
Terminal M: To terminal M of the power supply
Terminal 3: To the first connection of button 1
Terminal 4: with the first connection to button 2
Connect the two unassigned connections on buttons 1 and 2 to L+ on the power supply.
5. Wire the front connector for the digital output module as follows:
Terminal L +: To terminal L+ of the power supply
Terminal M: To terminal M of the power supply
6. Lead the wires downwards out of the front connectors.
Units
3.3 3. Step: Commissioning the Hardware
S7-300 Automation System: Getting Started CPU 31x: Commissioning
14 Getting Started, 08/2011, A5E00164278-05
7. Push in the front connector release button on the top of the module and push the front
connector into the module. The front connector is in place when the release button snaps
back into its initial position.
Note
Please note: If you are using a 40-pin front connector, it must also be fixed using the
fixing screw in the center of the front connector.
8. Close the front panels of the digital input and output modules and the power supply.
3.3 3. Step: Commissioning the Hardware
Procedure
1. Use the PG cable to connect the programming device to the CPU. When using a cable
with PROFIBUS connectors, remember to switch on the integrated terminating resistors.
Close the front panel cover of the CPU, then set the mode selector switch on the CPU to
STOP.
2. Connect mains, then switch on the power supply module.
The
DC24V
LED on the power supply is lit.
All LEDs on the CPU light up briefly. The
SF
LED and the
5V DC
LED stay on. The
STOP
LED then flashes slowly and requires a CPU memory reset.
3. Insert your SIMATIC Micro Memory Card into the CPU.
4. Perform a CPU memory reset:
Turn the mode switch to
MRES
. Hold the mode switch in this position until the
STOP
LED lights up for the second time and remains on. Then release it.
You then have 3 seconds in which to turn the mode switch back to
MRES
. The
STOP
LED begins to flash rapidly. The CPU performs a memory reset. You can now release
the mode switch. The CPU has completed the memory reset when the
STOP
LED
remains permanently lit again.
5. Start your programming device, then run SIMATIC Manager from your Windows Desktop.
A window opens with SIMATIC Manager.
6. Select button 1.
The LED for the first input lights up.
7. Select button 2.
The LED for the second input lights up.
Units
3.4 4. Step: Configuring hardware in HW-Configuration of STEP 7
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 15
3.4 4. Step: Configuring hardware in HW-Configuration of STEP 7
Create a new project in STEP 7:
1. Select the File > New... menu command.
Enter a name for your project and click on OK to confirm.
A new project is created
Add a new S7-300 station
1. Select the Insert > Station > SIMATIC 300 Station menu command.
The SIMATIC 300 (1) icon in the right-hand part of the window is highlighted.
Add a rail
1. In the right-hand part of the window, double-click first on the SIMATIC 300(1) icon and
then on the Hardware icon.
The hardware configuration editor (HW Config) opens.
2. You can insert your hardware components from the hardware catalog in the left-hand part
of the window.
If no catalog is displayed, activate the catalog using the View > Catalog menu command.
In the hardware catalog, navigate to Rack-300 via SIMATIC 300. Copy the rail by
dragging and dropping it in the right-hand part of the window.
The rail is inserted in the right-hand part of the window
Add the power supply:
1. In the hardware catalog, navigate to PS-300. Drag your power supply and drop it into slot
1 on the rail.
Note
Note: You can click on the power supply to display its order number. The order number
then appears in the box beneath the catalog.
The power supply module is inserted into slot 1.
Add the CPU:
1. In the hardware catalog, navigate to CPU-300. Drag your CPU and drop it into slot 2 on
the rail.
The CPU is inserted into slot 2.
Units
3.5 5. Step: Programming a circuit
S7-300 Automation System: Getting Started CPU 31x: Commissioning
16 Getting Started, 08/2011, A5E00164278-05
Add the digital input and output modules:
1. In the hardware catalog, navigate to DI-300 via SM-300 and select your digital input
module.
Drag the digital input module to the rail and drop it into slot 4.
The digital input module is inserted into slot 4.
2. In the hardware catalog, navigate to DO-300 via SM-300 and select your digital output
module.
Drag the digital output module to the rail and drop it into slot 5.
The digital output module is inserted into slot 5.
Save and compile your configuration:
1. Select the
Save and Compile
command from the
Station
menu.
The hardware configuration is compiled and saved.
2. Close the editor.
The editor is closed.
The CPU now appears in the station in SIMATIC Manager.
3.5 5. Step: Programming a circuit
Procedure
1. In the right-hand section of the window, double-click on the CPU icon, then on the S7
Program icon, then on the Blocks icon and finally on the OB 1 icon.
The “Properties” dialog for OB 1 is displayed.
2. From the properties of the organizational block, select the programming language LAD.
Click on OK to confirm.
The program editor opens.
3. Carefully click on the horizontal line representing the current path.
The line is highlighted.
4. On the toolbar, click twice on the --||-- icon (normally-open contact) and then once on the
–( ) icon (coil).
The icons are inserted into the current path.
5. Click on the red question mark for the left-hand normally- open contact in the current
path.
The normally-open contact is highlighted. The question mark is replaced with a text input
box containing the cursor.
Units
3.5 5. Step: Programming a circuit
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 17
6. Enter
E0.1
and press
Return
.
The left-hand normally-open contact is now called
E0.1
.
7. Label the right-hand button in the same way with
E0.2
and the coil with
A4.0
.
8. Close the editor with the menu command "File > Close". Answer the save prompt with
Yes
.
The editor is closed and OB 1 is saved.
Units
3.6 6. Step: Test Run
S7-300 Automation System: Getting Started CPU 31x: Commissioning
18 Getting Started, 08/2011, A5E00164278-05
3.6 6. Step: Test Run
Procedure
1. Use the SIMATIC 300 station and
your CPU
to browse to the S7 program.
In SIMATIC Manager, click on Blocks in the right-hand part of the window.
Blocks
will now be highlighted.
2. Select "Download" from the "Target system" menu to transfer the program and hardware
configuration to the CPU. Confirm all windows with
Yes
.
The program and configuration are downloaded from the programming device to the
CPU. The program is now stored on the Micro Memory Card (in the load memory), where
it is unaffected by power failures and resets.
3. Set the CPU's mode switch to
RUN
.
The
STOP
LED is switched off. The
RUN
LED starts to flash and then assumes a
continuous signal.
4. Press each of the buttons alternately.
The LEDs of each input will light up in turn.
5. Press both buttons simultaneously.
The LEDs of both inputs will light up at the same time.
The LED for the first output lights up.
This equates to connection of a connected final controlling element or display.
S7-300 Automation System: Getting Started CPU 31x: Commissioning
Getting Started, 08/2011, A5E00164278-05 19
Further Information 4
Diagnostics/Correction of Errors
Wrong operation, faulty wiring or a faulty hardware configuration may cause errors which the
CPU indicates with the
SF
group error LED after a CPU memory reset.
For information on how to diagnose such errors and alarms, please refer to the operating
instructions, CPU 31xC and CPU 31x: Installation
(http://support.automation.siemens.com/WW/view/en/13008499).
Manuals containing further information
For more in-depth Getting Started information, we recommend Getting Started and
Exercises with STEP 7 (http://support.automation.siemens.com/WW/view/en/45531551).
Service & Support on the Internet
In addition to our documentation, we offer a comprehensive knowledge base on the Internet
(http://www.siemens.com/automation/service&support).
There you can find:
A newsletter containing the latest information on your Siemens products.
The documents you need using the search engine in Service & Support.
the bulletin board, a worldwide knowledge exchange for users and experts.
Your local contact for Automation & Drives in our contact database.
Information about on-site services, repairs and spare parts. You will find much more
under "Services".
Further Information
S7-300 Automation System: Getting Started CPU 31x: Commissioning
20 Getting Started, 08/2011, A5E00164278-05