63
Applications & Tools Answers for industry. SINAMICS G: Speed Control for a G120C using S7-1200 via PROFINET with Safety Integrated (via terminal) (via GSDML file) SINAMICS G120C, SIMATIC S7-1200 Application Description March 2013

56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

Embed Size (px)

Citation preview

Page 1: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

Applications & Tools

Answers for industry.

SINAMICS G: Speed Control for a G120C using S7-1200 via PROFINET with Safety Integrated (via terminal) (via GSDML file)

SINAMICS G120C, SIMATIC S7-1200

Application Description March 2013

Page 2: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

2 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Siemens Industry Online Support This article is taken from the Siemens Industry Online Support. The following link takes you directly to the download page of this document. http://support.automation.siemens.com/WW/view/en/56749384 Warning: The functions and solutions described in this entry are mainly limited to the realization of the automation task. In addition, please note that suitable security measures in compliance with the applicable Industrial Security standards must be taken, if your system is interconnected with other parts of the plant, the company network or the Internet. For further information on this issue, please refer to Entry ID 50203404. http://support.automation.siemens.com/WW/view/en/50203404.

Page 3: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 3

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

s

SIMATIC SINAMICS G120C PN at S7-1200

Task 1

Solution 2

Setup and Commissioning of the Application

3 Operation of the Application

4 Function Mechanisms of this Application

5 Configuration and Settings

6

Literature 7

History 8

Page 4: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

Warranty and Liability

4 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Warranty and Liability Note The application examples are not binding and do not claim to be complete

regarding configuration, equipment and any eventuality. The application examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for ensuring that the described products are used correctly. These application examples do not relieve you of the responsibility to use sound practices in application, installation, operation and maintenance. When using these application examples, you recognize that we will not be liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these application examples at any time without prior notice. If there are any deviations between the recommendations provided in this application example and other Siemens publications (e.g. catalogs), the contents of the other documents shall have priority.

We accept no liability for information contained in this document. Any claims against us – based on whatever legal reason – resulting from the use of the examples, information, programs, engineering and performance data etc., described in this Application Example shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or violation of fundamental contractual obligations. The damages for a breach of a substantial contractual obligation are, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change in the burden of proof to your detriment. It is not permissible to transfer or copy these Application Examples or excerpts thereof without express authorization from Siemens Industry Sector.

Page 5: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

Table of Contents

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 5

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Table of Contents Warranty and Liability .............................................................................................. 4 1 Task................................................................................................................. 6 2 Solution........................................................................................................... 7

2.1 Overview of the general solution ........................................................ 7 2.2 Description of the core functionality .................................................... 8 2.2.1 Parameterization of the communication ............................................. 8 2.2.2 Data exchange .................................................................................. 8 2.3 Used hardware and software components ....................................... 10

3 Setup and Commissioning of the Application ............................................ 12

3.1 Wiring .............................................................................................. 12 3.2 IP addresses and PN device names ................................................ 13 3.3 Settings on PG/PC .......................................................................... 14 3.4 Downloading the SINAMICS configuration ....................................... 15 3.5 Downloading the SIMATIC program ................................................. 18

4 Operation of the Application ........................................................................ 22

4.1 Prerequisites ................................................................................... 22 4.2 Operation the application via the panel ............................................ 23 4.2.1 Screens and screen navigation ........................................................ 23 4.2.2 Process data exchange ................................................................... 24 4.2.3 Parameter access ............................................................................ 28 4.3 Operating the application via watch table ......................................... 30

5 Function Mechanisms of this Application ................................................... 32 5.1 Process data exchange functionality ................................................ 33 5.1.1 Access to process data in the user program of the controller ............ 33 5.1.2 Setpoint and actual value normalization ........................................... 33 5.1.3 Transfer methods ............................................................................ 34 5.1.4 Control and status word ................................................................... 35 5.1.5 FB 11 “Process_Data_SFC” ............................................................ 36 5.1.6 FB 14 “Process_Data_MOVE” ......................................................... 39 5.2 Parameter access functionality ........................................................ 41 5.2.1 Request and response structure ...................................................... 41 5.2.2 The DBs “read/write_drive_parameters” and

“answer_from_drive” ........................................................................ 42 5.2.3 The FB “Parameters” ....................................................................... 43

6 Configuration and Settings .......................................................................... 47

6.1 Configuring the S7-1200 controller ................................................... 47 6.2 Configuration of the SINAMICS G120C PN drive ............................. 52 6.3 Programming the S7-1200 ............................................................... 59 6.3.1 Creating the DBs for the data records .............................................. 59 6.3.2 Parameterizing the instructions DPRD_DAT/DPWR_DAT and

WRREC and RDREC ...................................................................... 59 7 Literature ...................................................................................................... 63 8 History .......................................................................................................... 63

Page 6: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

1 Task

6 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

1 Task SIMATIC S7-1200 can be operated as PROFINET Controller. A SINAMICS G120C PN drive can be employed as PROFINET Device and be controlled by the S7-1200. This application example illustrates how to commission SINAMICS G120C PN and S7-1200, and how to access process data and parameters.

Overview of the automation task The following figure gives an overview of the automation task. Figure 1-1: Overview

PROFINET

SIN

AMIC

S

SIMATICS7-1200

Requirements for the automation problem Table 1-1: Requirements for the automation problem

Requirement Explanation

Access to process data The SINAMICS G120C shall be switched on and off via the control word and the setpoint speed value shall be specified, all as quickly as possible.

Access to parameters Read and write access from the controller to parameters in the converter (for example: ramp-up and ramp-down time) shall be possible. This shall be performed using as few resources as possible, i.e. with as low a communication load as possible.

Safety function of the SINAMICS G120C

The SINAMICS converters have the capability to perform a failsafe shutdown (e.g. emergency stop).

Page 7: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

2 Solution 2.1 Overview of the general solution

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 7

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

2 Solution This application example shows the example of connecting a SINAMICS G120C to a S7-1212C by using a GSDML file. In this respect blocks are used, which you can implement in your own application.

2.1 Overview of the general solution

Schematic layout The following figure displays the most important components of the solution: Figure 2-1: Circuitry of components

PROFINET

SINAMICS G120C PN S7-1212C KTP 600

Motor

Switch

PC/PG

SIN

AM

ICS

SIMATICS7-1200

The example shows how the:

...S7-1200 controller is configured. ...communication in the S7-1200 controller is programmed. ...SIMANICS G120C PN converter is configured using STARTER.

Page 8: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

2 Solution 2.2 Description of the core functionality

8 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

2.2 Description of the core functionality

2.2.1 Parameterization of the communication

Controller and converter are programmed with independent software packages, therefore, the communication data must be entered twice.

SIMATIC S7-1200 SIMATIC S7-1200 is programmed in STEP 7 (TIA portal). To include the drive and the message frame type in the hardware catalog in STEP 7 a device description file (GSDML1) of the SINAMICS G120C PN must be imported. When inserting (by drop & drag) the G120C PN from the hardware catalogue into the network graphics view, the IO addresses, are also defined which shall be used by the controller for accessing the converter. When inserting (by drop & drag) the G120C PN from the hardware catalogue into the network graphics view, STEP 7 defines the IO addresses, which are used for accessing the G120C PN.

SINAMICS The G120C PN is programmed with commissioning tool STARTER. For SINAMICS one of several message frame types can be selected for the data exchange. This defines which data is sent or received in which order.

NOTICE It is important that the same message frame type is selected with parameterizing both, the S7-1200 and the SINAMICS G120C PN.

2.2.2 Data exchange

Data exchange between G120C PN and S7-1200 occurs in two areas: Process data,

i.e. control word(s) and setpoint(s), or status word(s) and actual value(s) Parameter area,

i.e. reading/writing of parameter values

NOTE While process data exchange can be used on its own, reading/writing parameters is not a stand-alone function. For an acyclic parameter transfer also the cyclic process data exchange has to be installed. Get further information in chap. 6.3.2.

1 In contrast to PROFIBUS GSD files (Generic Station Description), which are pure text files, for PROFINET IO GSDML files a XML based language is used. Both file types equally serve STEP 7 as a basis for planning the configuration of Distributed I/Os. So both file types are often only named GSD files.

Page 9: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

2 Solution 2.2 Description of the core functionality

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 9

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Cyclic exchange of process data Process data is transferred cyclically, i.e. in each bus cycle. They are transferred as quickly as possible. S7-1200 as PROFIBUS master sends the control word and the setpoint value to SINAMICS and receives the status word and the actual value from it. Depending on the message frame type, further additional setpoint or actual values or extended control or status words can be transferred. On the controller side, the process data are supplied as IO input or IO output

words. In the drive, the parameterization defines which bits of the control word are

used and which data is sent to the controller.

Acyclic data exchange (parameter access) To be able to transfer parameters, message frame types were defined, where four words are reserved for a parameter transfer. Since these four words and the process data are always sent, a permanent communication load results, even though the parameters themselves are generally only transferred occasionally. PROFINET provides the option to use not only cyclic, but also acyclic data exchange, which is inserted only on demand. This enables acyclic transfer of the parameter area on demand without creating a permanent communication load. Acyclic transfer clearly takes longer than the cyclic transfer of the process data. In the controller, parameter requests are sent to the G120C PN by writing

“data record 47”, and the response of the G120C PN is read by reading “data record 47”.

No particular action is required on the SINAMICS G120C PN side.

Page 10: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

2 Solution 2.3 Used hardware and software components

10 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

2.3 Used hardware and software components

The application document was generated using the following components:

Hardware components Table 2-1: Hardware components

Component Qty. Order no. Note

CPU 1212C AC/DC/RLY 1 6S7 212-1BE31-0XB0 or other S7-1200 CPU (with firmware 2.0 or higher)

SINAMICS G120C PN 1 6SL3210-1KE18-8AF1 oder a different SINAMICS G120C PN 6SL3210-1KExx-xxF1

SIMATIC Panel KTP600 Basic color PN 1 6AV6647-0AD11-3AX0 The panel is optional

COMPACT SWITCH MODULE CSM 1277 1 6GK7277-1AA00-0AA0 or a different switch

SINAMICS IOP 1 6SL3255-0AA00-4JA0 optional

Anschlussstecker PROFINET 8 6GK1901-1BB10-2AA0

incusively the connections to KTP600 and PG/PC

PROFINET Leitung 6XV1840-2AH10

Standard software components Table 2-2: Standard software components

Component Qty. Order number

SIMATIC STEP 7 V11 SP2 Floating License

STEP 7 BASIC 6ES7822-0AA01-0YA0 The BASIC version is sufficient,

however, you can also use the PROFESSIONAL version. STEP 7 PROFESSIONAL

6ES7822-1AA01-0YA5 Updates for STEP 7 V11 SP2 and WinCC V11 SP2

downloadable free of charge, see /4/

The application was developed with update 5. Always use the latest update

SIMATIC STEP 7 TIA Portal V12 Floating License

SIMATIC STEP 7 TIA Portal V12 Floating License

The BASIC version is sufficient. However, you can also use the PROFESSIONAL version. STEP 7 PROFESSIONAL

6ES7822-1AA02-0YA5

STARTER V4.3.1.2

6SL3072-0AA00-0AG0 on DVD downloadable free of charge, see /7/

-

GSDML Datei für SINAMICS G120C PN

downloadable free of charge, see /5/

-

Page 11: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

2 Solution 2.3 Used hardware and software components

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 11

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Example files and projects The following list contains all files and projects that are used in this example. Table 2-3: Example files and projects

Component Note

56749384_SINAMICS_G120C_PN_at_S7-1200_STEP7_V11_V1d0.zip 56749384_SINAMICS_G120C_PN_at_S7-1200_STEP7_V12_V1d0.zip

STEP 7 V11 STEP 7 V12

56749384_SINAMICS_G120C_PN_at_S7-1200_STARTER_V1d0.zip (Password for Safety settings: “12345“.)

STARTER

56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_V1d0_en.pdf DOCU

CAUTION The STARTER project is designed for use with the components listed in Table 2-1. When a SINAMICS G120C with different power rating or motor is used without adjusting the required parameters, the inverter or the motor can be damaged.

Page 12: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.1 Wiring

12 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

3 Setup and Commissioning of the Application

3.1 Wiring

The figure below shows the hardware setup of the application. Figure 3-1 L1L2L3N

PE

MY

L1 L2 L3 PE

U2 V2 W2 PN

L1 N PE

PN

PN M L+

24 V DC

SINAMICSG120C PN

SIMATIC PanelKTP600

SIMATIC S7CPU 1212C

Note The setup guidelines in the relevant manuals (see /1/, /6/, /8/) must be generally followed.

Page 13: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.2 IP addresses and PN device names

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 13

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

3.2 IP addresses and PN device names

In the example the following IP addresses and PROFINET device names are used:

Table 3-1: IP addresses and PN device names

IP Component PROFINET device name Converted name2

192.168.0.1 S7-CPU plc_1 plcxb1d0ed 192.168.0.2 G120C sinamics-g120c-cu240c-v4.5 sinamics-g120c-cu240c-v4.xd537c2 192.168.0.3 KTP600 hmi_1 hmixb110d0 192.168.0.200 PG/PC - -

The network mask is always 255.255.255.0 and no router is used.

The PROFINET device name is made up of the (editable) device names that are assigned by default from the system and which can be found in the “Properties” of the respective device under “General”. However, in the end a converted name according to IEC 61158-6-10 is loaded in the appropriate device. If the PROFINET device name is already complying with the norm, it is accepted as converted name. More details on naming can be found, e.g. in the information system (online help) of the TIA Portal under “Assigning addresses and names for PROFINET devices”.

2 Name convention according to IEC 61158-6-10

Page 14: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.3 Settings on PG/PC

14 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

3.3 Settings on PG/PC Table 3-2: Instruction – settings on PG/PC

No. Action Remarks

1. Assign a free, fixed IP address 192.168.0.x to the network card used (e.g. x = 200) and assign the subnet mask 255.255.255.0. Navigate in Windows as follows: >Start >Settings >Network connections >Right click on network card >Properties >Internet protocol (TCP/IP) >Properties

Page 15: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.4 Downloading the SINAMICS configuration

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 15

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

3.4 Downloading the SINAMICS configuration

This chapter describes the steps for downloading the example configuration. It is assumed that STARTER corresponding to Table 2-2 or a higher version is already installed on your PG/PC.

Note The download can be performed via Ethernet interface or USB. Below, the use of the Ethernet interface is shown.

Should you use a different converter or motor you need to perform your own configuration. In that case, follow the instructions in chapter 6.2.

Table 3-3: Downloading the SINAMICS configuration

No. Action Remarks

1. Connect SINAMICS G120C by means of an Ethernet patch cable with the PG/PC (when indicated via a switch according to Figure 2-1).

2. Start the commissioning tool

STARTER.

3. Dearchive the starter project and

open it.

Page 16: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.4 Downloading the SINAMICS configuration

16 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

4. Open “Set PG/PC interface“.

5. Set the PG/PC interface. Select

"S7ONLINE (STEP7)" as access point of the application and "TCP/IP -> network card used" as interface configuration used. Navigate in Windows as follows: >Start >System controller > Set PG/PC Interface

6. Click on “Accessible nodes”.

used network card

Page 17: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.4 Downloading the SINAMICS configuration

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 17

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

7. 1. Right click on the found drive and select “Edit Ethernet node…” from the context menu.

2. Set the drive’s IP configuration. Use IP address projected in STEP 7.

3. Assign PROFINET IO device name, which was used in the STEP 7 net configuration, to the drive.

4. Close window “Edit Ethernet node”.

5. Close window “Accessible nodes – TCP/IP”.

8. Go online

9. Start the download and tick “After

loading, copy RAM to ROM”. Should you receive a note which indicates different parameters for the power unit, you need to make your own configuration. In that case, follow the instructions in chapter 6.2”.

1

2

1

2

3

4

5

1

2a

2b

3a 3b

Page 18: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.5 Downloading the SIMATIC program

18 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

10. Go offline

Note The password assigned in the example project for safety programming is “12345”.

3.5 Downloading the SIMATIC program

This chapter describes the steps for the installation of the sample code into the SIMATIC. It is assumed, that STEP 7 is installed on your PG/PC according to Table 2-2 and the SINAMICS configuration corresponding to chap. 6.2 has been carried out already.

Table 3-4: Downloading the SIMATIC program

No. Action Remarks

1. Connect the controller with the PG/PC via a network cable

You can interconnect both devices directly or via a switch.

2. Unzip the STEP 7 project at Windows level and copy it to a directory

The project folder G120C_at_S7-1200 is created.

3. Double click the ap11/ap12 file in the project folder just retrieved in order to open the project in TIA Portal. If necessary, switch from portal view to project view.

Page 19: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.5 Downloading the SIMATIC program

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 19

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

4. Select the CPU (PLC_1) and click on “Download to device”.

5. Select the following interface data

in the “Extended download to device” mask: Type of PG/PC interface:

PN/IE PG/PC interface:

network card used Connection to subnet:

(local) PN/IE

You may be prompted to tick “Show all accessible devices” in the online status information. Click “Load” as soon as the CPU is reached.

6. Quitt mask “Load preview” with

button “Load”… …and subsequently mask “Load results” with button “Finish”. “Start all” must be ticked.

1

2

1

2

2

3

1

Page 20: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.5 Downloading the SIMATIC program

20 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

7. To be able to run the KTP600 operator panel as simulation on your PG/PC, select it and start the simulation. (If you would like to connect a real KTP600 to the controller instead of the simulation, continue with step 8.)

8. Connect the KTP600 to the power

supply and open the PROFINET settings in the Control Panel.

9. Make the entries according to the

screens on the right.

As IP address and station name3 use values which you did project in STEP 7. (You find it in the editor „Devices & networks“ in the panel’s device view under „properties“ and „Ethernet addresses“

Exit the PROFINET settings with “OK” and close the Control Panel. Subsequently prepare the loading process by clicking the “Transfer” button.

hmixb110d0

10. Connect the operator panel with

an Ethernet patch cable directly to the PG/PC or via a switch and start the data transfer.

The operator panel will subsequently start automatically.

Now connect the operator panel with the controller (not necessary when using a switch)

3 The used operator panel only supports a STEP 7 connection and not a PROFINET connection. Therefore the panel is not addressed by means of the station name. Nevertheless the station name can – just like a PROFINET name – be read out and assigned by the PLC.

1

2

2

1

2

2

2

1

2

2

1

2

2

2

3

Page 21: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

3 Setup and Commissioning of the Application 3.5 Downloading the SIMATIC program

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 21

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

11. Execute a restart of the PLC by a supply voltage break.

The new restart assigns the IP addresses to the IO devices (drive and operator panel) via the configured and already loaded PROFINET device names. The application is now ready for operation.

Page 22: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.1 Prerequisites

22 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

4 Operation of the Application 4.1 Prerequisites

To be able to switch on the drive via the panel or the watch table, the following points must be met: If you did design the Safety function4 “Basic functions via onboard terminals”

(option in the operating instruction to the drive configuration in Table 6-2), the yellow “SAFE” LED at the SINAMICS G120C shows continuous light or blinking light. With continuous light the drive can be started. With blinking light the Safety function STO is active an the drive will not start. In this case apply 24V to the terminals 16 and 17 (DI 4 and DI 5) of the G120C.

Terminal 8 (DI 3) must not be supplied with 24 V, otherwise the command data record is switched.

NOTE When using an IOP, please check whether the network icon ( ) is displayed on the top right. If the hand icon ( ) is displayed there, please press the Hand/Auto button ( )

4 With the STEP 7 sample project no Safety function is designed and the respective indent is not relevant.

Page 23: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.2 Operation the application via the panel

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 23

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

4.2 Operation the application via the panel

4.2.1 Screens and screen navigation

Figure 4-1: Screen navigation

Application example Support

Process data exchange

Next

Parameter access

Fault buffer

From allsubordinate screens

From allsubordinate screens

Back Back

Star

t scr

een

Ove

rvie

wsc

reen

Onl

ine

Supp

ort -

Prom

otio

n

Stat

us w

ord,

Con

trol

Wor

dSe

tpoi

nts

and

actu

alva

lues

Rea

d/w

rite

para

met

ers

Faul

t buf

fer

Quit runtime

Change language (English/German)

Page 24: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.2 Operation the application via the panel

24 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

4.2.2 Process data exchange

Both screens for the process data exchange access data block DB 11 “idb_Process_Data_SFC” because the process data exchange in this application is provided by the appropriate FB 11 “Process_Data_SFC” (see chap. 5.1.5). If using FB 14 „Process_Data_MOVE“ for the process data exchange, the relevant HMI variables would have to access to the instance data block DB 14 “idb_Process_Data_MOVE“.

Control and status word Figure 4-2: Control and status word

Bit 0

Bit 7Bit 8

Bit 15

Bit 0

Bit 7Bit 8

Bit 15

STW1 (Control word 1) With the buttons in the upper part of the figure you can discretely set and reset the bits in the control word. Signal status “1” is indicated by yellow color. “Control by PLC” (bit 10) is sent to the G120C by default as TRUE and therefore is indicated yellow immediately after a PLC restart.

ZSW1 (Status word 1) The text fields in the lower part of the figure show the logical states of the discrete bits in the status word. Signal status “1” is indicated by green color. Contrary to this, “Fault active” and “Warning active” are indicated red respectively pink.

Page 25: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.2 Operation the application via the panel

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 25

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Switching on the drive Follow the instruction below to switch on the SINAMICS G120C PN: Table 4-1: ’how to do’ list– switching on the drive

No. Instruction

1. Set the STW-bits according to the following picture.

The direction of rotation can be changed with the button “Direction reversal”. This can be done either when motor is stopped or running.

2. If “Fault active” (status bit 3) lights up in red, acknowledge the fault by pressing the button “Ack. fault” (control bit 7). In consequence reset the acknowledgement bit by pressing the button again.

3. The ZSW will have the following status:

Die Bits „n innerh. Toleranz“ (Bit 8), „I,M,P-Grenze (Bit 11) und „n_ist >= 0“ (Bit 14) sind für das Einschalten nicht relevant.

The bits “n within tolerance” (bit 8), “I,M,P limit” (bit 11) and “n_act >= 0” (bit 14) are not relevant for motor switch on.

4. Press ON.

The SINAMICS G120C PN switches on. To switch off press ON button again.

Hinweis After acknowledging a fault, generate a positive edge at control bit 0 to enable a motor restart. To do this, switch the drive off and on again (yellow grey yellow) with button “ON”.

Page 26: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.2 Operation the application via the panel

26 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Setpoint and actual values Figure 4-3: Setpoint and actual values

Setpoint speed value: The setpoint speed value is entered into the yellow field, top left.

Actual values: The current actual values speed, current and torque are displayed below the speed setpoint value input.

Control and status word: To keep an eye on control word and status word, without switching to the respective screen, they are also given here as a miniature display.

Current messages: Current faults and warnings are displayed with a respective number. A “0” means, that no fault or alarm exists. If a message is pending it is displayed according to Figure 4-4.

Page 27: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.2 Operation the application via the panel

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 27

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Figure 4-4: Current messages as message numbers

Tap or click on the message number to display the respective message text.

Figure 4-5: Current messages in plain text

The message text is displayed as long as the message number is pressed.

Page 28: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.2 Operation the application via the panel

28 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

4.2.3 Parameter access

Reading/writing parameters Figure 4-6: Reading/writing parameters

Table 4-2: Instructions – writing/reading parameters

Action Remark

1. Select the access type with the “Read parameters” and “Write parameters” buttons.

The selected access type is displayed via a bright green button.

2. Read parameters: Proceed with point 3 in the table. Write parameters: When tapping or clicking the yellow input fields for the ramp up/ramp down time, a keyboard mask for the value input opens. Close your input with the Return key.

8,0

Ramp up time

Ramp down time

Page 29: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.2 Operation the application via the panel

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 29

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Action Remark

3. Start the write or read job with the “Start” button. Note: After a write job the new data is adopted as read parameters in the white fields in the left part of the screen. After writing you need not trigger any additional read job for the update.

The job status specifies how the job was completed: done = completed without errors error = completed with errors The status relates to the processing of the instructions “RDREC” and “WRREC” in FB20 “Parameter_Access” for the communication to the IO device. For fault diagnostics see /1/.

Fault buffer The screen displays the fault codes of eight current and eight acknowledged faults, which are saved in the converter.

Figure 4-7: Display of fault buffer

The fault codes in the above screen correspond to the control tags V_3_Value_00 (DW18) to V_3_Value_15 (DW48) in the “answer_from_drive” data block (DB103).

NOTE The fault buffers are only actualized, if an acyclic transmission is initiated. Therefore, in the sample project you have to read out the ramp up / ramp down times (P1120, P1121).

Tap or click on the message number to display the respective message text.

Page 30: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.3 Operating the application via watch table

30 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Figure 4-8: Display of fault buffer message in plain text

The message text is displayed as long as the message number is pressed.

4.3 Operating the application via watch table

You can also use the application without panel. The watch tables “Process_data_SFC” and “Parameters” are created in the project for this purpose.

The variables in the watch tables you work with are the same as those being displayed or controlled by the operating panel.

Table 4-3: Operating the application via watch table

Nr. Aktion Anmerkung

1. Open the demanded watch table in the TIA portal.

Page 31: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

4 Operation of the Application 4.3 Operating the application via watch table

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 31

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Nr. Aktion Anmerkung

2. Go online.

3. To modify a variable, enter the new

value into column “Modify value” in the corresponding row and set a check mark right of it. Then start with in the headline. To modify a boolean variable you also can proceed as follows: Rightclick the corresponding row and select “Modify” (see picture right).

Page 32: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application

32 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

5 Function Mechanisms of this Application Program overview

Figure 5-1: Program overview

OB1„Main“

FB11“Process_Data_SFC“

FB20“Parameters“

DB11“Process_Data_SFC“

DB20“Parameters“

DB100„write_drive_parameters“

FC11“Denormalization“

FC12“Normalization“

instruction„DPRD_DAT“

instruction„DPWR_DAT“

……

…instruction„WRREC“

instruction„RDREC“

……

…DB101

„read_drive_parameters“

DB103„answer_from_drive“

Separate function blocks are used for both communication areas, process data exchange and parameter access.

Page 33: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.1 Process data exchange functionality

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 33

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

5.1 Process data exchange functionality Figure 5-2: Process data exchange functionality

The process data contains values which are regularly exchanged between controller and converter. These are at least the control and status word, as well as the setpoint and actual value. The precise length and structure is specified by selecting the message frame type. Message frame type “Siemens telegram 352, PZD 6/6” used in the example exchanges 6 words in both directions.

5.1.1 Access to process data in the user program of the controller

When the cycle starts, the operating system of the S7-1200 stores the (user) data received by the converter in the input IO area of the CPU, and sends the data stored in the output IO area to the converter at the end of the cycle. Within the user program access to the data is possible by copying from or to the IO area. The used address areas are defined in the editor “Devices and networks”.See step 12 in Table 6-1.

5.1.2 Setpoint and actual value normalization

The setpoints and actual values are transferred as a standard. The normalization or reference values are stored in parameters P2000 to P2006 of SINAMICS G120C. The following applies: 16384Dec = 4000Hex = 100% whereby 100% refers to the reference value for the transferred parameter. Example:

If P2000 (reference speed or reference frequency) is 1500 1/min and a speed of 500 1/min shall be performed, then 33% or 5461dec must be transferred.

Page 34: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.1 Process data exchange functionality

34 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Further information is available in chapter 7 “Configuring the fieldbus” of the operating instruction (/8/ ) for SINAMICS G120C.

5.1.3 Transfer methods

To copy the process data into or from the I/O area, the following methods can be used depending on the requirements:

1. Instruction “MOVE” 2. Instructions “DPRD_DAT” / “DPWR_DAT”

Both methods are contained in the example program. Table 5-1: Block alternatives for the process data exchange

FB Methode

Process_Data_MOVE [FB14] mit MOVE-Befehlen Process_Data_SFC [FB11] mit DPRD_DAT und DPWR_DAT

In the application example Process_Data_SFC [FB11] is processed. The enable input of Process_Data_MOVE [FB14] is connected to FALSE and therefore this FB is not activ.

“MOVE” The simplest way to access to process data is using “MOVE”. This ensures consistency for each command (1, 2 and 4 bytes) and hence also the consistency within the individual elements, such as control word and setpoint value. However, the individual elements can origin from different bus cycles or occur in different bus cycles. However, for the applications for which the SINAMICS G120 is usually used, data transfer with “MOVE” is sufficient.

“DPRD_DAT” / “DPWR_DAT” As opposed to the “MOVE” command, these instructions ensure that the consistency is maintained across the entire process data, i.e. all elements of the process data of a slave are transferred from the same bus cycle or are transferred within a bus cycle. This is necessary, e.g. to enable a distributed synchronization. In the example program, all of the 6 words are copied consistently. Using “DPRD_Dat” / “DPWR_Dat” has no disadvantages, apart from the necessary use of more complex instructions, which are often avoided by newcomers to programming, and a slightly longer processing duration than for the respective “MOVE” command. In the “Instructions” task card of the TIA Portal you will find the instructions under

> Expanded instructions > Distributed I/Os

> Others.

NOTICE If you would like to test the example with the “MOVE” alternative, you have to change the HMI data access to the PLC variables from “idb_Process_Data_SFC” [DB11] to “idb_Process_Data_MOVE” [DB14].

Page 35: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.1 Process data exchange functionality

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 35

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

5.1.4 Control and status word

Control and status word have already been predefined. The subsequent figures show the control or status word when message frame type “Siemens telegram 352, PZD 6/6” has been selected.

Figure 5-3: Control word of the message frame type “Siemens telegram 352, PZD 6/6”

Note A control word where all bits are 0 is considered invalid by the converter. Therefore, at least bit 10 must always be set.

Page 36: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.1 Process data exchange functionality

36 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Figure 5-4: Status word of the message frame type “Siemens telegram 352, PZD 6/6”

5.1.5 FB 11 “Process_Data_SFC”

In the example the process data is processed in FB “Process Data” which is called cyclically by OB “Main”. In this FB the process data is copied and also converted if necessary. This FB shows the access to the process data with using the instructions “DPRD_DAT“ / “DPWR_DAT“. It is called cyclically by OB 1.

Page 37: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.1 Process data exchange functionality

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 37

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Figure 5-5: FB 11 “Process_Data_SFC“

Table 5-2: Interface of FB “Process_Data_SFC“

Name Data type Function

Inputs control_word WORD STW1 setpoint REAL Speed setpoint [min-1] address HW_SUBMODULE Hardware identifier from the PIQ area

of the G120C PN ref_quantity. speed_p2000 current_p2002 torque_p2003

STRUCT REAL REAL REAL

Reference quantity for… Speed [min-1] Current [A] Torque [Nm]

Outputs status_word WORD ZSW1 actual_speed REAL Actual speed [min-1] actual_current REAL Actual current [A] actual_torque REAL Actual torque [Nm] actual_alarm WORD Alarm number actual_fault WORD Fault number Return_Value_RD WORD RET_VAL of DPRD_DAT Return_Value_WR WORD RET_VAL of DPWR_DAT

Page 38: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.1 Process data exchange functionality

38 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Networks Table 5-3: Networks of FB 11 “Process Data_SFC“

Network Function

1. The process data is copied from the I/O area into the temporary #InData data area using the “DPRD_DAT” instruction.

2. Status word, warning and faults are copied from the temporary #InData data area to the respective block outputs, and the current actual values [WORD] are copied into temporary tags [INT] for data type adjustment. 3.

4. The actual standardized speed [INT] is denormalized [REAL, min-1] by calling FC11.

5. The actual standardized electrical current [INT] is denormalized [REAL, A] by calling FC11.

6. The actual standardized torque [INT] is denormalized [REAL, Nm] by calling FC11.

7. The speed setpoint value [REAL] is standardized [WORD] by calling FC12. 8. Control word and standardized speed setpoint [INT] are copied to the

temporary #OUTData data area. 0 is written to the remaining 4 words. 9. 10. The process data is copied from the temporary #OutData data area into the

I/O area using the “DPWR_DAT” instruction.

Parameterization Parameter supplying is performed by a direct access to the FB’s instance DB. So the formal parameters may remain unused. Only the input parameter “address” of type “HW_SUBMODULE” has to be parameterized. With “address” the hardware identifier of the SINAMICS G120C PN is looped through to the input parameters LADDR of the instructions “DPRD_DAT”/“DPWR_DAT”. Further information see chap. 6.3.2.

Page 39: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.1 Process data exchange functionality

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 39

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Figure 5-6: Aktualparameter für „address“

5.1.6 FB 14 “Process_Data_MOVE”

This FB shows the access to the process data with the “MOVE” command. The FB is not called in the sample program, because the function compatible FB 11 “Process_Data_SFC” is used there.

Figure 5-7: FB14 “Process_Data_MOVE”

With the exception of “address”, “Return_Value_RD” und “Return_Value_WR”, the FB 14 has the same parameters than the FB 11 “Process_Data_SFC”.

Page 40: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.1 Process data exchange functionality

40 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

NOTE FB 14 absolutely accesses to the IO bytes of the SINAMICS G120C, which are automatically defined in step 12 of Table 6-1 by selecting the “telegram 352”. If you modify these default addresses (from PIB 68, PQB 64), you also must change them in FB 14.

Networks Table 5-4: Networks of FB14 “Process_Data_MOVE”

Netzwerk Funktion

1. Status word, warning and faults are copied from the I/O area to the respective block outputs, and the current actual values [WORD] are copied into temporary tags [INT] for data type adjustment. 2.

3. The actual standardized speed [INT] is denormalized [REAL, min-1] by calling FC11.

4. The actual standardized electrical current [INT] is denormalized [REAL, A] by calling FC11.

5. The actual standardized torque [INT] is denormalized [REAL, Nm] by calling FC11.

6. The control word is copied into the I/O area. The speed setpoint value[REAL, min-1] is standardized [WORD] and copied into the I/O area.

Parameterization Parameter supplying is performed by a direct access to the FB’s instance DB. So the formal parameters may remain unused.

Page 41: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.2 Parameter access functionality

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 41

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

5.2 Parameter access functionality Figure 5-8: Parameter access functionality

The parameter access occurs acyclically parallel to the cyclic process data exchange. This saves resources since this connection is only established on demand, when a parameter needs to be accessed. In the controller, the functions “Write data record” and “Read data record” must be used. This is done by means of “Data record 47”. By writing “Data record 47” a request is sent to the converter who executes the request and provides a response. Reading “Data record 47” makes the converter’s response available in the controller where it can then be evaluated. For reading and writing data records, the instructions “WRREC” and “RDREC” are used in the controller.

5.2.1 Request and response structure

The structure of requests and responses (“Data record 47”) is available in chapter 7.2.6 “Configuring the fieldbus, Communication via PROFIBUS, Acyclic communication” in the G120C operating instruction (/8/).

Note Since the structure of the data records to be sent or received depends on the number of the requests and their number format, a generally accepted structure can be used.

Page 42: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.2 Parameter access functionality

42 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

5.2.2 The DBs “read/write_drive_parameters” and “answer_from_drive”

The job to access a parameter consists of at least 10 words. Therefore, the job shall be assembled in a DB or in the memory area. In this example, this is performed using DB 101 “read_drive_parameters” and DB 100 “write_drive_parameters”. The response from the converter also consists of several words. Therefore, the example uses DB 103 “answer_from_drive” for this. A job may contain the access to several parameters. Since the length of the data to be transferred per job depends on the number and data types of the converter parameters, no generally valid structure can be devised. Therefore, in this example, only the ramp up and ramp down times (P1120 and P1121) and a part of the fault memory (P945.x) is accessed. The job to read the parameters is stored in DB 101 “read_drive_parameters“. The job to write them is stored in DB 100 “write_drive_parameters”. The response of the converter is copied to DB 103 “answer_from_drive“. The structure contained therein corresponds to the structure for a successful reading of the parameters.

ATTENTION When creating the DBs for the data records, for block access “standard compatible with S7-300/400” must be selected.

See also chapter 6.3.1.

Hinweis Put the entire job into a struct (in the example: „record“). Hence you are able to address the data record symbolically with the struct name, when reading/writing it with RDREC/WRREC.

Figure 5-9: DB100 „write_drive_parameters“

ramp up time 10s

ramp down time 15s

Page 43: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.2 Parameter access functionality

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 43

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Figure 5-10: DB101 „read_drive_parameters“

Figure 5-11: DB103 „answer_from_drive“

5.2.3 The FB “Parameters”

The parameter access in this example is carried out in FB “Parameters”, which is cyclically called by OB “Main”.

Page 44: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.2 Parameter access functionality

44 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Figure 5-12: FB “Parameters”

Table 5-5: FB “Parameters” interface assignment

Name Type Function

IN parameters address Hw_SubModule Hardware identifier of the

SINAMICS G120C PN5 READ_WRITE BOOL 0= read parameter

1= write parameter Ramp_Time_Up REAL ramp-up time to be read Ramp_Time_Down REAL ramp-down time to be read INOUT parameters START BOOL A positive edge starts the

transmission. The signal is automatically reset by the FB.

OUT parameters actual_Ramp_Time_Up REAL ramp-up time being read actual_Ramp_Time_Down REAL ramp-down time being read BUSY BOOL Access active transfer_done BOOL Access successful tansfer_error BOOL Access aborted with error

Setup FB “Parameter” consists of two parts: A step chain which controls the sequence of the parameter access

(networks 1 to 22). Calling the system functions Write data record and Read data record

(networks 23 to 25).

5 With the parameter „address” the hardware identifier of the SINAMICS G120C PN is looped through to the input parameters “ID” of the instructions “RDREC”/“WRREC”. For “address” take the same address than used with FB “Process_Data_SFC”. Select it from the dropdown list (see Figure 5-6).

Page 45: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.2 Parameter access functionality

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 45

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Sequence chart The individual steps of FB “Parameters” are represented in the following graphic. The possible transitions between the individual steps are also listed there. Figure 5-13: Sequence chart

0Wait for start

trigger

1Start WRREC

2Wait for endof WRREC

5Wait for endof RDREC

6Check result

of RDREC

7Check for

errors, copyoutput

3Check resultof WRREC

4Start RDREC

START

8

Finalize job

other faults

rising START signal

sending finished

not ready faultsending successful

receiving finished

not ready fault

other faults

In the individual states of the sequence chart the following functions are executed: Table 5-6: Function of the states of FB “Parameters”

State Function

0 Wait for start trigger Waiting for a rising edge at the “START” signal. If it is detected, all output signals are deleted, “BUSY” is set and step 1 is activated.

1 Start send The “START” signal is reset, the “req” signal of FB “WRREC” is set and step 2 is activated.

2 Wait for end of send Waiting until the “busy” signal of SFB “WRREC” becomes 0 again, then step 3 is activated.

Page 46: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

5 Function Mechanisms of this Application 5.2 Parameter access functionality

46 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

State Function

3 Check result of send Checking whether the data record has been written successfully. If yes, the “req” signal of SFB “WRREC” is deleted again and step 4 is activated. If SFB “WRREC” reports error 16#DF80_B500 (peer not ready) has occurred, step 3 is activated again so SFB “WRREC” repeats the request. If a different error has occurred, the “req” signal of SFB “WRREC” is deleted, an internal error bit is set and step 7 activated.

4 Start receive The “req” signal of FB “RDREC” is set and step 5 is activated.

5 Wait for end of receive Waiting until the “busy” signal of FB “RDREC” becomes 0 again, then step 6 is activated.

6 Check result of receive Checking whether the data record has been read successfully. If yes, the “req” signal of SFB “RDREC” is deleted again and step 7 is activated. If SFB “RDREC” reports error 16#DE80_B500 (peer not ready) has occurred, step 5 is activated again so FB “RDREC” repeats the request. If a different error has occurred, the “req” signal of SFB “RDREC” is deleted, an internal error bit is set and step 7 activated.

7 Check for errors, copy output

It is checked whether the internal error bit or whether an error bit has been set in the response of the converter. If an error bit has been set,

– the “transfer.error” is set, – the “BUSY“ signal is deleted, – 999999.9s is output as the read time and – step 0 is activated.

If no error bit has been set, the read times are output and step 8 is activated.

8 Finalize job The “BUSY” signal is deleted, the “transfer.done” signal is set and step 0 is activated.

Calling the system functions “WRREC” and “RDREC” After the currently required control bits were set in the first part of FB “Parameters”, the system functions “Write data record” or “Read data record” (instructions “WRREC” and “RDREC”) are called in the second part. You find them in the TIA portal’s task card “Instructions” under…

> Extended instructions > Distributed I/O.

With input tag “READ_WRITE” you chose which of both instructions “WRREC” or “RDREC” is called. The only difference between both calls is which DB is sent to the drive, the one for writing parameters or the one for reading parameters.

Page 47: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.1 Configuring the S7-1200 controller

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 47

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

6 Configuration and Settings Note If you only wish to download and commission the example program, please

follow the instructions in chapter 3 “Setup and Commissioning of the Application”.

The step tables below describe what you have to do if you do not want to use the sample code but configure SINAMICS G120 and SIMATIC S7 CPU yourself.

6.1 Configuring the S7-1200 controller

This chapter describes how to configure the S7-1200 for the example program. Setting the operator panel or programming the S7-1200 is not discussed in this chapter.

Table 6-1: Configuring the S7-1200 controller

No. Action Remarks 1. Start the TIA Portal.

2. Should the TIA Portal open in

the portal view, please use the bottom left button to switch to Project view.

Page 48: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.1 Configuring the S7-1200 controller

48 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks 3. Ensure, that the GSDML file for the G120C PN is already installed.

If not, download the archieved GSDML file from the concerning online support side (/5/). Then proceed as follows: 1. Retrieve the file into a folder on your PG/PC. 2. Install the GSDML file in your desired language.

3. Maybe you have to restart the TIA portal.

4. Create a new project and assign a name. (e.g. “G120C_at_S7-1200”)

5. Double-click on “Add new

device”.

Page 49: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.1 Configuring the S7-1200 controller

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 49

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks 6. Press “PLC” and then “CPU

1212C AC/DC/Rly”, ensure that the “Open device view” checkbox has been ticked and click on “OK”.

7. Open the “Properties” in the

device configuration of the CPU and configure the PROFINET interface. Go to “Ethernet addresses” in the tree. Select “Set IP address in the project” and enter the desired IP address. Add a new subnet and select it.

8. Open the editor “Devices &

networks” and select “Network view”. Drag the “SINAMICS G120C PN…” module to the workspace. The path for the module is: > Other field devices > PROFINET IO > Drives > Siemens AG > SINAMICS

9. Connect both Ethernet ports with each other.

1

2

3 4

2

1

4

3

1

2

Page 50: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.1 Configuring the S7-1200 controller

50 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks 10. To change the drive’s IP address

open its properties. To do this, first click the drive and then select “Properties”.

11. Where appropriate, change the

drive’s IP address. (In the sample project the default address 192.168.0.2 is used.)

12. Select the data record to be

transmitted6. Therefore select the drive’s “Device view” and open the “Device overview”. Drag “SIEMENS telegram 352, PZD-6/6” from the catalogue into the work space. Leave the IO addresses (from PIB 68, PQB 64) at their default values, because FB 14 “Process_Data_MOVE” accesses to them.

6 In the PLC configuration with STEP 7 and in the drive configuration with STARTER the same data record must be selected. The example uses “telegram 352”.

1

2

1

2

3

4

Page 51: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.1 Configuring the S7-1200 controller

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 51

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks 13. Return to “Network view”.

Insert the operator panel by drop & drag the KTP600 Basic PN from the catalogue into the work space.

Activate “Connections” an select “HMI connection” from the drop-down list

Establish a connection by dragging a line with the mouse between the Ethernet ports of the KTP600 and the PLC.

14. Show the IP addresses.

To the KTP600 the next free IP address 192.168.0.3 is assigned automatically.

15. Assign the devices their

PROFINET device name online, if not done yet already in a different way.

For this purpose, make a right click on the PROFINET IO system in the graphic area of the network view and select “Assign device name” from the context menu.

Wire – if not yet done – the three PROFINET devices by means of Ethernet patch cables.

2

4

1 3

Page 52: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.2 Configuration of the SINAMICS G120C PN drive

52 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks 16. All available PROFINET IO

nodes are listed.

Now successively assign each device the configured PROFINET device name and click “Assign name”.

Select the names from the drop-down list on the top right.

Afterwards refresh the window with and check the data transfer.

For PROFINET device names see chap. 3.2.

17. The device and network configuration is now completed. Successively compile the configurations of CPU and HMI device for control purposes. The compiling results can be seen in the inspection window. The CPU is compiled without errors. For the operator panel you only receive the error message that no start screen has been defined yet, since no images have probably been configured yet. Save the project.

6.2 Configuration of the SINAMICS G120C PN drive Table 6-2: Configuration of the SINAMICS G120C drive

No. Action Remarks

1. Install and start the STARTER commissioning software (/7/).

1

2

1

2

3

Page 53: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.2 Configuration of the SINAMICS G120C PN drive

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 53

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

2. Connect the SINAMICS G120 with your PG/PC using an Ethernet patch cable.

3. Create a new project in

STARTER.

4. Open

“Set PG/PC interface“.

5. Select

"S7ONLINE (STEP 7)“ as access point and „TCP/IP internet card“ as interface configuration used. (The name of the internet card in the picture is “Siemens CP1612”.)

6. Click on

“Accessible nodes“.

Page 54: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.2 Configuration of the SINAMICS G120C PN drive

54 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

7. Right click on the found drive and select “Edit Ethernet node…” from the context menu.

8. If required, change the IP

address of the drive to the one that corresponds to the future configuration.

9. 1. Update the

“Accessible nodes”. 2. Tick the found converter. 3. Click “Accept“. In

consequence STARTER defines a drive unit in the project.

4. Click “Close“.

10. Change the name of the drive unit according to your wishes. Right click the drive unit and select “Rename” in the context menu.

1

2

3

2

3 1 4

Page 55: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.2 Configuration of the SINAMICS G120C PN drive

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 55

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

11. Select the converter in the tree and go online.

12. Load the hardware configuration

into the PG/PC and close the window.

13. 1. Select the converter in the

tree.

2. Press “Restore factory settings”.

3. Untick “Save factory settings to ROM”.

4. Click “OK”.

14. Expand the tree and double click

on “Configuration”. Then call up the wizard.

1

2

1

2

1

2

3

4

1

2

Page 56: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.2 Configuration of the SINAMICS G120C PN drive

56 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

15. Run the wizard and enter the data you need. Ensure that the “Defaults of the setpoint/command sources” step is selected in the field bus.

16. Double click “Communication >

PROFINET” in the project navigation, select one of the tabs “Receive direction” or “Transmit direction”, and select “Siemens telegram 352, PZD-6/6)”.

Note: The telegram type matches the example. It is decisive here, that the same telegram is selected as for the hardware configuration in STEP 7.

17. If you do not wish to use any safety functions, proceed with step 22.

When using an F-CPU you can also call the safety functions via the field bus. However, this is not part of this example. More information on this subject can be found in the Safety Integrated function manual for the SINAMICS G120 and G120C(/8/).

18. Open “Safety Integrated” in the project navigation and click “Change settings”.

1

2

1

2

Page 57: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.2 Configuration of the SINAMICS G120C PN drive

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 57

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

19. 1. Select “Basic functions via onboard terminals“.

2. Click “Copy parameters”. 3. Click “Activate settings”.

20. After activating the settings you

are prompted to enter a password. (The password used in this example is “12345”. A brand-new G120C has a default password “0”.)

21. Choose “Yes”, to save the

parameters in ROM.

Proceed with step 23

22. Save the configuration in ROM

(if not done yet). For this purpose, select the drive and choose “Copy RAM to ROM” from the “Target system” menu.

23. Briefly interrupt the supply

voltage of the control unit (until all LEDs are dark) and then go online again .

Thus the CU accepts the parameters via a reboot.

24. 1. Download the configuration created online into the PG.

2. Go offline. 3. Save the project on your

hard disc.

1

2

3

1

3

2

Page 58: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.2 Configuration of the SINAMICS G120C PN drive

58 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

No. Action Remarks

25. Archive the project.

Page 59: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.3 Programming the S7-1200

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 59

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

6.3 Programming the S7-1200

This chapter discusses particular points during programming.

6.3.1 Creating the DBs for the data records

When creating the DBs for the data records, “standard compatible with S7-300/400” must be selected as block access. In consequence in the DBs’ properties “Optimized block access” is not ticked.

Ignoring this requirement the converter acknowledges all data records with fault alarms. Figure 6-1: Creating the DBs for the data records

A subsequent deselection of the attribute “Optimized block access” in the DBs’ properties is not possible.

6.3.2 Parameterizing the instructions DPRD_DAT/DPWR_DAT and WRREC and RDREC

The instructions and its formal parameters are described in the TIA portal’s online help. With the search function in the information system they are easy to find. In the following only those parameters, which in the online help get not explained sufficiently concerning a connection to a SINAMICS G120, are dealt with.

Page 60: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.3 Programming the S7-1200

60 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

DPRD_DAT/DPWR_DAT Table 6-3: DPRD_DAT/DPWR_DAT - Parameterizing the instructions

Parameter Erläuterung

LADDR LADDR of type “HW_SUBMODULE” identifies an adressable IO Device component, e. g. a component of the SINAMICS G120C PN. It is also designated as „hardware identifier“. If you drag telegram 352 into the drive’s „Device overview“, according to step 12 in Table 6-1, STEP 7 creates a system constant, which corresponds to a logical IO address.

In the application the constant has the value 279 (117h) respectively the symbolic name “SIEMENS_telegram_352,_PZD-6_6[AI/AQ]”. You can enter the parameter decimal or hexadecimal or select it from a drop-down list.

Page 61: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.3 Programming the S7-1200

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 61

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Parameter Erläuterung

RECORD RECORD of type “VARIANT” is a pointer with length specification. It points to a data area in the PLC, in which data read from the drive are filed respectively from which data to be written to the drive are taken. The data area must have the same length than the IO area addressed by LADDR.

In the application example RECORD is addressed symbolically7. #InData is an array in the temporary data of “Process_Data_SFC”. It consists of six words (Array [1 .. 6] Of Word), corresponding to the length of telegram 352. Being a temporary variable, #InData cannot be accessed absolutely.

RDREC/WRREC Tabelle 6-4: RDREC/WRREC - Parameterizing the instructions

Parameter Erläuterung

ID The function of ID is like parameter LADDR at DPRD_DAT/DPWR_DAT (see Table 6-3). The acyclic services need, like the cyclic process data transfer, the logical address of an IO device submodule (supplmentary data or telegram, see STEP 7 hardware catalog). However, if your application makes only use of the acyclic services, you have to project a submodule (like in Table 6-1, step 12) in order that a corresponding system constant (logical address) is created. But in this case you can use a submodule with a shorter data length, e. g. “Standard telegram 1”. Do not use “Empty submodule” because it generates no system constant.

INDEX INDEX specifies the data record to be transmitted. As actual parameter enter value 47 for “Data record 47”.

RECORD RECORD of type “VARIANT” is a pointer with length specification. It points to the data records “record” in the DBs from chap. 5.2.2. In the application example RECORD is addressed symbolically7.

7 With symbolic addressing, the length specification in RECORD is determined implicitly by the structure of the actual parameter.

Page 62: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

6 Configuration and Settings 6.3 Programming the S7-1200

62 SINAMICS G120C PN at S7-1200

V1.0, Entry ID: 56749384

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

Note If you extend the parameter table by clicking the little triangle, an additional input parameter “LEN” appears to specify the data record’s maximum length.

Being integrated in parameter “RECORD” in this example, the record length “LEN” needs not to be parameterized. Leave default value 0.

Page 63: 56749384_SINAMICS_G120C_PN_at_S7-1200_DOCU_v1d0_en

7 Literature

SINAMICS G120C PN at S7-1200 V1.0, Entry ID: 56749384 63

Cop

yrig

ht

Sie

men

s A

G 2

013

All

right

s re

serv

ed

7 Literature The following list is by no means complete and only provides a selection of appropriate sources. Table 7-1: Literature

Topic Title / link /1/

SIMATIC S7-1200 STEP 7 Basic

SIMATIC S7-1200 System Manual http://support.automation.siemens.com/WW/view/en/36932465

/2/ STEP 7 Basic V11.0 SP2 System Manual http://support.automation.siemens.com/WW/view/en/57199536 WinCC Basic V11.0 SP2 System Manual http://support.automation.siemens.com/WW/view/en/57341736

/3/ Updates for STEP 7 V11 SP2 and WinCC V11 SP2 http://support.automation.siemens.com/WW/view/en/58112582

/4/ STEP 7 Basic V12.0 System Manual http://support.automation.siemens.com/WW/view/en/68113678 WinCC Basic V12.0 System Manual http://support.automation.siemens.com/WW/view/en/68074843

/5/ PROFINET GSDML files for SINAMICS G120C http://support.automation.siemens.com/WW/view/en/60602080

Automating with SIMATIC S7-1200 Author: Hans Berger Publicis MCD Verlag ISBN: 978-3-89578-385-2

/6/ SIMATIC Basic Panels

Operating Instructions http://support.automation.siemens.com/WW/view/en/31032678

/7/ STARTER

STARTER ICommissioning tool for SINAMICS und MICROMASTER http://support.automation.siemens.com/WW/view/en/26233208

/8/

SINAMICS G120C

Operating Instructions http://support.automation.siemens.com/WW/view/en/49380904 Parameter Manual (Parameters and Errors) http://support.automation.siemens.com/WW/view/en/49383082 Safety Integrated Function Manual http://support.automation.siemens.com/WW/view/en/50736819

/9/ This document http://support.automation.siemens.com/WW/view/en/56749384

/10/ Siemens Industry Online Support

http://support.automation.siemens.com

8 History Table 8-1: History

Version Date Revisions

V1.0 02/2013 First issue