Applications & Tools
Answers for industry.
Connecting a SINAMICS drive to an S7-1200 CPU in TIA Portal (via GSD file)
SINAMICS G120C, SIMATIC S7-1200
Application Description January 2012
2 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
Industry Automation and Drive Technologies Service & Support Portal
This article is taken from the Service Portal of Siemens AG, Industry Automation and Drive Technologies. 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.
If you have any questions about this document, please contact us at the following e-mail address:
mailto:[email protected]
You can also actively use our Technical Forum from the Service & Support Portal regarding this subject. Add your questions, suggestions and problems and discuss them together in our strong forum community:
http://www.siemens.com/forum-applications
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 3
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
s
SIMATIC SINAMICS G120C to S7-1200
Task
1
Solution
2 Function Mechanisms of this Application
3
Setup and Commissioning of the Application
4
Operation of the Application
5
Configuration and Settings
6
Literature
7
History
8
Table of Contents
4 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
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.
Table of Contents
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 5
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
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
SINAMICS ............................................................................................ 8 SIMATIC S7-1200 ................................................................................ 8
2.2.2 Data exchange ..................................................................................... 8 Cyclic exchange of process data ......................................................... 9 Acyclic data exchange (parameter access) ......................................... 9
2.3 Used hardware and software components......................................... 10 3 Function Mechanisms of this Application .................................................... 12
3.1 Process data exchange functionality.................................................. 13 3.1.1 Access to process data in the user program of the controller............ 13 3.1.2 Setpoint and actual value normalization ............................................ 13 3.1.3 Control and status word ..................................................................... 14 3.1.4 FB “Process Data”.............................................................................. 16 3.2 Parameter access functionality .......................................................... 19 3.2.1 Request and response structure ........................................................ 19 3.2.2 The DBs “Read/Write Drive Parameter” and “Answer from
Drive” .................................................................................................. 20 3.2.3 The “FB Parameter” ........................................................................... 22
4 Setup and Commissioning of the Application.............................................. 26 4.1 Wiring ................................................................................................. 26 4.2 Downloading the SINAMICS configuration ........................................ 27 4.3 Download the SIMATIC program ....................................................... 29
5 Operation of the Application .......................................................................... 30 5.1 Prerequisites ...................................................................................... 30 5.2 Overview ............................................................................................ 30 5.3 Operation the application via the panel.............................................. 30 5.3.1 Process data exchange...................................................................... 31 5.3.2 Parameter access .............................................................................. 32 5.4 Operating the application via watch table .......................................... 33 5.4.1 Process data exchange...................................................................... 33 5.4.2 Parameter access .............................................................................. 34
6 Configuration and Settings ............................................................................ 36 6.1 Configuration of the SINAMICS G120C drive .................................... 36 6.2 Configuring the S7-1200 controller .................................................... 40 6.3 Programming the S7-1200 ................................................................. 45 6.3.1 Creating the DBs for the data records................................................ 45 6.3.2 Parameterizing the calls of the SFBs WRREC and RDREC ............. 46
7 Literature .......................................................................................................... 48 8 History............................................................................................................... 48
1 Task
2.1 Overview of the general solution
6 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
1 Task SIMATIC S7-1200 can be operated with CM 1243-5 as PROFIBUS master. A SINAMICS drive can be employed as PROFIBUS slave and be controlled by the S7-1200.
This application example illustrates how to commission SINAMICS 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
Ethernet
PROFIBUS
Requirements for the automation problem
Table 1-1
Requirement Explanation
Access to process data The drive 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 converter
The SINAMICS converters have the capability to perform a failsafe shutdown (e.g. emergency stop).
2 Solution
2.1 Overview of the general solution
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 7
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
2 Solution This application example shows the example of connecting a SINAMICS G120C to an S7-1212C by using a GSD file.
2.1 Overview of the general solution
Schematic layout
The following figure displays the most important components of the solution:
Figure 2-1
USB(for parameterization only)
Ethernet
PROFIBUS
SINAMICS G120C S7-1212C KTP 600
Motor
Switch
PC/PG
The example shows how the:
• ...SIMANICS G converter is configured using STARTER.
• ...S7-1200 controller is configured.
• ...communication in the S7--1200 controller is programmed.
2 Solution
2.2 Description of the core functionality
8 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
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.
SINAMICS
SINAMICS is programmed with commissioning tool STARTER.
For SINAMICS G120C-DP the PROFIBUS address can either be assigned as a default value via DIP switch or, should all DIP switches be ON or OFF, via parameter 918.
The remaining PROFIBUS parameters (e.g. baud rate) are automatically detected, or transferred by the PROFIBUS master during ramp-up, hence they need not be parameterized.
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. It is important that the same message frame type is selected when parameterizing the controller.
SIMATIC S7-1200
SIMATIC S7-1200 is programmed in STEP 7 (versions as of V11). To include the SINAMICS G120 and the message frame type in the hardware catalog in STEP 7 V11 the device description file (GSD) must be imported. It is important that the same message frame type is selected as for parameterizing SINAMICS.
When inserting SINAMICS into the SIMATIC project, the IO addresses are also defined which shall be used by the controller for accessing the converter.
2.2.2 Data exchange
Data exchange between drive and PLC 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
2 Solution
2.2 Description of the core functionality
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 9
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
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)
The original PROFIBUS specification (meanwhile referred to as PROFIBUS DPV0) only allowed the exchange of cyclic data. To be able to transfer parameters, message frame types (also referred to as PPO) 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.
PROFIBUS DPV1 has created 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 drive by writing data record 47, and the response of the drive is read by reading data record 47.
• No particular action is required on the drive side.
2 Solution
2.3 Used hardware and software components
10 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
2.3 Used hardware and software components
The application document was generated using the following components:
Hardware components
Table 2-1
Component Qty. Order no. Note
CPU 1212C AC/DC/RLY 1 6S7 212-1BD30-0XB0 or other S7-1200 CPU (with firmware 2.0 or higher)
PROFIBUS Master module CM 1243-5
1 6GK7 243-5DX30-0XE0
SINAMICS G120C 1 6SL3210-1KE11-8AP0 or SINAMICS G120 with CU240x-2 DP –x
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 G120 PC converter connection record 2m
1 6SL3255-0AA00-2CA0
Contains STARTER on DVD and USB cable. Alternatively, the SW can be downloaded and a standard Micro USB cable be used.
SINAMICS IOP or SINAMICS BOP-2
1 6SL3255-0AA00-4JA0 6SL3255-0AA00-4CA1
optional
Connector plug PROFINET
4 6GK1901-1BB10-2AA0
The number does not take into account the connection to the configuration PG/PC
PROFIBUS line 6XV1840-2AH10
Connector plug PROFIBUS
2 6ES7972-0BA52-0XA0 or 6ES7972-0BA52-0XA0 (with PG female connector)
PROFIBUS line 6XV1830-0EH10
Standard software components
Table 2-2
Component Qty. Order number Note
STEP 7 BASIC V11 Single License 6ES7822-0AA01-0YA0 SIMATIC STEP 7 V11
SP2 1
STEP 7 PROFESIONAL V11 Floating License 6ES7822-1AA01-0YA5
The BASIC version is sufficient, however, you can also use the professional version.
STARTER V4.2.0.1
1 6SL3072-0AA00-0AG0 Also downloadable free of charge: see \4\
GSD file for 1 - Also downloadable free
2 Solution
2.3 Used hardware and software components
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 11
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
Component Qty. Order number Note
SINAMICS G120 of charge: see \5\
Example files and projects
The following list contains all files and projects that are used in this example.
Table 2-3
Component Note
56749384_SINAMICS_G12C_at_S7-1200_CODE_v10.zip This zip file contains the STEP 7 project.
56749384_SINAMICS_G12C_at_S7-1200_STARTER_v10.zip Password for Safety settings: 12345
This zip file contains the STARTER project. The password for the safety settings is “12345”.
56749384_SINAMICS_G12C_at_S7-1200_DOKU_v10_en.doc This document.
CAUTION The STARTER project is designed for use with the components listed in Table 2-1.
When a SINMAICS G12C with other power rating or a other motor are used without adjusting the required parameters, the inverter or the motor can be damaged.
3 Function Mechanisms of this Application
2.3 Used hardware and software components
12 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
3 Function Mechanisms of this Application
Program overview
Figure 3-1
SFB “RDREC“
OB Main FB “Process Data“
FB “Parameters“
DB “Process Data“
DB “Parameters“
SFB “WRREC“DB „Write param“
DB „Read param“
DB „Answer“
OB Startup
Separate function blocks are used for both communication areas, process data exchange and parameter access.
3 Function Mechanisms of this Application
3.1 Process data exchange functionality
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 13
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
3.1 Process data exchange functionality
Figure 3-2
SFB “RDREC“
OB Main FB “Process Data“
FB “Parameters“
DB “Process Data“
DB “Parameters“
SFB “WRREC“DB „Write param“
DB „Read param“
DB „Answer“
OB Startup
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. After selecting the message frame type, the precise length and structure is specified. Message frame type “Siemens telegram 352, PZD 6/6” used in the example exchanges 6 words in both directions.
3.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 during specifying the hardware configuration, see step 13 in Table 6-2
3.1.2 Setpoint and actual value normalization
The setpoint 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.
Further information is available in chapter 7 “Configuring the fieldbus” of the operating instruction (\6\) for SINAMICS G120C.
3 Function Mechanisms of this Application
3.1 Process data exchange functionality
14 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
3.1.3 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 3-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.
3 Function Mechanisms of this Application
3.1 Process data exchange functionality
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 15
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
Figure 3-4: Status word of the message frame type “Siemens telegram 352, PZD 6/6”
Data consistency
For the MOVE command of S7-1200 the consistency is given (for 1, 2 and 4 bytes). This ensures that the individual elements, such as control word and setpoint value are always consistent. The consistency across all elements is only given if the entire IO data area for the converter lies within the process image as in this example.
When using direct IO accesses (e.g. %AW25:P) with MOVE commands, inconsistencies between the individual elements may result. In this case, a consistent transfer can be ensured by using DPRD_Dat and DPWR_Dat.
3 Function Mechanisms of this Application
3.1 Process data exchange functionality
16 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
3.1.4 FB “Process Data”
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.
Figure 3-5: FB “Process Data”
Network 1
In network 1 the status word, the actual alarm, and the fault are directly copied from the respective IO input words into the output tags. Since the actual values for speed, current and torque come as standardized integers, they are initially copied into temporary tags so they can be converted into floating point numbers in the subsequent networks.
3 Function Mechanisms of this Application
3.1 Process data exchange functionality
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 17
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
Figure 3-6: Network 1
Network 2, 3 and 4
Within networks 2, 3 and 4 the intermediately stored actual values are converted to floating point numbers and copied to the output tags.
The multiplication factor must correspond here to the normalization selected in the converter (reference values P2000 to P2006). In order to save resources the divider and the multiplier can also be combined.
Figure 3-7: Network 2
3 Function Mechanisms of this Application
3.1 Process data exchange functionality
18 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
Network 5
In network 5 the setpoint speed value is transformed to the format expected by the converter. The normalization factor / reference speed value P2000 of SINAMICS is used here.
Figure 3-8
Network 6
In network 6 the control word and the setpoint (speed) value are copied to the respective output IO words.
Figure 3-9
3 Function Mechanisms of this Application
3.2 Parameter access functionality
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 19
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
3.2 Parameter access functionality
Figure 3-10
SFB “RDREC“
OB Main FB “Process Data“
FB “Parameters“
DB “Process Data“
DB “Parameters“
SFB “WRREC“DB „Write param“
DB „Read param“
DB „Answer“
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 “Write data record” and “Read data record” function must be used for this. Data record 47 must always be used.
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 response of the converter visible in the controller where it can then be evaluated.
For reading and writing data records, the system function blocks “WRREC” and “RDREC” become available in the controller.
3.2.1 Request and response structure
The structure of requests and responses is available in chapter 7.2.6 “Configure fieldbus, communication via PROFIBUS, acyclic communication” in the operating instruction (\6\)
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.
3 Function Mechanisms of this Application
3.2 Parameter access functionality
20 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
3.2.2 The DBs “Read/Write Drive Parameter” and “Answer from Drive”
The request to access a parameter consists of at least 10 words. Therefore, the request shall be summarized in a DB or in the memory area; in the example, the “Read/Write Drive Parameter” and “Answer from Drive” DBs. The response from the converter also consists of several words; therefore, the example uses DB “Answer from Drive” for this.
A request may contain the access to several parameters. Since the length of the data to be transferred per request depends on the number and the data type of the converter parameter, a generally accepted structure cannot be generated.
Therefore, only the ramp-up and ramp-down times are accessed in the example (P1120 and P1121). The request to read both parameters is stored in DB “Read Drive Parameter”, the request to write them is stored in DB “Write Drive Parameter”.
The response of the converter is copied to DB “Answer from Drive”.
ATTENTION When creating the DBs for the data records, “standard compatible with S7-300/400” must be selected.
See also chapter 6.3, Programming the S7-1200
.
Figure 3-11: DB for reading the ramp-up and ramp-down time
3 Function Mechanisms of this Application
3.2 Parameter access functionality
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 21
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
Figure 3-12: DB for the response of the converter (read request)
Figure 3-13: DB for writing the ramp-up and ramp-down time (in the screenshot: 10s and 15 s)
3 Function Mechanisms of this Application
3.2 Parameter access functionality
22 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
3.2.3 The “FB Parameter”
Parameter access in “FB Parameters” example which is called cyclically by OB Main.
Figure 3-14
Table 3-1 “FB Parameters” interface assignment
Name Type Function
Input/output
START BOOL A rising edge starts the transfer, the signal is reset to 0 by the FB
Inputs
Ramp_Time_Up REAL Ramp up time to be written
Ramp_Time_Down REAL Ramp down time to be written
READ_WRITE BOOL 0= Read parameter 1= Write parameter
Outputs
Actual_Ramp_Time_Up REAL Ramp up time read
Actual_Ramp_Time_DOWN REAL Ramp up time read
Busy BOOL Access in progress
transfer _done BOOL Access successful
tansfer_error BOOL Access aborted with an 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
3 Function Mechanisms of this Application
3.2 Parameter access functionality
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 23
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
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 3-15: Sequence chart
3 Function Mechanisms of this Application
3.2 Parameter access functionality
24 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
In the individual states of the sequence chart the following functions are executed:
Table 3-2 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.
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 Set output signals The “BUSY” signal is deleted, the “transfer.done” signal is set and step 0 is activated.
3 Function Mechanisms of this Application
3.2 Parameter access functionality
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 25
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
Calling the system functions Write data record and Read data record
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 (SFB “WRREC” and SFB “RDREC”) are called in the second part.
With input tag “READ/WRITE” you chose which of both SFB “WRREC” calls is active. 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.
Figure 3-16
4 Setup and Commissioning of the Application
4.1 Wiring
26 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
4 Setup and Commissioning of the Application
4.1 Wiring
The figure below shows the hardware setup of the application.
Figure 4-1
L1L2L3N
PE
MY
L1 L2 L3 PE
U2 V2 W2 PB
L+ M PE L1 N PE L+ M
PB LAN
LAN M L+
24 V DCSINAMICSG120C
SIMATIC PanelKTP600
SIMATIC S7CPU 1212C
Note The setup guidelines in the manual (see \6\) of SINAMICS and SIMATIC (see \7\) must be generally followed.
4 Setup and Commissioning of the Application
4.2 Downloading the SINAMICS configuration
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 27
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
4.2 Downloading the SINAMICS configuration
This chapter describes the steps for downloading the example configuration.
When using a different converter, you must perform your own parameterization. Follow the instruction in chapter 6 Configuration and Settings
.
Table 4-1
No. Action Remarks
1 Connect SINAMICS G120C with the PG/PC via USB cable.
2 Dearchive the starter project and open it
3 Open “Set the PG/PC interface”
4 Setup and Commissioning of the Application
4.2 Downloading the SINAMICS configuration
28 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action Remarks
4 Ensure, that the “S7USB” interface assignment has been selected for access point “DEVICE (STARTER/SCOUT)” and acknowledge with OK
5 Go online
6 Start the download, and checkmark “After loading, copy RAM to ROM”. When different parameters for the power unit are indicated, please perform your own parameterization. In this case you
follow the instructions in chapter 6 Configuration and Settings
7 Go offline
Note The password assigned in the example project for safety programming is “12345”.
4 Setup and Commissioning of the Application
4.3 Download the SIMATIC program
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 29
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
4.3 Download the SIMATIC program
This chapter describes the steps for the installation of the sample code.
Table 4-2
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 V11 project and copy it to a directory
3. Start the TIA portal.
4. Open the unzipped project by using the Browse function and navigate to the unzipped project.
5. Select the CPU (PLC_1) and click on “Download to device”.
6. Connect the panel with the PG/PC via the network cable
Use a switch to connect the panel.
7. If you wish to use the panel, select the panel (HMI_1) and click on “Download to device”
8. Now connect the panel to the controller using the network cable
If you use a switch, you don’t need to change anything.
5 Operation of the Application
5.1 Prerequisites
30 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
5 Operation of the Application
5.1 Prerequisites
To be able to switch on the drive via the panel or the watch table, the following points must be met:
• 24V must be supplied to terminals 16 and 17 (DI 4 and 5) of the SINAMICS G120C, otherwise the STO safety function is active, the yellow “SAFE” LED at the converter is blinking and the drive cannot be switched on.
• Terminal 8 (DI 3) must not be supplied with 24 V, otherwise the command data record is switched.
• 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 ( )
• When using a BOP-2, please check whether the hand icon ( ) is displayed. If yes, press the Hand/Auto button ( )
5.2 Overview
In this example, the following functions have been realized:
• Process data
– On/Off switch and Acknowledge error
– Entering the setpoint speed value
– Display of the control or status word
– Display of the current actual values for speed, current and torque
– Display of current warning and fault
• Parameter access
– Reading the current ramp-up and ramp-down times
– Writing new ramp-up and ramp-down times
5.3 Operation the application via the panel
Figure 5-1
The functions of the example can be used easily via the panel. At the bottom edge you see three labeled buttons and three with symbols.
• You can use the three buttons (with symbols) to
– have the alarm window displayed.
– change the language (German or English).
– terminate Runtime.
• You can use both left buttons to trigger the functions of the displayed page.
• Use the third button to switch over between process data and parameter access.
5 Operation of the Application
5.3 Operation the application via the panel
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 31
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
5.3.1 Process data exchange
Figure 5-2
Table 5-1
Action Remark
1. In the case of a fault the “Ack.” button is red. Press “Ack.” to acknowledge the fault. Otherwise, proceed with step 3.
Pressing the “Ack.” button sets bit 7 in the control word and releasing the button deletes it.
2. If the “On/Off” is green, press it once. The converter is started with a rising edge of bit 0. If bit 0 has already been set, it must initially be deleted.
3. Pressing the “On/Off“ button (again) switches the converter on (and off again).
4. In the “Setpoint” field you can assign the setpoint value for the drive.
You can assign values between 0 and 1500U/min.
5 Operation of the Application
5.3 Operation the application via the panel
32 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
5.3.2 Parameter access
Figure 5-3
Table 5-2
Action Remark
1. In both input fields on the left side you can assign the new values for the ramp-up and ramp-down time.
These values are only used for write requests.
2. Select the access type via the second button (“Read“ or “Write“).
The function displayed on the button is currently selected.
3. Start the access with the “Start” key.
4. The status bits show you the result of the access, the read values are displayed on the right-hand side.
5 Operation of the Application
5.4 Operating the application via watch table
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 33
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
5.4 Operating the application via watch table
You can also use the application without panel. Two watch tables are created in the project for this purpose.
5.4.1 Process data exchange
Table 5-3
No. Action Remarks
1 Open the project in the TIA Portal
2 Open the “Process Data” watch table and go online
3 Should the current fault not be 0 (=no error), then you change Bit 7 in the “Modify value” column (Acknowledging fault) to 1 and send the modification to the controller. The rising edge at Bit 7 acknowledges the fault.
4 If no fault is pending (anymore), you can switch the drive on or off by setting Bit 0. The setpoint value can be modified in the second line. After each value change you must
transmit to the CPU, e.g. with .
5 If a fault occurs in the drive, the fault must be acknowledged (rising edge in Bit 7) and the On command (Bit 0) be deleted before being able to switch back on with a rising edge at Bit 0.
5 Operation of the Application
5.4 Operating the application via watch table
34 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
5.4.2 Parameter access
Table 5-4
No. Action
1 Open the project in the TIA Portal
2 Open the “Parameter” watch table and click on “Monitor all”
2 Set the START tag to 1. Right-click in the first line to open the menu and select “Modify” and “Modify to 1”.
5 Operation of the Application
5.4 Operating the application via watch table
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 35
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action
3 After running through the step chain in the controller, the result of the parameter access is displayed with “transfer_done” or “transfer_error” respectively. If “transfer_done” has been set, the current ramp-up and ramp-down time in line 8 and 9 can be read.
4 In the “Modify value“ column you write
• value 0 for START
• value 1 for READ_WRITE (= write request)
• time for ramp-up in line 3 and
• time for ramp-down in line 4
and send this to the CPU by clicking . Then you start the parameter access by setting “START” to 1 (as in step 2)
5 After running through the step chain in the controller, the result of the parameter access is displayed with “transfer_done” or “transfer_error” respectively. If “transfer_done” has been set, the new times were successfully activated in the converter.
6 Configuration and Settings
6.1 Configuration of the SINAMICS G120C drive
36 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
6 Configuration and Settings The subsequent tables describe what to do in order to configure SINAMICS G120C and SIMATIC S7 CPU1212 by yourself.
If you only wish to download and commission the example program, please follow the instructions in chapter 4 Setup and Commissioning of the Application.
6.1 Configuration of the SINAMICS G120C drive
Table 6-1
No. Action Remarks
1. Install the STARTER software; (see also \4\).
2. Connect the SINAMICS G120C to your PG/PC via USB cable.
3. Start the STARTER software.
4. Create a new project
5. Clock on “Accessible nodes”.
6. Should your drive not be found, set the Access point to “DEVICE (STARTER, SCOUT)” and the PG/PC interface to “S7USB”
(see also line 4 in Table 4-1) and click on “Update”
6 Configuration and Settings
6.1 Configuration of the SINAMICS G120C drive
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 37
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action Remarks
7. Tick the checkbox next to the found converter and press “Accept” and then “Close”
8. Go online.
9. In the tree you select the converter and then select “Restore factory settings”.
10. Remove the checkmark at “Save factory settings to ROM” and click “OK”.
11. Expand the tree and double-click on “Configuration”. Then call up the Wizard.
6 Configuration and Settings
6.1 Configuration of the SINAMICS G120C drive
38 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action Remarks
12. Run through the wizard and enter the data you need. Ensure that in step “Defaults of the setpoint/command sources” the fieldbus is selected.
In the tree you double-click on “Communication, PROFIBUS”, select one of the tabs “Receive direction” or “Transmit direction” and select the “Siemens telegram 352, PZD 6/6)”. In the “Configuration” tab you ensure that Address 3 has been set, or check whether the DIP switches have been set appropriately.
13.
Note: The telegram type had been adjusted to the example. It is important that the same message frame has been selected here as in the hardware parameterization in STEP 7.
14. Open “Safety Integrated” from the tree and click on “Change settings”.
6 Configuration and Settings
6.1 Configuration of the SINAMICS G120C drive
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 39
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action Remarks
15. Select “STO via terminal”, click on “Copy parameter” and then on “Activate settings”.
16. Enter a password. Then you click on “Activate settings” again. (The password used in this example is “12345”)
17. Press “Yes” to save the parameters to ROM.
18. Download the configuration created online to the PG
19. Go offline
20. Save the project on your hard disc.
6 Configuration and Settings
6.2 Configuring the S7-1200 controller
40 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action Remarks
21. Archive the project.
6.2 Configuring the S7-1200 controller
This chapter describes how to configure the S7-1200 for the example program. Integrating the buttons and programming the S7-1200 is not discussed in this chapter.
Table 6-2
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.
6 Configuration and Settings
6.2 Configuring the S7-1200 controller
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 41
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action Remarks
3. If the GSD file of SINAMICS G120C has already been installed, you may skip this step! Otherwise, extract it to a directory (see \5\), select the desired languages via the menu items “Options, Install general station description file (GSD)”, install it and restart the TIA Portal, if necessary. Then change back to the Project view.
4. Create a new project and assign a name (e.g. “G120C_at_S7-1200”)
5. Double-click on “Add new device”
6 Configuration and Settings
6.2 Configuring the S7-1200 controller
42 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
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. From the catalog you drag the CM1243-5 communication module to the first free location next to the CPU
8. Go to “Network overview” and drag the “6SL3210-1KExx-xxP0” module to the workspace. The path for the module is:
• Other field devices
• PROFIBUS DP
• Drives
• SINAMICS
• SINAMICS G120C(DP) V4.4
9. Connect both PROFINBUS connections with each other.
6 Configuration and Settings
6.2 Configuring the S7-1200 controller
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 43
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action Remarks
10. Click on the PROFIBUS connections, select “PROFIBUS address” in Properties and set Address 1 for CPU 1212 and Address 3 for SINAMICS. (The screenshot on the right represents SINAMICS)
11. Double-click on SINAMICS to have it displayed in “Device view”.
12. Drag “Siemens telegram 352, PZD 6/6” to the first “free” slot
6 Configuration and Settings
6.2 Configuring the S7-1200 controller
44 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
No. Action Remarks
Mark the “Siemens telegram 352, PZD 6/6” line Set 68 for the input and output address.
13.
Note: Message frame type and address have been adjusted to this example. It is important here that the same message frames have been selected as in the STARTER during the SINAMICS parameterization, and that the process data are read from “I address” or written to “Q address”.
14. Save your project
6 Configuration and Settings
6.3 Programming the S7-1200
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 45
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
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 the block access, otherwise the converter acknowledges all data records with fault alarms.
Figure 6-1
If you have already created the DB with optimized access, you can unselect the “Optimized block access” attribute in the Properties of the DB and reload the DB to the CPU.
6 Configuration and Settings
6.3 Programming the S7-1200
46 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
6.3.2 Parameterizing the calls of the SFBs WRREC and RDREC
Connection ID
“xxx[Head]” must be selected at the “ID” block connection, where “xxx” corresponds to the name of the slave in the network overview. In this example it is “Slave_1[Head]”
Figure 6-2
INDEX connection
The data record to be used must be specified at the INDEX connection. This is always 47.
RECORD connection
An ANY pointer is pointing to the data record should be used at connection RECORD.
Example for the ANY pointer:
Table 6-3
ANY pointer Meaning Remarks
P#DB100.DBX0.0 BYTE 28 The data is located in DB100 from Byte 0 on and 28 bytes are used
This is the pointer from the example, pointing to the data record, writing the ramp-up and ramp-down time
P#DB154.DBX18.0 WORD 14 The data is located in DB154 from Byte 18 on and 14 words are used
P# M 50.0 BYTE 10 The data is located in memory bytes 50 to 59.
LEN connection (hidden)
6 Configuration and Settings
6.3 Programming the S7-1200
SINAMICS G120C to S7-1200 V1.0, Entry ID: 56749384 47
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
At the LEN connection the length of the data to be transmitted can be specified in bytes. Since this information is already contained in the ANY pointer at connection RECORD, no information is given here.
7 Literature
48 SINAMICS G120C to S7-1200
V1.0, Entry ID: 56749384
Co
pyr
igh
t
Sie
me
ns
AG
20
11
All
righ
ts r
ese
rve
d
7 Literature The following list is by no means complete and only provides a selection of appropriate sources.
Table 7-1
Topic Title / link
\1\ STEP7 Automation with SIMATIC S7-1200 Hans Berger Publicis MCD Verlag ISBN-13: 9783895783555 ISBN-10: 3895783552
\2\ Reference to the document
http://support.automation.siemens.com/WW/view/en/56749384
\3\ Siemens I IA/DT Customer Support
http://support.automation.siemens.com
\4\ STARTER http://support.automation.siemens.com/WW/view/en/26233208
\5\ GSD files for SINAMICS G120
http://support.automation.siemens.com/WW/view/en/23450835
\6\ SINAMICS G120C Manuals
Operating instructions:
http://support.automation.siemens.com/WW/view/en/49380904
List manual (parameters and error list):
http://support.automation.siemens.com/WW/view/en/49383082
Function manual Safety Integrated:
http://support.automation.siemens.com/WW/view/en/50736819
\7\ SIMATIC S7-1200 System manual
http://support.automation.siemens.com/WW/view/en/36932465
8 History
Table 8-1
Version Date Revisions
V1.0 01/2012 First issue