Applikationen & Tools: SINAMICS V: Positioning The V20 in STEP 7-Micro/Win With The S7-200 PLC Over The USS Protocol
Applikationen & Tools: SINAMICS V: Positioning The V20 in STEP 7-Micro/Win With The S7-200 PLC Over The USS Protocol
Applikationen & Tools: SINAMICS V: Positioning The V20 in STEP 7-Micro/Win With The S7-200 PLC Over The USS Protocol
Caution
The functions and solutions described in this article confine themselves to the
realization of the automation task predominantly. Please take into account
furthermore that corresponding protective measures have to be taken up in the
context of Industrial Security when connecting your equipment to other parts of the
plant, the enterprise network or the Internet. Further information can be found under
the Item-ID 50203404.
http://support.automation.siemens.com/WW/view/en/50203404
You can also actively use our Technical Forum from the Siemens Industry Online
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Support regarding this subject. Add your questions, suggestions and problems and
discuss them together in our strong forum community:
http://www.siemens.com/forum-applications
Error! Unknown document property name.
SINAMICS_V20_connect to_S7-200 via USS.doc
Automation solution 2
Functional mechanisms 3
Commissioning 4
SIMATIC, SINAMICS
Operation 5
SINAMICS V: Positioning the V20
in STEP 7-Micro/WIN with the Literature 6
Copyright Siemens AG Error! Unknown document property name. All rights reserved
We do not accept any liability for the 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 breach of a condition which goes to the root of the contract
(“wesentliche Vertragspflichten”). 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 of the burden of proof to
your detriment.
Table of contents
Warranty and liability................................................................................................... 4
Table of contents ......................................................................................................... 5
1 Task..................................................................................................................... 6
1.1 Overview of the automation task.......................................................... 6
1.2 Sequence control ................................................................................. 7
2 Automation solution.......................................................................................... 8
2.1 Hardware and software components used........................................... 8
2.2 Setup .................................................................................................... 9
Copyright Siemens AG Error! Unknown document property name. All rights reservedError! Unknown document property name.
3 Functional mechanisms.................................................................................. 11
3.1 USS protocol ...................................................................................... 11
3.2 Communication program .................................................................... 12
3.2.1 Initialize interface................................................................................ 12
3.2.2 USS control block............................................................................... 13
4 Commissioning................................................................................................ 16
4.1 Installing and wiring the hardware...................................................... 16
4.2 Downloading the SIMATIC program .................................................. 17
4.3 V20 commissioning ............................................................................ 22
4.3.1 Introduction to the built-in BOP .......................................................... 22
4.3.2 Inverter parameters setting ................................................................ 24
5 Operation.......................................................................................................... 28
5.1 Jog reverse......................................................................................... 28
5.2 Jog forward......................................................................................... 29
5.3 Auto mode .......................................................................................... 30
6 Related literature ............................................................................................. 31
7 History............................................................................................................... 32
1 Task
Communication between an inverter and a PLC is often required in a diversity of general motion
control applications. Taking reciprocating motions for example, communication between a
controller (S7-200)and a frequency inverter (SINAMICS V20) takes place with the aid of the
USS protocol.
1
sen3 0
1
sen4 0
Speed(Hz)
50
Forward
Copyright Siemens AG Error! Unknown document property name. All rights reserved
35
-35
Reverse
-50
PLC deals with these digital inputs and issues commands to the inverter.
These sensors used in the application example are inductive BERO proximity
switches, which will not cause mechanical wear. Working principle: When the
Note permeable material approaches the switch sensing surface, the magnetic field is
subject to decay, causing the change of the output signal of the switch.
2 Automation solution
2.1 Hardware and software components used
Hardware components
No. Component Order number Quantity
1 SIMATIC S7-200 CPU 224XP 6ES7214-2BD23-0XB0 1
1
2 SINAMICS V20 1.5Kw without filter; FSA * 6SL3210-5BE21-5UV0 1
3 Transformer(380V/220V)2* 1
4 Motor 1.1kW 1LA7083-4AA60 1
3
5 Sensor * 3RG40-13-0AG01 4
3RV1021-1JA10 1
6 Circuit breaker
2RV1021-1JA10 1
JOG/AUTO switch button 3SB3602-2KA11 1
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Software components
User can order these CDs that contain the following software tools:
No. Component Order number Quantity
1 STEP7 Micro/WIN V4.0 SP6 6ES7810-2CC03-0YX0 1
2 S7-200 Instruction Library 6ES7830-2BC00-0YX0 1
2.2 Setup
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Note The SINAMICS V20 supports communication with Siemens PLC over USS on
RS485. You can parameterize whether the RS485 interface shall apply USS
protocol. USS is the default bus setting. A screened twisted pair cable is
recommended for the RS485 communication.
Make sure that you terminate the bus correctly by fitting a 120 R bus termination
resistor between the bus terminals (P+, N-) of the device at one end of the bus
and a termination network between the bus terminals of the device at the other
end of the bus. The termination network should be a 1.5 k resistor from 10 V to
P+, 120 R from P+ to N- and 470 R from N- to 0 V. A suitable termination network
is available from your Siemens dealer.
3 Functional mechanisms
3.1 USS protocol
The USS protocol was developed in order to exchange process data between a master and one
or more slave stations on an RS485 bus. Each bus station is identified by a unique bus address.
The USS protocol is an interrupt driven application. In the worst case, the receive message
interrupt routine requires up to 2.5 ms to execute. During this time, all other interrupt events are
queued for service after the receive message interrupt routine has been executed. If your
application cannot tolerate this worst case delay, then you may want to consider other solutions
for controlling drives.
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Initializing the USS protocol dedicates a S7-200 SMART CPU port for USS communications.
You use the USS_INIT instruction to select either USS or PPI for port 0 or port 1. (USS refers to
the USS protocol for Siemens drives.) When a port is set to use the USS protocol for
communicating with drives, you cannot use the port for any other purpose, including
communicating with an HMI. The second communications port allows STEP 7-Micro/WIN
SMART to monitor the control program while USS protocol is running.
The USS instructions affect all of the SM locations that are associated with Freeport
communication on the assigned port.
The USS subroutines and interrupt routines are stored in your program. The USS instructions
increase the amount of memory required for your program by up to 3050 bytes. Depending on
the specific USS instructions used, the support routines for these instructions can increase the
overhead for the control program by at least 2150 bytes and up to 3050 bytes.
The variables for the USS instructions require a 400-byte block of V memory. The starting
address for this block is assigned by the user and is reserved for USS variables.
Some of the USS instructions also require a 16-byte communications buffer. As a parameter for
the instruction, you provide a starting address in V memory for this buffer. It is recommended that
a unique buffer be assigned for each instance of USS instructions.
When performing calculations, the USS instructions use accumulators AC0 to AC3. You can also
use the accumulators in your program; however, the values in the accumulators will be changed
by the USS instructions.
Note To change the operation of a port back to PPI so that you can communicate with
STEP 7-Micro/WIN, use another USS_INIT instruction to reassign the port to PPI
operation.
You can also set the mode switch on the S7-200 to STOP mode. This resets the
parameters for the port. Be aware that stopping the communication to the drives
also stops the drives.
Before sending a command from the controller to a slave, make sure that you activate the
initialization of the interface of the S7-200 controller. This is achieved using the USS_INIT block,
which among other things fixed the baud rate (see Figure 3-1).
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Figure 3-1
Input/Output Date Type Value
EN BOOL Initialization is required after every time the
communication state is changed. The EN
channel should be pulsed to activate this
initialization.
Mode BYTE Choose communication protocol by using
following USS input value.
1: Select USS protocol for port 0. And start
using this protocol.
0: Select PPI protocol for port 0. And stop
using USS protocol.
Baud DWORD Baud rate:1200,2400,4800,9600,
19200
Active DWORD Active drive address
Done BOOL After execute USS_INIT instruction Done=1.
Error BYTE If something is wrong with executing
instructions, an error code is displayed.
The inputs of the USS_CTRL function block are used to control the inverter and set the desired
speed. The inverter status signals are provided by the outputs of the USS_CTRL block.
The USS_CTRL (port 0) or USS_CTRL_P1 (port 1) instruction is used to control an ACTIVE
Micro Master drive. The USS_CTRL instruction places the selected commands in a
communication buffer, which is then sent to the addressed drive (DRIVE parameter), if that drive
has been selected in the ACTIVE parameter of the USS_INIT instruction.
Only one USS_CTRL instruction should be assigned to each drive.
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Figure 3-2
The EN bit must be on to enable the USS_CTRL instruction. This instruction should
always be enabled.
RUN (RUN/STOP) indicates whether the drive is ON (1) or OFF (0). When the RUN bit is
on, the Micro Master drive receives a command to start running at the specified speed
and direction. In order for the drive to run, the following must be true:
DRIVE must be selected as ACTIVE in USS_INIT.
OFF2 and OFF3 must be set to 0.
FAULT and INHIBIT outputs must be 0.
When RUN is off, a command is sent to the Micro Master drive to ramp the speed down
until the motor comes to a stop. The OFF2 bit is used to allow the Micro Master drive to
coast to a stop. The OFF3 bit is used to command the Micro Master drive to stop quickly.
The F_ACK (Fault Acknowledge) bit is used to acknowledge a fault in the drive. The
drive clears the fault (Fault) when F_ACK goes from 0 to 1.
The DIR (direction) bit indicates in which direction the drive should move.
The Drive (drive address) input is the address of the Micro Master drive to which the
USS_CTRL command is to be sent. Valid addresses: 0 to 31
The Type (drive type) input selects the type of drive. For a Micro Master 3 (or earlier)
drive, set Type to 0. For a Micro Master 4 drive, set Type to 1.
Speed_SP (speed setpoint) is drive speed as a percentage of full speed. Negative
values of Speed_SP cause the drive to reverse its direction of rotation. Range: -200.0%
to 200.0%.
The inputs of speed: The speed setpoint is a percentage of the full speed, and the full speed
can be set with P2000. Furthermore, the value of P2000<= P1082.
a. P2000 represents the reference frequency for frequency values which are displayed and
transferred as a percentage or a hexadecimal value.
b. P1082 represents the maximum frequency. Set maximum motor frequency at which
motor runs irrespective of the frequency setpoint. The value set here is valid for both
clockwise and anticlockwise rotations.
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Figure 3-3
Fault indicates the state of the fault bit (0 - no fault, 1 - fault). The drive displays the fault
code. (Refer to the manual for your drive). To clear the Fault bit, correct the cause of the
fault and turn on the F_ACK bit.
Inhibit indicates the state of the inhibit bit on the drive (0 - not inhibited, 1 - inhibited). To
clear the inhibit bit, the Fault bit must be off, and the RUN, OFF2, and OFF3 inputs must
also be off.
D_Dir indicates the drive's direction of rotation.
Run_EN (RUN enable) indicates whether the drive is running (1) or stopped (0).
Speed is drive speed as a percentage of full speed. Range: -200.0% to 200.0%
Status is the raw value of the status word returned by the drive.
Error is an error byte that contains the result of the latest communication request to the
drive. The Iinstructions, topic defines the error conditions that could result from executing
the instruction.
The Resp_R (response received) bit acknowledges a response from the drive. All the
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Active drives are polled for the latest drive status information. Each time the S7-200
receives a response from the drive, the Resp_R bit is turned on for one scan and all the
following values are updated
Note To clear forbidden positions, make sure you clear the active faults RUN, OFF2,
OFF3 inputs also need be cleared. After error cleared, set F_ACK to clear Fault.
4 Commissioning
4.1 Installing and wiring the hardware
The USS protocol allows only one master which does not require an assigned address.
Copyright Siemens AG Error! Unknown document property name. All rights reserved
Note It is assumed here that the necessary software has been installed on your
computer and that you are familiar with handing the software.
Furthermore it is assumed, that STEP7 Micro/WIN has been installed on the
standard Windows PC for operator control.
We offer you examples with test code test parameters as a download. The software examples
support you during the first steps and tests with your STEP7-Micro/WIN. The enable quick
testing of hardware and software interfaces between the products described in the tool.
Note When commissioning the inverter, the connection macro setting is a one-off
setting. Make sure that you proceed as follows before you change the
connection macro setting to a value different from your last setting:
1. Do a factory reset (P0010 = 30, P0970 = 1)
2. Repeat the quick commissioning and change the connection macro
Failure to observe may cause the inverter to accept the parameter settings from
both the currently and the previously selected macros, which may lead to
undefined and unexplainable inverter operation.
However, communication parameters P2010, P2011, P2021 and P2023 for
connection macros Cn010 and Cn011 are not reset automatically after a factory
reset. If necessary, reset them manually.
After changing P2023 setting for Cn010 or Cn011, power-cycle the inverter.
During the power-cycle, wait until LED has gone off or the display has gone blank
(may take a few seconds) before re-applying power.
2.
Set the 50/60 Hz selection menu. Choose 50Hz or 60Hz depending on in which region or
country the inverter is used. Do a factory reset (P0010 = 30, P0970 = 1)
Copyright Siemens AG Error! Unknown document property name. All rights reserved
3.
Perform quick commissioning using the setup menu.
The setup menu guides you through the main steps required for quick
commissioning of the inverter system. It consists of the following four sub-menus:
Sub-menu Functionality
Sets nominal motor parameters for
1) Motor data
quick commissioning
Sets macros required for standard
2) Connection macro selection
wiring arrangements
Sets macros required for certain
3) Application macro selection
common applications
Sets parameters necessary for
4) Common parameter selection
inverter performance optimization
To switch on the inverter with the PLC, observe the following requirements:
Note
The baud rate of the inverter (P2010) and the PLC program must
be the same.
The USS address of the inverter and the PLC program must be the
same.
After parameterization, switch off the power and then restart the inverter and
the PLC.
5 Operation
5.1 Jog reverse
Display
When Jog reverses, switch off I0.0 and I0.6, switch on I0.5.
Input Value Description
I0.0 0 Select Jog mode
I0.5 1 Select Jog reverse
I0.6 0 Jog forward
Table 5-1 Jog reverse I/O address
When you set the input signals as indicated in the Table 5-1, the status changes are shown as
follows:
Copyright Siemens AG Error! Unknown document property name. All rights reserved
6 Related literature
The following table lists some useful references.
Topic Title / link
/1/ Reference to the http://support.automation.siemens.com/CN/llisapi.dll?aktprim=4&la
document ng=zh&referer=%2fCN%2f&func=cslib.csinfo&siteid=csius&groupid
=4000002&extranet=standard&viewreg=CN&&nodeid4=34677186
&objaction=csopen
/2/ Siemens Industry http://support.automation.siemens.com
Online Support
/3/ V20 manual http://support.automation.siemens.com/WW/view/en/63899889
/4/ Industry Mall- https://eb.automation.siemens.com/goos/WelcomePage.aspx?regionUrl=/d
Siemens DE e&language=en
/5/ S7-200 System http://support.automation.siemens.com/CN/llisapi.dll?func=cslib.csinfo&no
Manual deid1=56295728&lang=zh&siteid=csius&aktprim=0&extranet=standard&vi
ewreg=CN&objid=37217116&treeLang=zh
Copyright Siemens AG Error! Unknown document property name. All rights reserved
7 History
Version Date Modifications
V1.0 10/2012 First version
Copyright Siemens AG Error! Unknown document property name. All rights reserved