Lenze Function library CAN User Manual

EDSPLCLIB03 13384448
Ä.GMQä
Software Manual
Function library"CANopenSdoDrv"
for Lenze software »Drive PLC Developer Studio«
L
Function library "CANopenSdoDrv"

Contents

Contents
1 About this documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Conventions used
1.2 Definition of notes used
2 System requirements
3 Basics - Service Data Objects (SDOs)
3.1 Addressing through index and subindex
3.2 SDO services
4 Function blocks
4.1 IndexRead - read CAN index
4.2 IndexWrite - write CAN index
4.3 BlockRead - read CAN index per segmented data transfer
4.4 BlockWrite - write CAN index per segmented data transfer
5 Error numbers
6 Index
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Your opinion is important to us
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
. . . . . . . . . . . . . . . . . . . . . . . . . 16
. . . . . . . . . . . . . . . . . . . . . . . . 19
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2 L DMS 1.0 EN - 07/2011 - TD05

1 About this documentation

This documentation describes the function blocks contained in the "CANopenSdoDrv" function library for the »Drive PLC Developer Studio«.
Functional survey
Reading and writing of CAN indices with a data size of up to 255 characters by
segmented SDO transfer (block data transfer).
Reading and writing of CAN indices with a data size of 1, 2 or 4 bytes by a reduced
transfer mode.
Validity information
The information given in this documentation is valid for the following function library:
Function library From version
CANopenSdoDrvVxx.lib V1.0
Function library "CANopenSdoDrv"
About this documentation
Document history
Version Description
1.0 07/2011 TD05 First edition for CANopenSdoDrvV10.lib
Tip!
The "CANopenSdoDrvVxx.lib" library version can be queried via the following global constants:
C_wCANopenSdoDrvVersionER: Enabled major version
C_wCANopenSdoDrvVersionEL: Enable minor version
C_wCANopenSdoDrvVersionIR: Internal minor version
C_wCANopenSdoDrvVersionBN: Internal build number
DMS 1.0 EN - 07/2011 - TD05 L 3
Function library "CANopenSdoDrv"
About this documentation Conventions used

1.1 Conventions used

This documentation uses the following conventions to distinguish between different types of information:
Type of information Writing Examples/notes
Numbers
Decimal separator Point The decimal point is always used.
Text
Program name » « The Lenze PC software »PLC Designer«...
Window Italics The Message window ... / The Options dialog box...
Variable identifier By setting bEnable to TRUE...
Control element Bold The OK button... / The copy command... / The
Sequence of menu commands
Shortcut <Bold> Press <F1> to open the online help.
Program code Courier
Keyword Courier bold
Example: 1234.56
Properties tab... / The Name input field...
If several commands must be used in sequence to carry out a function, then the individual commands are separated by an arrow: Select File
If a key combination is required for a command, a "+" is inserted between the key identifiers: Use <Shift>+<ESC>...
IF var1 < var2 THEN a = a + 1 END IF
Open to...
Hyperlink Underlined
Symbols
Page reference ( 4) Optically highlighted reference to another page. It is
Step-by-step instructions
Optically highlighted reference to another topic. It is activated with a mouse click in this online documentation.
activated with a mouse click in this online documentation.
Step-by-step instructions are indicated by a pictograph.
4 L DMS 1.0 EN - 07/2011 - TD05

1.2 Definition of notes used

The following signal words and symbols are used in this documentation to indicate dangers and important information:
Safety instructions
Layout of the safety instructions:
Danger!
(characterises the type and severity of danger)
Note
(describes the danger and gives information about how to prevent dangerous situations)
Function library "CANopenSdoDrv"
About this documentation
Definition of notes used
Pictograph Signal word Meaning
Danger! Danger of personal injury through dangerous electrical voltage
Danger! Danger of personal injury through a general source of danger
Stop! Danger of property damage
Application notes
Pictograph Signal word Meaning
Note! Important note to ensure trouble-free operation
Reference to an imminent danger that may result in death or serious personal injury if the corresponding measures are not taken.
Reference to an imminent danger that may result in death or serious personal injury if the corresponding measures are not taken.
Reference to a possible danger that may result in property damage if the corresponding measures are not taken.
Tip! Useful tip for simple handling
Reference to another document
DMS 1.0 EN - 07/2011 - TD05 L 5
Function library "CANopenSdoDrv"
System requirements

2 System requirements

Software
The function library can be used with the following Lenze software:
Product Type designation Version
Drive PLC Developer Studio ESP-DDS2-x 2.x
Supported target systems
Product range Type designation Hardware version From software version
Drive PLC EPL-10200 1A or higher 2.x
9300 Servo PLC EVS93xx-EI
EVS93xx-ET
ECS ECSxA 1A or higher 6.x
1A or higher 2.x
Required libraries
Unless already available, insert the following libraries into the library management (menu
WindowLibrary management):
Standard.libCANopenSdoDrvV10.lib
LenzeCanDrvVxxxx.lib
Initialisation of the CAN driver
For using the free PDOs, an initialisation of the CAN driver with the L_CanInit function call is required. This function must only be called once. Thus, best use the system POU "PLC_ColdStart" for calling this function.
The CAN interface of the PLC target system (e.g. 9300 Servo PLC) must be in the "Operational" status.
6 L DMS 1.0 EN - 07/2011 - TD05

3 Basics - Service Data Objects (SDOs)

"Service Data Objects" (abbreviated with SDOs) serve to exchange data of any length and data type between two CAN nodes. The exchange takes place according to the client server model:
As an "SDO client", a CAN node accesses data of a the other CAN node ("SDO server) by writing (download) or reading (upload). This data is located in the object directory of the SDO server and is addressed by the SDO client via the given index and subindex. Each access of the SDO client will be acknowledged by the SDO server.
The connection between the SDO client and the SDO server is also called parameter channel. Each CANopen node must at least support one parameter channel ("default SDO") to be accessible for other nodes. For Lenze devices, it is the parameter channel 1.
As a CAN telegram can only transmit 8 bytes, SDOs are typically transmitted in a sequence of segments. For initialising the data transfer, the SDO client first sends a telegram to the SDO server in which the SDO server is instructed in which way (reading/writing) it is to access which index/subindex of the SDO server. The acknowledgement of the telegram by the SDO server completes the initialisation phase and the segmented transmission of the data starts.
Function library "CANopenSdoDrv"
Basics - Service Data Objects (SDOs)
Addressing through index and subindex
If only up to 4 bytes of data are to be transferred, the reduced transfer ("expedited transfer") can be used as well. In this transfer mode, the data is already transferred during the initialisation phase with the first telegram.
The reduced transfer ("expedited transfer") must be supported by the SDO client and the SDO server according to the CANopen specification. It is switched to the segmented transfer if more than 4 bytes of data must be transferred.
The least-significant byte (LSB) of the CAN telegram is reserved for the command. Among other things, the command contains information on the access type (writing/reading) and the transfer type (segmented/expedited).

3.1 Addressing through index and subindex

The parameters or Lenze codes are addressed according to the following formula:
Index = 24575 – (Lenze code number + 2000 (parameter set – 1))
Example:
The acceleration time (code C1312) in the parameter set 2 is to be addressed. This code has the subindex 0 (no subindex).
Calculation:
Index = 24575 – 12 – 2000 = 22563 = 5823hex
Subindex = 0
Tip!
For converting a code number into the required CAN index, you can use the L_FUNCodeIndexConv function from the »LenzeDrive.lib« library.
DMS 1.0 EN - 07/2011 - TD05 L 7
Function library "CANopenSdoDrv"
Basics - Service Data Objects (SDOs) SDO services

3.2 SDO services

The following services can be used for SDOs:
SDO download
With this service, the SDO client transfers data to the SDO server. The SDO client reports to the SDO server which and how much data is to be transmitted to which address (index, subindex). This service is acknowledged by the SDO server.
The SDO download consists at least of the following services:
Initialisation:
SDO client prepares SDO server for download.
Segmented download:
SDO client transmits the data segments to the SDO server. (Optional, only if the data size is > 4 bytes.)
SDO upload
With this service, the SDO server transfers data to the SDO client. The SDO client reports to the SDO server which address (index, subindex) is to be used to upload the data.
The SDO upload consists at least of the following services:
Initialisation:
SDO client prepares SDO server for upload.
Segmented upload:
SDO server transmits the required data segments to the SDO client. (Optional, only if the data size is > 4 Byte.)
SDO abort
Abort of the SDO transfer. The reason for the abort is given optionally.
8 L DMS 1.0 EN - 07/2011 - TD05
Loading...
+ 18 hidden pages