simotion reading and writing drive data - siemens...reading and writing drive data function manual,...

27
SIMOTION Reading and Writing Drive Data _ _____________ _ _____________ _ _____________ _ _____________ Preface Description 1 Function block 2 Example of an application 3 Appendix A SIMOTION Reading and Writing Drive Data Function Manual 08/2008 Edition

Upload: others

Post on 07-Sep-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

SIMOTION Reading and Writing Drive Data

________________________________________________________

Preface

Description 1

Function block 2

Example of an application 3

Appendix A

SIMOTION

Reading and Writing Drive Data

Function Manual

08/2008 Edition

Page 2: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Safety Guidelines Safety Guidelines 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 with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.

CAUTION without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.

NOTICE indicates that an unintended result or situation can occur if the corresponding information is not taken into account.

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 device/system may only be set up and used in conjunction with this documentation. Commissioning and operation of a device/system may only be performed by qualified personnel. Within the context of the safety notes in this documentation qualified persons are defined as persons who are authorized to commission, ground and label devices, systems and circuits in accordance with established safety practices and standards.

Prescribed Usage Note the following:

WARNING This device may only be used for the applications described in the catalog or the technical description and only in connection with devices or components from other manufacturers which have been approved or recommended by Siemens. Correct, reliable operation of the product requires proper transport, storage, positioning and assembly as well as careful operation and maintenance.

Trademarks All names identified by ® are registered trademarks of the 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.

Siemens AG Industry Sector Postfach 48 48 90327 NÜRNBERG GERMANY

Ⓟ 08/2008

Copyright © Siemens AG 2008. Technical data subject to change

Page 3: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Reading and Writing Drive Data Function Manual, 08/2008 Edition 3

Preface

Contents of Function Manual This document is part of the SIMOTION Programming - References documentation package. The manual describes how you can use a function block to read and write drive parameters using the PIV (Parameter Identification Value) interface.

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.

Information in this manual The following describes the purpose and objectives of the manual: ● General

This chapter presents information on commissioning the drives, assigning parameters to the PROFIBUS DP interface, and integrating the function block into the SIMOTION system.

● Function blocks This chapter describes the function block for reading and writing drive data in connection with the SIMOTION system.

● Index to locate information

SIMOTION Documentation An overview of the SIMOTION documentation can be found in a separate list of references. This documentation is included as electronic documentation with the supplied SIMOTION SCOUT. The SIMOTION documentation consists of 9 documentation packages containing approximately 80 SIMOTION documents and documents on related systems (e.g. SINAMICS).

Page 4: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Preface

Reading and Writing Drive Data 4 Function Manual, 08/2008 Edition

The following documentation packages are available for SIMOTION V4.1 SP2: ● SIMOTION Engineering System ● SIMOTION System and Function Descriptions ● SIMOTION Diagnostics ● SIMOTION Programming ● SIMOTION Programming - References ● SIMOTION C ● SIMOTION P350 ● SIMOTION D4xx ● SIMOTION Supplementary Documentation

Hotline and Internet addresses

Technical support If you have any technical questions, please contact our hotline:

Europe / Africa Phone +49 180 5050 222 (subject to charge) Fax +49 180 5050 223 Internet http://www.siemens.com/automation/support-request

Americas Phone +1 423 262 2522 Fax +1 423 262 2200 E-mail mailto:[email protected]

Asia / Pacific Phone +86 1064 719 990 Fax +86 1064 747 474 E-mail mailto:[email protected]

Note Country-specific telephone numbers for technical support are provided under the following Internet address: http://www.siemens.com/automation/service&support Calls are subject to charge, e.g. 0.14 €/min. on the German landline network. Tariffs of other phone companies may differ.

Page 5: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Preface

Reading and Writing Drive Data Function Manual, 08/2008 Edition 5

Questions about this documentation If you have any questions (suggestions, corrections) regarding this documentation, please fax or e-mail us at:

Fax +49 9131- 98 63315 E-mail mailto:[email protected]

Siemens Internet address The latest information about SIMOTION products, product support, and FAQs can be found on the Internet at: ● General information:

– http://www.siemens.de/simotion (German) – http://www.siemens.com/simotion (international)

● Product support: – http://support.automation.siemens.com/WW/view/en/10805436

Additional support We also offer introductory courses to help you familiarize yourself with SIMOTION. Please contact your regional training center or our main training center at D-90027 Nuremberg, phone +49 (911) 895 3202. Information about training courses on offer can be found at: www.sitrain.com

Page 6: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum
Page 7: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Reading and Writing Drive Data Function Manual, 08/2008 Edition 7

Table of contents Preface ...................................................................................................................................................... 3 1 Description................................................................................................................................................. 9

1.1 General ..........................................................................................................................................9 1.2 Start-up and Parameterization of PROFIBUS DP Interface ........................................................11 1.3 Integrating the function block in the user project .........................................................................12 1.4 Creating I/O Variables..................................................................................................................13

2 Function block ......................................................................................................................................... 15 2.1 Overview ......................................................................................................................................15 2.2 _RWPAR_cyclic function block ....................................................................................................16 2.3 Calling the function block .............................................................................................................19

3 Example of an application........................................................................................................................ 21 3.1 General ........................................................................................................................................21 3.2 Sequence of the application example..........................................................................................23 3.3 Error messages............................................................................................................................24

A Appendix.................................................................................................................................................. 25 A.1 List of parameters ........................................................................................................................25

Index........................................................................................................................................................ 27

Page 8: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum
Page 9: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Reading and Writing Drive Data Function Manual, 08/2008 Edition 9

Description 11.1 1.1 General

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

Page 10: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Description 1.1 General

Reading and Writing Drive Data 10 Function Manual, 08/2008 Edition

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.

Page 11: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Description 1.2 Start-up and Parameterization of PROFIBUS DP Interface

Reading and Writing Drive Data Function Manual, 08/2008 Edition 11

1.2 1.2 Start-up and Parameterization of PROFIBUS DP Interface

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.

Page 12: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Description 1.3 Integrating the function block in the user project

Reading and Writing Drive Data 12 Function Manual, 08/2008 Edition

1.3 1.3 Integrating the function block in the user project

Creating the instance of the FBs in the user project The function block is part of the command library of the “SIMOTION SCOUT” engineering system. To work with the block, an instance must first be created in the user project. Example:

VAR_GLOBAL ... myInstRWParCyclicAxis1: _RWPAR_cyclic ; // create "_RWPAR_cyclic" // instance ... END_VAR

Call (LAD representation)

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.

Page 13: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Description 1.4 Creating I/O Variables

Reading and Writing Drive Data Function Manual, 08/2008 Edition 13

1.4 1.4 Creating I/O Variables

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.

Figure 1-1 Addresses (PIV slot) in SIMOTION SCOUT

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.

Figure 1-2 Address assignment in SIMOTION SCOUT

Input addresses and output addresses have a range of 8 bytes each (corresponding to the PIV range of the drive).

Page 14: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Description 1.4 Creating I/O Variables

Reading and Writing Drive Data 14 Function Manual, 08/2008 Edition

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!

Page 15: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Reading and Writing Drive Data Function Manual, 08/2008 Edition 15

Function block 22.1 2.1 Overview

This section contains a description of the function block (FB) required to read and write drive data between a SIMOTION device and the drive. This function block makes it easier to read and write drive parameters from a SIMOTION program over the PIV interface of a drive. The _RWPAR_cyclic function block must be called repeatedly (cyclically) from the user program.

Page 16: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Function block 2.2 _RWPAR_cyclic function block

Reading and Writing Drive Data 16 Function Manual, 08/2008 Edition

2.2 2.2 _RWPAR_cyclic function block

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.

Call (LAD representation)

_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.

Table 2-1 _RWPAR_cyclic FB parameters

Name P type 1) Data type Meaning Actions performed by user

Actions performed by block

periIn IN ARRAY [0 to 7] of BYTE

Transfers I/O inputs of drive to FB

I/O variable of the I/O inputs of the drive transferred to the FB

Checked

execute IN BOOL FALSE → TRUE edge Start request

Entered Checked

paraNumber IN UINT Parameter to be read or written 2)

Entered Checked

index IN USINT Subindex for parameter to be read or written

Entered Checked

Page 17: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Function block 2.2 _RWPAR_cyclic function block

Reading and Writing Drive Data Function Manual, 08/2008 Edition 17

Name P type 1) Data type Meaning Actions performed by user

Actions performed by block

sendParaValue IN DWORD Value of parameter to be written

Entered Checked

jobIdentification IN SINT Request identifier 2) Entered Checked slotNumber IN UINT PIV slot number 2) Entered Checked periOut OUT ARRAY [0 to 7]

of BYTE Prepared FB data for I/O outputs of drive

Checked and entered on the I/O variable for the I/O outputs

Entered

receiveParaValue OUT DWORD Value of read parameter Checked Entered busy OUT BOOL = TRUE: A request is being

processed = FALSE: No request has been received

Checked Entered

done OUT BOOL = TRUE: If current request is done, only one cycle is active = FALSE: There is no request pending, or a request is being executed.

Checked Entered

error OUT BOOL = TRUE: Request terminated with error (see errorID parameter) - only one cycle is active

Checked Entered

errorID OUT INT Error specification 2) only one cycle is active

Checked Entered

1) Parameter types: IN = input parameter, OUT = output parameter 2) See user manuals for relevant drives (PIV range)

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.

Page 18: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Function block 2.2 _RWPAR_cyclic function block

Reading and Writing Drive Data 18 Function Manual, 08/2008 Edition

Function description This function block processes the PIV interface (4 words wide) in a cyclic message frame. A complete request (paraNumber, index, sendParaValue, jobIdentification) is processed. Consistent data transfer is ensured by the byte ARRAY mechanism for I/O inputs and outputs. A new request is accepted through a positive edge at the execute parameter of the block. A busy parameter at the block indicates that request processing is in progress. A new request cannot be started until processing of the previous request is finished (done = TRUE). Any errors are indicated in the error and errorID parameters.

Signal sequence diagram The following figure shows the behavior of the parameters of the _RWPAR_cyclic function block

Figure 2-1 _RWPAR_cyclic FB signal sequence diagram

Task integration (call) The _RWPAR_cyclic function block must be called cyclically in the BackgroundTask or in the TimerInterruptTask. Calling in the SystemInterruptTask is not permitted. Calling the function block in the IPOSynchronousTask is not recommended for runtime reasons.

Page 19: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Function block 2.3 Calling the function block

Reading and Writing Drive Data Function Manual, 08/2008 Edition 19

2.3 2.3 Calling the function block In order to work with the function block in your user program, proceed as follows (the numbers shown in the following program snippet correspond to the steps below): 1. Create an instance of the function block. 2. Call instance of the function block. 3. Transfer input parameters. 4. The output parameters of the function block are accessed with <instance name of

FB>.<name of output parameter>. 5. The data for the I/O outputs prepared by the FB are assigned to the I/O variables.

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.

Page 20: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Function block 2.3 Calling the function block

Reading and Writing Drive Data 20 Function Manual, 08/2008 Edition

Call example UNIT E_rwPar; INTERFACE 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 PROGRAM ExampleRWParameter // program of BackgroundTask 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

(1)

// call instance from standard FB "_RWPAR_cyclic" to proceed data transfer myInstRWParCyclicAxis1( periIn := myPeripheralInputAxis1,

(2)

slotNumber := mySlotNumberAxis1, execute := myStartParamAxis1, paraNumber := myParaNumAxis1, index := myIndexAxis1, sendParaValue := mySendParaValueAxis1, jobIdentification := myJobIdentificationAxis1 );

(3)

// copy error code myTransferError:= myInstRWParCyclicAxis1.errorID;

(4)

// write peripheral outputs myPeripheralOutputAxis1 := myInstRWParCyclicAxis1.periOut; END_PROGRAM END_IMPLEMENTATION

(5)

Note The ExampleRWParameter program must be assigned in the execution system.

Page 21: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Reading and Writing Drive Data Function Manual, 08/2008 Edition 21

Example of an application 33.1 3.1 General

The call example above shows how to read and write a variety of drive parameters from a SIMOTION program in a system with a SIMODRIVE 611 universal double-axis module. The parameters are written either individually or as a group to the 1st and 2nd axis on the double-axis module. Drive parameters are read: ● once from the 1st axis of the double-axis module ● cyclically from the 2nd axis of the double-axis module

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.

Adapting the application example The configuration in the example and its available hardware must be adapted. The following options are available: 1. The configuration in the example can be adapted to the available hardware (commission

drive, PROFIBUS DP address). 2. The hardware configuration can be adapted to the example (commission drive,

PROFIBUS DP address).

Note For commissioning the drive, please observe the drive documentation! This documentation is included in the SIMOTION SCOUT scope of supply as electronic documentation!

Page 22: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Example of an application 3.1 General

Reading and Writing Drive Data 22 Function Manual, 08/2008 Edition

Calling the application example The application example can be found on the "SIMOTION Utilities & Applications" CD-ROM. The "SIMOTION Utilities & Applications" CD-ROM is provided free of charge and part of the SIMOTION SCOUT scope of delivery. 1. Dearchive and open the project containing the application example. 2. Check the axis configuration: PROFIBUS DP addresses. 3. Save and compile the example project. Then, you can download the example to the

SIMOTION device and switch to RUN mode.

Variables used in application example Symbol Data type Meaning Actions performed

by user Actions performed by example

myWrOneParaToAxis1 BOOL Transfers the P-gain of the speed controller to Axis 1 (edge-triggered)

Set Reset (on error)

Reset

myWrIndexedParaToAxis1 BOOL Transfers the ramp-up time of parameter block 1 of Axis 2 - indexed parameter (edge-triggered)

Set Reset (on error)

Reset

myWrThreeParaToAxis1 BOOL Transfers a set of 3 parameters to Axis 1 (edge-triggered)

Set Reset (on error)

Reset

myWrOneParaToAxis2 BOOL Transfers the P-gain of the speed controller to Axis 2 (edge-triggered)

Set Reset (on error)

Reset

myRdThreeParaAxis1 BOOL Reads 3 parameters from axis 1 once Set Reset (on error)

Reset

myRdIndexedParaAxis1 BOOL Reads the ramp-up time of parameter block 1 of Axis 1 - indexed parameter (edge-triggered)

Set Reset (on error)

Reset

myRdThreeParaCyclicAxis2 BOOL Reads 3 parameters from axis 2 cyclically

Set Reset

Read Reset (on error)

myTransferError INT Contains the error identifier (errorID) of the _RWPAR_cyclic FB

Read Written

myReadCyclicActive BOOL = TRUE: cyclical reading of parameters is active

Read Written

Page 23: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Example of an application 3.2 Sequence of the application example

Reading and Writing Drive Data Function Manual, 08/2008 Edition 23

3.2 3.2 Sequence of the application example This application example illustrates how to read and write the drive parameters for a SIMODRIVE 611 universal double-axis module using the _RWPAR_cyclicfunction block. On the basis of five different parameterized calls of the _RWPAR_cyclic FB, drive parameters will be written to the 2 axes of the double-axis module or will be read discretely or cyclically. Start the transfer operation by setting the global variables (e.g., "myWrOneParaToAxis1" to transfer the P-gain of the speed controller to Axis 1) in the symbol browser and pressing the "Immediate control" button. Once the parameters have been transferred successfully, the variables will be reset by the application example. However, if any transfer errors have occurred, the global variables will not be reset automatically by the application example. In this case, you must reset the global variables (to "FALSE") in the symbol browser yourself. The error ID is saved in the "myTransferError" global variable and displayed in the symbol browser of SIMOTION SCOUT. The drive parameters are stored in the following structures:

Table 3-1 Overview of the data structures for the drive parameters

Data structure Meaning structParameterAxis1 writeParameter readParameter

Drive parameters for axis 1 Substructure for the drive parameters to be written for axis 1 Substructure for the drive parameters of axis 1 to be read

structParameterAxis2 writeParameter readParameter

Drive parameters for axis 2 Substructure for the drive parameters to be written for axis 2 Substructure for the drive parameters of axis 2 to be read

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.

Page 24: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Example of an application 3.3 Error messages

Reading and Writing Drive Data 24 Function Manual, 08/2008 Edition

3.3 3.3 Error messages Any transfer errors that occur are stored in the "myTransferError" global variable and displayed in the symbol browser of SIMOTION SCOUT.

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!

Page 25: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Reading and Writing Drive Data Function Manual, 08/2008 Edition 25

A Appendix AA.1 A.1 List of parameters

A comparison of the SIMOTION identifiers up to V3.2/as of V4.0 is shown in the table below.

Table A-1 List of parameters

Name in the SIMOTION system as of V4.0 (program library in SCOUT)

Name in the SIMOTION system up to V3.2 (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

Page 26: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum
Page 27: SIMOTION Reading and writing drive data - Siemens...Reading and Writing Drive Data Function Manual, 08/2008 Edition 9 Description 11.1 1.1 General Overview Siemens offers a wide spectrum

Reading and Writing Drive Data Function Manual, 08/2008 Edition 27

Index

_ _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