V20 at S7-1200 USS v10 SHORT-DOCU en
V20 at S7-1200 USS v10 SHORT-DOCU en
SINAMICS V: Speed Control of a V20 with S7-1200 via USS Protocol in TIA Portal
SINAMICS V20, SIMATIC S7-1200 Short Documentation November 2012
Siemens Industry Online Support This document is taken from 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/63696870 Caution: 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 companys 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.
For further information on this topic, you may also actively use our Technical Forum in the Siemens Industry Online Support. Share your questions, suggestions or problems and discuss them with our strong forum community: http://www.siemens.com/forum-applications
Copyright
s
Overview Program Structure V20_USS_Control_1 [FB1] block
1 2 3 4 5 6 7
SIMATIC, SINAMICS
USS communication between a SINAMICS V20 drive and a SIMATIC S7-1200 PLC
Siemens AG 2012 All rights reserved
Copyright
Copyright
Table of Contents
Table of Contents
Warranty and Liability ..............................................................................................4 Table of Contents.....................................................................................................5 1 Overview .........................................................................................................6 1.1 1.2 Content .............................................................................................6 Requirements....................................................................................6 Hardware components.......................................................................6 Control software ................................................................................6 Bus wiring..........................................................................................7 USS system instructions ....................................................................8 Calling the V20_USS_Control_1 [FB1] in two OBs .............................8 Block relations ...................................................................................8 3 4 V20_USS_Control_1 [FB1] block ...................................................................9 Configuration .....................................................................................9 V20_USS_Param_1 [FB2] block................................................................... 11 4.1
Siemens AG 2012 All rights reserved
Program Structure..........................................................................................8
4.2 5 6 7
Operating modes .............................................................................11 ACTIVATE_USS mode .................................................................... 11 RW_PARAM mode ..........................................................................11 ACTUAL_STATE mode ................................................................... 12 SET_FUNCTIONS mode ................................................................. 12 Configuration ...................................................................................12
Copyright
1
1.1
Overview
Content
The present short documentation describes two blocks that you can use for the connection of a SINAMICS V20 to a SIMATIC S7-1200 via the USS protocol in STEP 7 in the TIA portal V11. This short documentation largely does not use explanations. It explains the block parameters and shows the main steps for the integration of the blocks in your own projects.
Table 1-1: Block functions Block Function Explanation Controlling SINAMICS V20 via selected STW bits Specifying setpoint speed Condition monitoring of the SINAMICS V20 via selected ZSW bits Reading of the actual speed value ACTIVATE_USS mode: Switching the operation of the cyclic process data access (BOP USS) V20_USS_Param_1 (FB2) acyclic access to parameters of up to 16 drives of a port RW_PARAM mode: Reading/writing of any inverter parameter ACTUAL_STATE mode: Reading a set of selected status information from the inverter. SET_FUNCTIONS mode: Specifying a set of selected modes.
V20_USS_Control_1 (FB1)
Copyright
1.2
Requirements
Table 1-2: Hardware components Component SIMATIC S7 -1200 CM 1241 (RS485) CB 1241 (RS485) SINAMICS V20 MLFB 6ES721 6ES7241-1CH30-0XB0 6ES7241-1CH30-1XB0 6SL3210-5BE Firmware V2.2.0 and higher V1.0 and higher V3.5 and higher
Hardware components
Control software STEP 7 BASIC, V11 SP2 Update 4 (Blocks created by V11 SP2 Update 4).
Copyright
PG/PC
Ethernet
L1 L2 L3
SIMATIC S7-1200
0V cable
M TA TRA TRB TB
SINAMICS V20
1,5 k
120 470
CPU
PROFIBUS bus connectors Port 1
Port 2
Terminate the bus on the side of the controller with 120 , as long as you dont use a PROFIBUS plug with the CM1241.
Port 3
Port 4
PROFIBUS cable
CM 1241
CM 1241
CM 1241
CB 1241
2 Program Structure
Program Structure
Figure 2-1: Program structure
V20_USS_Control_1_DB [DB1] USS_DRV_DB_1 [DB1071]
Main [OB1]
V20_USS_Control_1 [FB1]
USS_DRV [FB1071]
V20_USS_Param_1_DB [DB2]
V20_USS_Param_1 [FB2]
USS_RPM [FC1072]
USS_WPM [FC1073]
Parameters_1 [B10]
V20_USS_Control_1_DB [DB1]
Copyright
V20_USS_Control_1 [FB1]
USS_PORT [FC1070]
USS system instructions In the screen above, the system blocks marked with a padlock, are created by STEP 7 itself when calling the instructions with the same name by the blocks V20_USS_Control_1 and V20_USS_Param_1. Calling the V20_USS_Control_1 [FB1] in two OBs As you can seen in Figure 2-1, the V20_USS_Control_1 [FB1] is to be called in the cyclic program part (OB1) as well as in an interrupt OB (OB30). You do not have to configure the time interval of the interrupt. This task is performed by V20_USS_Control_1. Block relations Due to the USS system blocks, it is always necessary to also call the V20_USS_Control_1 [FB1] in the program when using V20_USS_Param_1 [FB2].
Configuration
Table 3-1: Parameter of V20_USS_Control_1 [FB1] Name OB Only parameter of the Input data segment! IN_P2010
Siemens AG 2012 All rights reserved
IN / OUT IN
Type USInt
Explanation Call ID = 1, if the FB is called by Main [OB1]; 1, if the FB is called by the interrupt OB; Baud rate The coding is identical with that of the V20 parameter P2010 (values: 612). See /5/. Hardware ID of the communication module (board) You can find the value in the device configuration in the properties of the communication module. Interrupt OB Number of the interrupt OB, in which the FB V20_USS_Control_1 also has to be called. Phase shift of the interrupt interval. The value may be relevant if more than one port is configured. The default value is 0 and can be left as only one configured port. Number of drives Number of drives that are connected to the respective port (116). Control/status data of the SINAMICS V20 Drive control word [n] The V20_USS_Control_1 [FB1] sends the following STW bits to the inverter: ON_OFF Bit 00 (Low enabled) OFF2 Bit 01 (Low enabled) OFF3 Bit 02 (Low enabled) Ack_fault Bit 07 Direction_reversal Bit 11 (True=fwd) The remaining STW bits cannot be influenced by the FB1.
IN
USInt
IN_HW_Id
IN
PORT
IN IN
Copyright
IN_Number_of_drives
IN
USInt
Drive. IN_STW[n]
IN
Struct Word
Name IN_SPEED_SP[n]
IN / OUT IN
Type Real
Explanation Setpoint speed value [%] in relation to the configured frequency If the value is positive, the V20 is running forward (as long as the Direction_reversal bit is True). Drive status word [n] The V20_USS_Control_1 [FB1] receives the following ZSW bits from the inverter: Operation_enabled Bit 02 Motor_rotates_fwd Bit 14 Closing_lockout_active Bit 06 Fault_present Bit 03 The remaining ZSW bits cannot be influenced by FB1. Actual speed value [%] Error The bit is set for a processing cycle of the FB if an error was detected by the system blocks USS_PORT or USS_DRV. Error information Drive address Address of the SINAMICS V20, where an error was signaled through OUT_ERROR. Processing status Error code of USS_PORT or USS_DRV, if OUT_ERROR signals an error. The error codes can be found in the online help fort he instructions USS_PORT and USS_DRV in the TIA portal or in chapter 12.4.6 of the S7-1200 system manual (/1/). Extended error information available From the instance DB of the system USS_DRV FB extended error information can be called if OUT_ERROR signals an error. Extended error information The address of the SINAMICS V20 where the communication error occurred can be found in the expanded error information.
1
OUT_ZSW[n]
OUT
Word
OUT_SPEED[n] OUT_ERROR
OUT OUT
Real Bool
OUT_ERROR_INFO. DRIVE_ADDR
OUT
Struct USInt
STATUS
OUT
Word
Copyright
EXTENDED_ERROR_available
OUT
Bool
EXTENDED_ERROR
OUT
UInt
Always only the error information of the error that occurred last in the instance DB is saved. A new error signalized by the OUT_ERROR bit overwrites the previous error information.
10
4
4.1
ACTIVATE_USS mode Switch the command and frequency setpoint source for the SINAMICS V20 in this mode. You can select between via USS (P0700/P1000 5 inverter parameter)
via the incorporated BOP (P0700/P1000 1 inverter parameter) Within the ACTIVATE USS mode, you can select between the following functions that can be selected with the ACTIVATE_USS.FUNCTION parameter: Check It is only checked what source has been selected. The result is output in the bool USS_selected parameter. The successful completion of the action is displayed by a DONE pulse.
Siemens AG 2012 All rights reserved
Activate It is switched to USS as command and frequency setpoint source. The result is output in the bool USS_selected parameter. The successful completion of the action is displayed by a DONE pulse. Dectivate It is switched to BOP as command and frequency setpoint source. The result is output in the bool USS_selected parameter. The successful completion of the action is displayed by a DONE pulse. RW_PARAM mode In this mode you can read or write any SINAMICS V20 parameter. Apart from specifying the data type of the desired parameter, you also have to indicate the parameter number and index. You can furthermore decide whether the value is to be stored in RAM or EEPROM when writing the value. Within the mode, you can select between the following functions that can be selected with the RW_PARAM.FUNCTION FB parameter: Read The value of the inverter parameter is read in a structure variable (OUT parameter) in V20_USS_Param_1_DB that corresponds to its data type. Write The value of the inverter parameter is retrieved from a structure variable (IN parameter) in V20_USS_Param_1_DB that corresponds to its data type and written in the SINAMICS V20. Write&read Combination of the above two functions. The inverter parameter is written into the SINAMICS V20 and subsequently read out straight away for control purposes.
Copyright
11
4 V20_USS_Param_1 [FB2] block 4.2 Configuration ACTUAL_STATE mode In this mode you read out a set of current inverter values from the SINAMICS V20 that are represented by parameters (see Parameter description in Table 4-1). SET_FUNCTIONS mode In this mode, you can select or switch the inverter functions, stored in the inverter parameters (see Parameter description in Table 4-1), on and off via the USS communication. You can select between the following functions that can be selected with the SET_FUNCTIONS.FUNCTION FB parameter: Read A defined set of inverter functions is read out from the SINAMICS V20 into a structure variable (OUT parameter). Write A defined set of inverter functions is written from a structure variable (IN parameter) into the SINAMICS V20. A further FB input parameter specifies whether you want to write to the RAM or EEPROM of the SINAMICS V20. Write&read Combination of the above two functions. The set of inverters parameter is written into the SINAMICS V20 and subsequently read out again straight away for control purposes.
4.2
Configuration
Name IN / OUT IN IN Type USInt USInt Explanation Address of the SINAMICS V20 Possible values: 116 Mode of the block 1 = ACTIVATE_USS 2 = RW_PARAM 3 = ACTUAL_STATE 4 = SET_FUNCTION Function start The selected function is executed by START with a positive edge. Enabling USS Number of drives that are connected to the respective port (116).
Copyright
DRIVE_ADDR MODE
START
IN
Bool
ACTIVATE_USS. NUMBER_OF_DRIVES
IN
Struct USInt
P2010
USInt
Baud rate The coding is identical with that of the V20 parameter P2010 (values: 612). See /5/. Function within the mode 0 = Deactivate 1 = Activate 2 = Check
FUNCTION
USInt
12
PARAM
UInt
INDEX
UInt
EEPROM
Bool
FUNCTION
USInt
IN
Copyright
IN
FUNCTION
USInt
13
USS_selected
OUT
Bool
RW_PARAM_VALUE_OUT. Int DInt USInt UInt UDInt Real ACTUAL_STATE_VALUES_OUT. FREQ_OUTPUT OUTPUT_VOLTS CURRENT DC_BUS_VOLTS TOTAL_FREQ_SP ENERGY_SAVED[n] CONNECTION_MACRO APPLICATION_MACRO
OUT
Struct Int DInt USInt UInt UDInt Real Struct Real Real Real Real Real Real UInt UInt
OUT
Actual values Act. filtered output frequency r0024 [Hz] Act. output voltage r0025 [V] Act. output current r0027 [A] Act. smoothed link voltage r0026 [V] Act. total setpoint r1078 [Hz] Act. energy saving r0043[0..2] [kWh,,CO2] connection Macro last selected p0717 user Macro last selected p0507 Further information on the meaning and on the value range of the parameters can be found in the SINAMICS V20 operating instruction /5/. Function values (OUT) Keep-running Operation P0503[n] Flying start P1200 Automatic restart P1210 Hibernation P2365[n] Super torque P3350[n] n=0..2 indicates the drive data set Information on the meaning and on the value range of the functions can be found in the SINAMICS V20 operating instruction /5/. Block in process Processing the block requires several cycles. false = not in process true = in process As long as BUSY is pending the pending parameters in the parameter bar to be transferred or the transferred parameters must not be changed.
Copyright
OUT
BUSY
OUT
Bool
14
ERROR
OUT
Bool
ERROR_INFO. DRIVE_ADDR
Siemens AG 2012 All rights reserved
OUT
STATUS
EXTENDED_ERROR_available
Bool
Copyright
EXTENDED_ERROR
UInt
Number of the parameter at which the error occurred. Index of the parameter at which the error occurred.
15
2.
3.
4.
Copyright
5.
16
Main [OB1]
V20_USS_Control_1 [FB1]
USS_DRV [FB1071]
V20_USS_Param_1_DB [DB2]
V20_USS_Param_1 [FB2]
USS_RPM [FC1072]
USS_WPM [FC1073]
V20_USS_Control_2_DB [DB3]
USS_DRV_DB_2 [DB1072]
V20_USS_Control_2 [FB3]
USS_DRV [FB1071]
V20_USS_Param_2_DB [DB4]
Copyright
V20_USS_Param_2 [FB4]
USS_RPM [FC1072]
USS_WPM [FC1073]
V20_USS_Control_1_DB [DB1]
V20_USS_Control_1 [FB1]
USS_PORT [FC1070]
V20_USS_Control_2_DB [DB3]
V20_USS_Control_2 [FB3]
USS_PORT [FC1070]
17
6 Literature
Literature
The following list is by no means complete and only provides a selection of appropriate sources.
Table 6-1: Literature Topic /1/ STEP7 SIMATIC S7 1200 Title / link SIMATIC S7 S7-1200 Automation System system manual
http://support.automation.siemens.com/WW/view/en/369 32465
Update of the S7-1200 system manual
/2/
http://support.automation.siemens.com/WW/view/en/537 41769
Universal serial interface protocol USS protocol
/3/
/4/
USS
http://support.automation.siemens.com/WW/view/en/241 78253
Configuration example CE-X11 Distributed Speed Control of a Drive via the USS Protocol
http://support.automation.siemens.com/WW/view/en/401 57517
Siemens AG 2012 All rights reserved
/5/
SINAMICS V20
http://support.automation.siemens.com/WW/view/en/638 99889
/6/ /7/ Reference to this entry Siemens Industry Online Support
Copyright
History
Table 7-1: History Version V1.0 Date 11/2012 First issue Revisions
18