S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

Embed Size (px)

Citation preview

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    1/20

    First Steps in Commissioning CPU1xC: Positioning with digital output

    ___________________

    ___________________

    ___________________

    ___________________

    SIMATICS7-300First Steps in Commissioning CPU 31xC:Positioning with digital outputGetting Started

    08/2011A5E00105533-03

    Introduction 1

    Preparation 2

    Learning units 3

    Further Information 4

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    2/20

    Legal informationLegal informationWarning notice system

    This manual contains notices you have to observe in order to ensure your personal safety, as well as to preventdamage to property. The notices referring to your personal safety are highlighted in the manual by a safety alertsymbol, notices referring only to property damage have no safety alert symbol. These notices shown below aregraded according to the degree of danger.

    DANGERindicates that death or severe personal injury will result if proper precautions are not taken.

    WARNINGindicates that death or severe personal injury may result if proper precautions are not taken.

    CAUTIONwith a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.

    CAUTIONwithout a safety alert symbol, indicates that property damage can result if proper precautions are not taken.

    NOTICEindicates 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 willbe used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating toproperty damage.

    Qualified PersonnelThe product/system described in this documentation may be operated only by personnel qualified for the specifictask 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 andavoiding potential hazards when working with these products/systems.

    Proper use of Siemens productsNote the following:

    WARNINGSiemens products may only be used for the applications described in the catalog and in the relevant technicaldocumentation. If products and components from other manufacturers are used, these must be recommendedor approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation andmaintenance are required to ensure that the products operate safely and without any problems. The permissibleambient conditions must be complied with. The information in the relevant documentation must be observed.

    TrademarksAll names identified by are registered trademarks of Siemens AG. The remaining trademarks in this publicationmay be trademarks whose use by third parties for their own purposes could violate the rights of the owner.

    Disclaimer of LiabilityWe have reviewed the contents of this publication to ensure consistency with the hardware and softwaredescribed. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, theinformation in this publication is reviewed regularly and any necessary corrections are included in subsequenteditions.

    Siemens AGIndustry SectorPostfach 48 48

    90026 NRNBERGGERMANY

    A5E00105533-03 09/2011

    Copyright Siemens AG 2011.Technical data subject to change

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    3/20

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 3

    Table of contents

    1 Introduction................................................................................................................................................ 52 Preparation................................................................................................................................................ 73 Learning units .......................................................................................................................................... 11

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

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

    3.3 3. Step: Setting parameters .........................................................................................................15

    3.4 4. Step: Linking blocks to the user program ................................................................................163.5 5. Step: Carrying out a dry run.....................................................................................................17

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

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    4/20

    Table of contents

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    4 Getting Started, 08/2011, A5E00105533-03

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    5/20

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 5

    Introduction 1

    Contents of this Getting Started ManualBased on a concrete example, this Getting Started manual takes you through fivecommissioning steps to the point where you have a functioning traversing movement. Youwill get to know certain basic hardware and software functions and will calculate and checkthe application-dependent parameters in this sample.

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

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    6/20

    Introduction

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    6 Getting Started, 08/2011, A5E00105533-03

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    7/20

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 7

    Preparation 2

    ScopeThese instructions apply to the following CPUs:

    CPU SIMATIC Micro Memory Cardrequired for operation?

    As of firmwareversion

    314C-2 DP yes V3.3

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

    The order number can be found in the manuals, e.g. the operating instructions CPU 31xCand CPU 31x: Installation (http://support.automation.siemens.com/WW/view/en/13008499).

    http://support.automation.siemens.com/WW/view/en/13008499http://support.automation.siemens.com/WW/view/en/13008499
  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    8/20

    Preparation

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    8 Getting Started, 08/2011, A5E00105533-03

    Requirements You have an S7 300 station consisting of a power supply module and a CPU 314C-2 PtP,

    314C-2 DP or 314C-2 PN/DP. STEP 7 is correctly installed on your PG.

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

    CPU STEP 7 version314C-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 sampleprojects 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 have an external 24 V DC power supply, an encoder, a drive, and the necessary

    accessories, such as a front connector and wiring material.

    You provided hardware limit switches and EMERGENCY-OFF switches for safe andreliable operation of the system.

    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 andregulations, which depend on its field of application.

    Please make sure that you adhere to the applicable safety and accident preventionregulations, for example IEC 204 (emergency stop systems).

    You risk severe injury, or damage to machines and equipment if you ignore theseregulations.

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    9/20

    Preparation

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 9

    Layout of the example2 3

    7 6 5 4

    1

    Setting of supply voltage

    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

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    10/20

    Preparation

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    10 Getting Started, 08/2011, A5E00105533-03

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    11/20

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 11

    Learning units 33.1 1. Step: Wire the CPU

    WARNINGYou can come into contact with live wires if the PS 307 power supply module is turned onor the PS power supply cable is connected to the main power supply. Ensure the S7-300 iscompletely disconnected before wiring!

    Procedure1. Connect the wired front connector to the CPU.2. Fasten the connector.3. Connect the power supply for the digital inputs and digital outputs:

    24 V to X2, pins 1 and 31 Ground to X2, pins 20 and 40

    4. Connect the incremental encoder to the 24 V power supply.5. Connect the encoder signals (X2, pins 2 to 4).

    ,QFUHPHQWDOHQFRGHUV

    6LJQDO$

    6LJQDO%

    6LJQDO1

    ; ;

    0/0

    9

    6. Connect the relay circuit to the power supply.

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    12/20

    Learning units

    3.1 1. Step: Wire the CPU

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    12 Getting Started, 08/2011, A5E00105533-03

    7. Connect the wires of the relay circuit (X2, pin 32 to 35 and pin 40)./RDGFLUFXLW

    3RZHUFRQWUROFLUFXLW

    3ROHFKDQJLQJ

    PRWRU

    1RUPDOO\

    FORVHG

    FRQWDFW

    (+DUGZDUHOLPLWVZLWFKPLQXV(+DUGZDUHOLPLWVZLWFKSOXV

    .3OXVGLUHFWLRQ

    .0LQXVGLUHFWLRQ

    .5DSLGWUDYHUVH

    .&UHHSVSHHG

    / / /

    .

    .

    .

    .

    ; ;

    . . . .

    ( (

    0

    0

    . . . .

    8. Strip the insulation from the shielded cables.9. Clamp the cable shield into the shield connection element. using the shield terminal

    elements.

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    13/20

    Learning units

    3.1 1. Step: Wire the CPU

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 13

    Connector pin assignmentThe pin assignments described below relate only to the connections relevant for the

    positioning type.

    Table 3- 1 CONNECTOR X2

    Pin Name/address Function1 1 L+ 24 V power supply of the inputs

    2 DI + 0.0 Encoder signal A

    3 DI + 0.1 Encoder signal B

    4 DI + 0.2 Encoder signal N

    5 DI + 0.3 Length measurement

    6 DI + 0.4 Reference point switch

    20 1 M Ground

    31 3 L+ 24 V power supply of the outputs

    32 DO + 1.0 Digital output Q0

    33 DO + 1.1 Digital output Q1

    34 DO + 1.2 Digital output Q2

    35 DO + 1.3 Digital output Q3

    40 3 M Ground

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

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    14/20

    Learning units

    3.2 2. Step: Installing the sample project

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    14 Getting Started, 08/2011, A5E00105533-03

    3.2 2. Step: Installing the sample projectIntroduction

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

    Installing from CD1. 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.

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    15/20

    Learning units

    3.3 3. Step: Setting parameters

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 15

    3.3 3. Step: Setting parametersProcedure

    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 "Positioning".The "Positioning properties" dialog opens.

    4. Select "Positioning with digital outputs".5. On the drive, axis and encoder tabs, customize the settings according to your system.6. Confirm your settings with "OK".

    The "Positioning properties" dialog closes.

    NoteThe 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 theaddresses 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..799Confirm your settings with "OK".

    7. Save your configuration to your project with "Station > Save and compile".Your changes are now stored in your project.

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    16/20

    Learning units

    3.4 4. Step: Linking blocks to the user program

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    16 Getting Started, 08/2011, A5E00105533-03

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

    The data are now downloaded from the PG to the CPU.9. Close HW Config with "Station > Close".

    You are returned to SIMATIC Manager.

    3.4 4. Step: Linking blocks to the user programProcedure

    1. Open the project "ZDt26_03_TF_____31xC_Pos" 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 "Digital 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) DescriptionOB 1 CYCLE_EXC Cyclic program

    OB 100* COMPLETE RESTART Complete restart: Reset the control signals

    FC 1 GETST_A Getting Started DIGITAL

    SFB 46 DIGITAL System function block POS DIGITAL

    DB 6 DI_DIGITAL Instance DB for the SFB DIGITAL

    VAT_GETST_A VAT_GETST_A Variable table

    * Adjust the values for the switchover and shutdown difference in the block COMPLETERESTART (OB 100).

    5. In SIMATIC Manager, select "SIMATIC 300 Station > CPU 3xx > S7 Program > Blocks".All blocks of the S7 program are displayed.

    6. Download all of the S7 blocks it contains via "PLC > Download to your CPU" (CPU inSTOP mode).

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

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    17/20

    Learning units

    3.5 5. Step: Carrying out a dry run

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 17

    3.5 5. Step: Carrying out a dry runProcedure

    1. In the "Blocks" directory, double-click on the variable table "VAT_GETST_d" in yourproject.

    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.

    CAUTIONThe next two test steps start the drive.

    You can stop the drive in one of the following ways:

    Set the control value for the direction to 0 again and activate it Set the control value for the drive enable to 0 again and activate it Change the CPU to STOP

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

    5. Try out the two following experiments. With "Variable > Activate Modify Values", you canmake the control values valid.

    "Jogging" modeMake the following settings:

    MODE_IN = 1:Select "Jogging" mode

    DRV_EN = 1:drive enable

    SPEED:

    Speed: 0 = Creep speed, 1 = Rapid traverseStarting the drive:DIR_P = 1: Jogging in plus directionDIR_M = 1: Jogging in minus direction

    Note: If both variables DIR_P and DIR_M areactivated, no positioning is possible.

    You can monitor the following signal statuses inthe column "Status Value":

    ST_ENBL = 1:Start enable

    MOD_OUT = 1:Current mode "Jogging"

    WORKING = 1:

    Travel activeACT_POS:Current actual position

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    18/20

    Learning units

    3.5 5. Step: Carrying out a dry run

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    18 Getting Started, 08/2011, A5E00105533-03

    "Incremental approach, relative" modeMake the following settings:

    MODE_IN = 4:Select "Incremental approach, relative" mode

    DRV_EN = 1:drive enable

    TARGET:Distance in pulses

    SPEED:Speed: 0 = Creep speed, 1 = Rapid traverse

    Start drive:DIR_P = 1: Incremental approach, relative in plusdirectionDIR_M = 1: Incremental approach, relative inminus direction

    You can monitor the following signal statuses in

    the column "Status Value":ST_ENBL = 1:Start enable

    MOD_OUT = 4:Current mode "Incremental approach, relative"

    WORKING = 1:Travel active

    ACT_POS:Current actual position

    POS_RCD = 1:Position reached

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    19/20

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    Getting Started, 08/2011, A5E00105533-03 19

    Further Information 4

    Diagnostics/Correction of ErrorsIncorrect 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-300documentation.

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

  • 7/27/2019 S7-300 First Steps in Commissioning CPU 31xC Positioning With Digital Output

    20/20

    Further Information

    First Steps in Commissioning CPU 31xC: Positioning with digital output

    20 Getting Started, 08/2011, A5E00105533-03