Fundamental safety
instructions 1
Description 2
SIMOTION
Function block 3
SIMOTION SCOUT
Reading and Writing Drive Data Example of an application 4
Appendix A
Function Manual
04/2014
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be
used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property
damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified
personnel are those who, based on their training and experience, are capable of identifying risks and avoiding
potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended or
approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described.
Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in
this publication is reviewed regularly and any necessary corrections are included in subsequent editions.
Function block
The function block for the "Reading and Writing of Drive Data" for SIMOTION is part of the
command library of the "SIMOTION SCOUT" engineering system.
SIMOTION Documentation
An overview of the SIMOTION documentation can be found in the SIMOTION Documentation
Overview document.
This documentation is included as electronic documentation in the scope of delivery of
SIMOTION SCOUT. It comprises ten documentation packages.
The following documentation packages are available for SIMOTION V4.4:
SIMOTION Engineering System Handling
SIMOTION System and Function Descriptions
SIMOTION Service and Diagnostics
SIMOTION IT
SIMOTION Programming
SIMOTION Programming - References
SIMOTION C
SIMOTION P
SIMOTION D
SIMOTION Supplementary Documentation
Additional information
Click the following link to find information on the the following topics:
Ordering documentation / overview of documentation
Additional links to download documents
Using documentation online (find and search manuals/information)
http://www.siemens.com/motioncontrol/docu
Please send any questions about the technical documentation (e.g. suggestions for
improvement, corrections) to the following e-mail address:
docu.motioncontrol@siemens.com
My Documentation Manager
Click the following link for information on how to compile documentation individually on the
basis of Siemens content and how to adapt it for the purpose of your own machine
documentation:
http://www.siemens.com/mdm
Training
Click the following link for information on SITRAIN - Siemens training courses for automation
products, systems and solutions:
http://www.siemens.com/sitrain
FAQs
Frequently Asked Questions can be found in SIMOTION Utilities & Applications, which are
included in the scope of delivery of SIMOTION SCOUT, and in the Service&Support pages
in Product Support:
http://support.automation.siemens.com
Technical support
Country-specific telephone numbers for technical support are provided on the Internet under
Contact:
http://www.siemens.com/automation/service&support
Preface.........................................................................................................................................................3
1 Fundamental safety instructions...................................................................................................................7
1.1 General safety instructions............................................................................................................7
1.2 Industrial security..........................................................................................................................8
2 Description....................................................................................................................................................9
2.1 General..........................................................................................................................................9
2.2 Start-up and Parameterization of PROFIBUS DP Interface........................................................11
2.3 Integrating the function block in the user project.........................................................................12
2.4 Creating I/O Variables.................................................................................................................13
3 Function block............................................................................................................................................15
3.1 Overview.....................................................................................................................................15
3.2 _RWPAR_cyclic function block....................................................................................................16
3.3 Calling the function block............................................................................................................19
4 Example of an application..........................................................................................................................21
4.1 General........................................................................................................................................21
4.2 Sequence of the application example.........................................................................................23
4.3 Error messages...........................................................................................................................24
A Appendix.....................................................................................................................................................25
A.1 List of parameters........................................................................................................................25
Index...........................................................................................................................................................27
WARNING
Risk of death if the safety instructions and remaining risks are not carefully observed
If the safety instructions and residual risks are not observed in the associated hardware
documentation, accidents involving severe injuries or death can occur.
Observe the safety instructions given in the hardware documentation.
Consider the residual risks for the risk evaluation.
WARNING
Danger to life or malfunctions of the machine as a result of incorrect or changed
parameterization
As a result of incorrect or changed parameterization, machines can malfunction, which in
turn can lead to injuries or death.
Protect the parameterization (parameter assignments) against unauthorized access.
Respond to possible malfunctions by applying suitable measures (e.g. EMERGENCY
STOP or EMERGENCY OFF).
Note
Industrial security
Siemens provides products and solutions with industrial security functions that support the
secure operation of plants, solutions, machines, equipment and/or networks. They are
important components in a holistic industrial security concept. With this in mind, Siemens
products and solutions undergo continuous development. Siemens recommends strongly
that you regularly check for product updates.
For the secure operation of Siemens products and solutions, it is necessary to take suitable
preventive action (e.g. cell protection concept) and integrate each component into a holistic,
state-of-the-art industrial security concept. Third-party products that may be in use should
also be considered. For more information about industrial security, visit http://
www.siemens.com/industrialsecurity.
To stay informed about product updates as they occur, sign up for a product-specific
newsletter. For more information, visit http://support.automation.siemens.com
WARNING
Danger as a result of unsafe operating states resulting from software manipulation
Software manipulation (e.g. by viruses, Trojan horses, malware, worms) can cause unsafe
operating states to develop in your installation which can lead to death, severe injuries and/
or material damage.
Keep the software up to date.
Information and newsletters can be found at:
http://support.automation.siemens.com
Incorporate the automation and drive components into a state-of-the-art, integrated
industrial security concept for the installation or machine.
For more detailed information, go to:
http://www.siemens.com/industrialsecurity
Make sure that you include all installed products into the integrated industrial security
concept.
Overview
Siemens offers a wide spectrum of drives with a graduated range of power ratings.
Of this extensive selection of drives, the SIMOTION Motion Control System supports the
SIMODRIVE 611 universal, SIMOVERT MASTERDRIVES MC and POSMO CA/CD/SI drives,
as well as other drives.
Coupling via PROFIBUS DP enables the drive system and the SIMOTION system to exchange
all of their data over this link.
Requirement
The following software versions are required for the standard functions described in this
documentation:
SIMOTION SCOUT V4.0 or higher
SIMOTION Kernel V4.0 or higher
SIMOTION technology packages V4.0 or higher
Communication
The PROFIBUS DP field bus allows rapid cyclical data exchange between the DP slave (drive)
and the higher-level DP master (SIMOTION hardware platform, such as SIMOTION C2xx).
Note
The _RWPAR_cyclic function block described in this documentation enables you to read or
write the individual parameters of a drive. In so doing, the parameter channel is transferred
in the cyclic message frame. This requires that the relevant drive supports data exchange
via the parameter identifier value (PIV) interface, as defined in the PROFIdrive V2 Drive
Profile (1997).
For drives that support the parameter channel according to the PROFIdrive V3.1 Drive
Profile (parameter requests are transferred with acyclic DP-V1 message frames), the
corresponding system functions are available in SIMOTION:
_readDriveParameterDescription: This function enables the descriptive data of a drive
parameter to be read out.
_readDriveParameter: This function enables a drive parameter to be read.
_writeDriveParameter: This function enables a drive parameter to be written.
_readDriveFaults: This function enables the current fault buffer entry in the drive to be
read.
_readDriveMultiParameterDescription: This function enables multiple parameter
descriptions to be read.
_readDriveMultiParameter: This function enables multiple parameters to be read.
_writeDriveMultiParameter: This function enables multiple parameters to be written.
Further information is contained in the SIMOTION C2xx / P350 / D4xx System Function/
Variables lists manual. These documents are shipped with SIMOTION SCOUT in electronic
form!
The SIMODRIVE 611 universal, SIMOVERT MASTERDRIVES, MICROMASTER MM4, and
POSMO CA/CD/SI drives support both the PIV interface as well as the acyclic parameter
channel. SINAMICS devices support only the acyclic PROFIdrive parameter channel.
Requirement
The following requirements must be met:
1. You have created a project in SIMOTION SCOUT and have inserted a rack with a
SIMOTION hardware platform in the hardware configuration.
2. You have configured a PROFIBUS subnet.
3. You have commissioned the drive(s) and inserted them in your SIMOTION project.
4. You have configured the drive(s) as a PROFIBUS slave and have assigned parameters for
the PROFIBUS DP interface.
5. PIV slot
If the message frame set during configuration of the drive as a PROFIBUS slave (HW Config
> DP slave properties > Configuration tab) does not contain a PIV component, then one
PIV slot must be configured for each axis (slot 4 for single-axis drives; slots 4 and 8 for
double-axis drives).
Refer to the figure: "Addresses (PIV slot) in SIMOTION SCOUT"
Note:
For SIMOVERT MASTERDRIVES MC, a message frame with a PIV component must be
set.
Note
For instructions on creating a project, configuring a PROFIBUS subnet, and inserting a
drive in the project, refer to the online help for SIMOTION SCOUT.
For additional information, e.g. about commissioning, refer to the user manuals of the
installed drives.
VAR_GLOBAL
...
myInstRWParCyclicAxis1: _RWPAR_cyclic ; // create "_RWPAR_cyclic"
// instance
...
END_VAR
B5:3$5BF\FOLF
(1 (12
$55$<>@RI%<7( SHUL,Q SHUL2XW $55$<>@RI%<7(
%22/ H[HFXWH UHFHLYH3DUD9DOXH ':25'
8,17 SDUD1XPEHU EXV\ %22/
86,17 LQGH[ GRQH %22/
':25' VHQG3DUD9DOXH HUURU %22/
6,17 MRE,GHQWLILFDWLRQ HUURU,' ,17
8,17 VORW1XPEHU
/$'VSHFLILFSDUDPHWHUV
Application example
The application example is included on the "SIMOTION Utilities & Applications" CD-ROM and
is available for various SIMOTION hardware platforms.
The "SIMOTION Utilities & Applications" CD-ROM is provided free of charge and part of the
SIMOTION SCOUT scope of delivery.
Overview
To read and write drive parameters by means of the PIV interface, you must define I/O variables
in SIMOTION SCOUT.
Communication between the SIMOTION device and the drive takes place by means of direct
I/O access when data are exchanged over the PIV interface. I/O variables are used to address
the direct read/write access to the I/O.
You can freely assign the names of I/O variables in SIMOTION SCOUT. I/O variables must
be specified as ARRAY [0..7] of BYTE. You assign addresses set in the hardware configuration
(PIV slot) to these I/O variables.
The names of the I/O inputs must be transferred to the function block as a call parameter
(inputInterface). The data prepared for the I/O outputs are made available as output
parameters by the FB and must be assigned to the corresponding I/O variables (see call
example in the "Calling the Function Block" section).
The following example shows how to assign the module addresses to the I/O variables in
SIMOTION SCOUT.
Input addresses and output addresses have a range of 8 bytes each (corresponding to the
PIV range of the drive).
Note
For additional information, refer to:
SIMOTION SCOUT online help
Programming manual of the corresponding programming language, e.g.:
SIMOTION ST, Structured Text programming manual
SIMOTION MCC, Motion Control Chart programming manual
SIMOTION LAD/FBD, Ladder Diagram and Function Block Diagram programming
manual
These documents are shipped with SIMOTION SCOUT in electronic form!
Task
The _RWPAR_cyclic function block enables you to read or write the individual parameters of
a drive.
For this purpose, the relevant drive must support the mechanism of data exchange via the PIV
interface.
B5:3$5BF\FOLF
(1 (12
$55$<>@RI%<7( SHUL,Q SHUL2XW $55$<>@RI%<7(
%22/ H[HFXWH UHFHLYH3DUD9DOXH ':25'
8,17 SDUD1XPEHU EXV\ %22/
86,17 LQGH[ GRQH %22/
':25' VHQG3DUD9DOXH HUURU %22/
6,17 MRE,GHQWLILFDWLRQ HUURU,' ,17
8,17 VORW1XPEHU
/$'VSHFLILFSDUDPHWHUV
_RWPAR_cyclic FB parameters
Note
The SIMOTION identifiers have changed as of V4.0. A comparison of the designations up to
V3.2 / from V4.0 is contained in the "List of parameters" table in Appendix A.
Note
If errorID = 201, an incorrect slot was configured
Remedy: Check and modify slot configuration!
If errorID = 301, transfer of the request was aborted because no correct response data has
been received from the drive after 1000 function block call cycles.
Remedy: Repeat request, check communication link if necessary!
If errorID = 302, parameter change rights do not exist for the relevant drive
Remedy: Set the parameter change rights and repeat the request.
If you want to read and write indexed parameters for SIMODRIVE 611 universal and
SIMODRIVE POSMO CD, CA and SI, you must set bit 11 in the P879 parameter to "1".
For information about drive parameters and their formats and data types, refer to the user
manuals for the installed drives.
Function description
This function block processes the PIV interface (4 words wide) in a cyclic message frame.
H[HFXWH
EXV\
GRQH
HUURU
Note
If you want to read or write parameters from multiple drives, you must create an FB
instance with a new name for each drive.
Call example
UNIT E_rwPar;
INTERFACE (1)
VAR_GLOBAL
myInstRWParCyclicAxis1: _RWPAR_cyclic; // create "_RWPAR_cyclic" instance
myTransferError : WORD :=16#0000; // displays error number of
// data transfer
myWrOneParaToAxis1 : BOOL :=FALSE; // starts the transmission of
// proportional gain
// (non indexed parameter) to Axis1
END_VAR
PROGRAM ExampleRWParameter;
END_INTERFACE
IMPLEMENTATION
VAR
mySlotNumberAxis1 : UINT ;
myStartParamAxis1 : BOOL :=FALSE; // start flag for data transmission
//of axis 1
myParaNumAxis1 : UINT :=0;
myIndexAxis1 : USINT := 0;
mySendParaValueAxis1 : DWORD :=16#0000;
myJobIdentificationAxis1 : SINT := 0;
END_VAR
END_PROGRAM
END_IMPLEMENTATION
Note
The ExampleRWParameter program must be assigned in the execution system.
Hardware platform
The application example is available for various SIMOTION hardware platforms.
Note
If the application example is not available for your hardware platform, you have to adapt the
hardware configuration.
Note
For commissioning the drive, please observe the drive documentation!
This documentation is included in the SIMOTION SCOUT scope of supply as electronic
documentation!
Table 4-1 Overview of the data structures for the drive parameters
Before initiating the transfer, you can modify the values of the drive parameters to be written
in the symbol browser and activate them using the "Immediate control" button.
Note
If myTransferError = 201, an incorrect slot was configured
Remedy: Check and modify slot configuration!
If myTransferError = 301, transfer of the request was aborted because no correct response
data have been received from the drive after 1,000 function block call cycles.
Remedy: Repeat request, check communication link if necessary!
If myTransferError = 302, parameter change rights do not exist for the relevant drive
Remedy: Set the parameter change rights and repeat the request.
If you want to read and write indexed parameters for SIMODRIVE 611 universal and
SIMODRIVE POSMO CD, CA and SI, you must set bit 11 in the P879 parameter to "1".
For information about drive parameters and their formats and data types, as well as a detailed
description of the error ID, refer the the SIMODRIVE 611 universal (PIV range) function
description.
This documentation is included as electronic documentation with the supplied SIMOTION
SCOUT!
Name in the SIMOTION system as of V4.0 Name in the SIMOTION system up to V3.2
(program library in SCOUT) (SIMOTION function library)
Function block parameters
_RWPAR_cyclic _FB_rwPar_cyclic
periIn inputInterface
execute execute
paraNumber parameterNumber
index index
sendParaValue sendParameterValue
jobIdentification jobIdentification
slotNumber slotNumber
periOut outputInterface
receiveParaValue receiveParameterValue
busy busy
done done
error error
errorID errorID
_
_RWPAR_cyclic function block , 16
C
Call example for reading and writing, 20
Calling the function block, 19
Creating I/O variables, 13
E
Example of an application, 21
F
FB _RWPAR_cyclic parameters , 16
Function block
Call, 19
Parameter, 16
Task integration, 18
Function blocks, 15
G
General, 9
I
Integrating the function block, 12
L
List of parameters, 25
R
References, 3
S
Start-up and Parameterization of PROFIBUS DP
Interface, 11