20
Getting Started - Commissioning a CPU 31xC: Counting _____________________________________ _____________________________________ SIMATIC S7-300 Getting Started - Commissioning a CPU 31xC: Counting Getting Started 08/2011 A5E00105536-03 Introduction 1 Preparation 2 Learning units 3 Further Information 4

Siemens S7-300 Getting Started - Commissioning a CPU 31xC

Embed Size (px)

DESCRIPTION

Siemens S7-300Getting Started - Commissioning aCPU 31xC

Citation preview

Page 1: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

� Getting Started - Commissioning a CPU

�31xC: Counting

___________________

___________________

___________________

___________________

SIMATIC

S7-300 Getting Started - Commissioning a CPU 31xC: Counting

Getting Started

08/2011 A5E00105536-03

Introduction 1

Preparation 2

Learning units 3

Further Information 4

Page 2: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

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

A5E00105536-03 Ⓟ 09/2011

Copyright © Siemens AG 2011. Technical data subject to change

Page 3: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 3

Table of contents

1 Introduction................................................................................................................................................ 5

2 Preparation ................................................................................................................................................ 7

3 Learning units .......................................................................................................................................... 11

3.1 1. Step: Wire the CPU..................................................................................................................11

3.2 2. Step: Installing the sample project...........................................................................................13

3.3 3. Step: Setting parameters .........................................................................................................14

3.4 4. Step: Linking to the user program............................................................................................16

3.5 5. Step: Trial run ..........................................................................................................................17

4 Further Information .................................................................................................................................. 19

Page 4: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Table of contents

Getting Started - Commissioning a CPU 31xC: Counting 4 Getting Started, 08/2011, A5E00105536-03

Page 5: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 5

Introduction 1

Contents of this Getting Started Manual The sample in this Getting Started manual takes you through five steps, showing you how to commission a fully functional counter application. You are going to familiarize yourself with the basic hardware and software functions and learn how to operate the counting function.

This process will take one to two hours, depending on your experience.

Page 6: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Introduction

Getting Started - Commissioning a CPU 31xC: Counting 6 Getting Started, 08/2011, A5E00105536-03

Page 7: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 7

Preparation 2

Scope These instructions apply to the following CPUs:

CPU SIMATIC Micro Memory Card

required for operation? As of firmware version

312C yes V3.3 313C yes V3.3 313C-2 PtP yes V3.3 313C-2 DP yes V3.3 314C-2 PtP yes V3.3 314C-2 DP yes V3.3 314C-2 PN/DP yes V3.3

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).

Page 8: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Preparation

Getting Started - Commissioning a CPU 31xC: Counting 8 Getting Started, 08/2011, A5E00105536-03

Requirements ● You have an S7 300 station consisting of a power supply module and a CPU 31xC.

● STEP 7 as of V5.5 is correctly installed on your PG.

The table below shows the STEP 7 version you need for each CPU.

CPU STEP 7 version 312C STEP 7 as of V5.5 + SP1 or STEP 7 as of V5.3 + SP2 with HSP 203 313C STEP 7 as of V5.5 + SP1 or STEP 7 as of V5.3 + SP2 with HSP 203 313C-2 PtP STEP 7 as of V5.5 + SP1 or STEP 7 as of V5.3 + SP2 with HSP 204 313C-2 DP STEP 7 as of V5.5 + SP1 or STEP 7 as of V5.3 + SP2 with HSP 203 314C-2 PtP STEP 7 as of V5.5 + SP1 or STEP 7 as of V5.3 + SP2 with HSP 204 314C-2 DP STEP 7 as of V5.5 + SP1 or STEP 7 as of V5.3 + SP2 with HSP 203 314C-2 PN/DP STEP 7 as of V5.5 with HSP 191

● You have downloaded the sample projects from the Internet or have the CD of sample projects included with the Technological Functions operating instructions.

● You have set up a project for the S7-300 station.

● The PG is connected to the CPU.

● You are set up with all the required accessories, e.g., front connector and wiring material.

● The CPU is correctly connected to a power supply.

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.

Page 9: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Preparation

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 9

Layout of the example

2 3

7 6 5 4

1

① Power supply ON/OFF ② Mode selector ③ Mounting rail ④ Programming device with STEP 7 software ⑤ PG cable ⑥ Connecting cable ⑦ Clamp for strain relief

Figure 2-1 Overview of sample layout

Page 10: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Preparation

Getting Started - Commissioning a CPU 31xC: Counting 10 Getting Started, 08/2011, A5E00105536-03

Page 11: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 11

Learning units 33.1 1. Step: Wire the CPU

WARNING Ensure the S7-300 is completely disconnected before wiring!

You can come into contact with live wires if the PS 307 power supply module is turned on or the PS power supply cable is connected to the main power supply.

Procedure 1. Connect the front connector to the CPU.

2. Fasten the front connector.

3. Wire the connections for the "Counting" sample project as follows:

Connector pin assignment The pin assignments described below relate only to the connections relevant for the positioning type.

Connection X11: CPU 312C

Name/ address

Sample function

2 DI + 0.0 Pulse input 3 DI + 0.1 Direction bit 4 DI + 0.2 Hardware gate 8 DI + 0.6 Latch input 12 2 M Reference potential of the supply voltage 13 1 L+ 24 V DC power supply 16 DO + 0.2 Simulation: Connecting pulse input → to DI + 0.0 17 DO + 0.3 Simulation: Connecting direction bit → to DI + 0.1 18 DO + 0.4 Simulation: Connecting hardware gate → to DI + 0.2 19 DO + 0.5 Simulation: Connecting latch input → to DI + 0.6 20 1 M Reference potential of the supply voltage

Page 12: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Learning units 3.1 1. Step: Wire the CPU

Getting Started - Commissioning a CPU 31xC: Counting 12 Getting Started, 08/2011, A5E00105536-03

Connection X11: CPU 313C-2 DP/PtP X12: CPU 313C, 314C-2 DP/PtP, 314C-2 PN/DP

Name/ address

Function

1 1 L+ 24 V power supply of the inputs 2 DI + 0.0 Pulse input 3 DI + 0.1 Direction bit 4 DI + 0.2 Hardware gate 16 DI + 1.4 Latch input 20 1 M Reference potential of the supply voltage 21 2 L+ 24 V power supply of the outputs 24 DO + 0.2 Simulation: Connecting pulse input → to DI + 0.0 25 DO + 0.3 Simulation: Connecting direction bit → to DI + 0.1 26 DO + 0.4 Simulation: Connecting hardware gate → to DI + 0.2 27 DO + 0.5 Simulation: Connecting latch input → to DI + 1.4 30 2 M Reference potential of the supply voltage

The figure shows the CPU 314C with a standard plug arrangement for CPUs with two connectors (X11 and X12).

X11 X12

54

123

6789

10

1514

111213

1617181920

2524

212223

2627282930

54

123

6789

10

1514

111213

1617181920

2524

212223

2627282930

3534

313233

3637383940

Reference You will find information on the remaining connections in the documentation of the S7-300.

Page 13: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Learning units 3.2 2. Step: Installing the sample project

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 13

3.2 2. Step: Installing the sample project

Introduction When installing the sample project, you have the following options:

Installing from CD 1. Take the CD out of the Technological Functions operating instructions.

2. Start the installation program on the CD by double-clicking on the SETUP.EXE file in the SETUP folder.

The installation program is started.

3. Now follow the instructions in the installation program.

Installing from the Internet 1. Open the directory with the sample projects.

2. Start the installation program by double-clicking the SETUP.EXE file.

The installation program is started.

3. Now follow the instructions in the installation program.

Page 14: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Learning units 3.3 3. Step: Setting parameters

Getting Started - Commissioning a CPU 31xC: Counting 14 Getting Started, 08/2011, A5E00105536-03

3.3 3. Step: Setting parameters

Procedure 1. Open your project in SIMATIC Manager.

A window, divided into two sections, opens showing the title of your project.

2. In your project, call the configuration table HW Config.

3. Double-click on the submodule "Counting".

The "Counting properties" dialog opens.

4. Select channel 0 and "Continuous counting" mode.

5. Make the following settings in the parameter assignment screens (do not modify any other settings, as they are not required for commissioning):

– Input: Hardware gate

– Output reaction: Counter value ≥ Comparison value

Page 15: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Learning units 3.3 3. Step: Setting parameters

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 15

6. Confirm your settings with "OK".

The "Counting properties" dialog closes.

Note

The input and output address of the submodules "DI24/DO16", "AI5/02", "Counting" and "Positioning" must be adapted for the example to function correctly.

Double-click the relevant line to adapt the submodule. A dialog opens. Select the "Addresses" tab in each case. Deselect the "System default" checkboxes. Change the addresses as follows: DI24/DO16: Inputs: 124..126, Outputs: 124..125 AI5/AO2: Inputs: 752..761, Outputs: 752..755 Counting: Inputs: 768..783, Outputs:/768..783 Positioning: Inputs: 784..799, Outputs: 784..799

Confirm your settings with "OK".

7. Save your configuration to your project with "Station > Save and compile".

Your changes are now stored in your project.

8. When the CPU is in STOP, select "PLC > Download to module ..." to download the configuration.

The data are now downloaded from the PG to the CPU.

9. Close HW Config with "Station > Close".

You are returned to SIMATIC Manager.

Page 16: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Learning units 3.4 4. Step: Linking to the user program

Getting Started - Commissioning a CPU 31xC: Counting 16 Getting Started, 08/2011, A5E00105536-03

3.4 4. Step: Linking to the user program

Procedure 1. Open the project "ZDt26_02_TF_____31xC_Cnt" in the catalog ...

\Siemens\STEP7\Examples via "File > Open ... > Sample projects" in SIMATIC Manager.

A window, divided into two sections, opens showing the title of the project.

2. Double-click on the S7 program "Count 1 First Steps".

The "Sources", "Blocks" and "Symbols" folders are displayed in the right-hand window.

3. Double-click on the "Blocks" container.

All blocks of the S7 program are displayed.

4. Copy all blocks from this folder to your project under "SIMATIC 300 Station > CPU 3xx > S7 Program > Blocks".

Block Name (in the toolbar) Description OB 1 CYCLE_EXC Cyclic program FB 11 GETST_C Example 1: COUNT, first steps DB 11 DI_GETST_C Instance DB for GETST_C SFB 47 COUNT SFB COUNT DB 16 DI_COUNT Instance DB for SFB COUNT VAT VAT_GETST_C Variable table

5. Copy the symbol table to your project under "SIMATIC 300 Station > CPU3 xx > S7 Program".

The symbol table is stored in your project.

6. In SIMATIC Manager, select "SIMATIC 300 Station > CPU 3xx > S7 Program > Blocks".

All blocks of the S7 program are displayed.

7. Download all of the S7 blocks it contains to your CPU via "PLC > Download" (CPU in STOP mode).

The program and configuration are downloaded from the PG to the CPU.

Page 17: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Learning units 3.5 5. Step: Trial run

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 17

3.5 5. Step: Trial run

Procedure 1. In the "Function blocks" directory, double-click on the variable table "VAT_GETST_C" in

your project.

The variable table for monitoring and modifying is displayed.

2. Go online with "PLC > Connect to > Configured CPU".

At the bottom right, you will see that the CPU is set to "STOP" mode.

3. Activate monitoring with "Variable > Monitor".

The current values of the addresses are displayed in the "Status Value" column.

4. Switch the CPU to RUN.

At the bottom right, you will see that the CPU is set to "RUN" mode.

5. In the variable S_IMP_H of the VAT, select the count pulse source:

– S_IMP_H = 0:

The pulse source is a programmed SW clock generator. Its frequency is adjustable via the T_PULSE variable. The clock is connected to the pulse input via a digital output.

– S_IMP_H = 1:

Specify the count pulses by manually setting and resetting the S_IMP_T variable in the VAT.

6. You can perform the following tests:

Starting/stopping the counter:

Start the counter by setting the variables SW_GATE (SFB parameter SW gate) and S_HWT (simulation of HW gate) in the VAT to 1 (logical AND).

Stop the counter by resetting S_HWT or SW_GATE to zero.

You can monitor the actual counter value at the SFB output parameter COUNTVAL. You can view the status of the SW or HW gate in the variables STS_GATE or STS_STRT.

Loading a count value to the counter:

JOB_ID = 01 hex ("Write counter directly") JOB_VAL = Count value (-231 to +231-1) JOB_REQ = 1, Job initiates with positive

edge

You can view the loaded count value at the SFB output parameter COUNTVAL. If no load error has occurred, the status at the output parameters is JOB_DONE = 1 and JOB_ERROR = 0.

Page 18: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Learning units 3.5 5. Step: Trial run

Getting Started - Commissioning a CPU 31xC: Counting 18 Getting Started, 08/2011, A5E00105536-03

Page 19: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Getting Started - Commissioning a CPU 31xC: Counting Getting Started, 08/2011, A5E00105536-03 19

Further Information 4

Diagnostics/Correction of Errors Incorrect operator input, faulty wiring or inconsistent configuration data may lead to errors.

For information on how to analyze such errors and messages, refer to the S7-300 documentation.

Example: The "ZEn26_02_TF_____31xC_Cnt" project contains further samples you can use for orientation. You can customize all samples according to your personal applications.

Page 20: Siemens S7-300  Getting Started - Commissioning a  CPU 31xC

Further Information

Getting Started - Commissioning a CPU 31xC: Counting 20 Getting Started, 08/2011, A5E00105536-03