Vous êtes sur la page 1sur 35

Application Note

Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

1
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

PROFIBUS-DP ENCODER AND GATEWAY


Application and Installation information

General Information 1.1 The PROFIBUS Technology 1.2 Encoder Device Profile 1.3 Abbreviations Encoder Installation 2.1 Cabling 2.2 Address 2.3 Terminating Resistor 2.4 GSD File Encoder Configuration 3.1 Encoder Class 3.2 Operating Parameters 3.2.1 Code Sequence 3.2.2 Class 2 Functionality 3.2.3 Commissioning Diagnostics 3.2.4 Scaling Functions 3.3 Data exchange 3.3.1 Position 3.3.2 Preset Value Function 3.4 Diagnostic Information 3.4.1 Diagnostic Header 3.4.2 Alarms 3.4.3 Operating Status 3.4.4 Encoder type 3.4.5 Singleturn Resolution or Measuring Step 3.4.6 Number of Distinguishable Revolutions 3.4.7 Additional Alarms 3.4.8 Supported Alarms 3.4.9 Warnings 3.4.10 Supported Warnings 3.4.11 Profile Version 3.4.12 Software Version 3.4.13 Operating Time 3.4.14 Offset Value 3.4.15 Offset Value of the Encoder Manufacturer 3.4.16 Scaling Parameters Settings 3.4.17 Encoder Serial Number Configuration Example Appendix Overview of encoder functions History

2 2 2 3 4 4 4 4 5 6 6 9 10 10 11 11 15 15 16 17 18 18 19 20 21 22 22 23 24 25 26 26 27 27 28 28 29 30 33 33 35

4 5 A) B)

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

2
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

General Information This manual describes installation and configuration options of the Leine & Linde devices with PROFIBUS-DP interface. The PROFIBUS-DP gateway is the solution of choice for applications with high ambient temperature. Encoders with integral PROFIBUS-DP interface are advantageous if a very compact solution is required. In view of the certification by PNO (PROFIBUS user organization) all products can be used in all PROFIBUS-DP systems without restrictions. Among other things this means that all possible baud rates, the complete address range and the device characteristics are supported according to the PROFIBUS device profile for encoders. 1.1 The PROFIBUS Technology PROFIBUS is a manufacturer-independent and open field bus standard defined by the international standards EN 50170 and EN 50254. PROFIBUS enables communication with devices from differing manufacturers. PROFIBUS is suited for time-critical applications as well as for complex tasks. Other technical and manufacturer-independent information is available on the Internet at http://www.profibus.com Encoder Device Profile The encoder device profile for PROFIBUS-DP defines the functionality of the encoders connected to PROFIBUS-DP. The operating functions are divided into two device classes: Class 1 encoders offer basic functions that all PROFIBUS-DP encoders must support. An encoder of class 1 can optionally support selected functions of class 2 but these functions must be implemented according to the profile. To support early PROFIBUS-DP implementations the size of the protocol data units (PDU) is limited to 16 bytes. Encoders of class 2 must support all functions of class 1 as well as of class 2. In addition to the two classes, parameters and diagnostic ranges are reserved for manufacturer-specific functions. The position value of the encoder is transferred in binary format. The device profile can be ordered at PNO in Karlsruhe, Germany (order no. 3.062)

1.2

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

3
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

1.3

Abbreviations DP Decentral Periphery DDLM Direct Data Link Mapper, the interface between PROFIBUS-DP functions and the encoder software PDU Protocol Data Unit PI PROFIBUS International PNO PROFIBUS Nutzerorganisation e.V. (PROFIBUS user organization) PROFIBUS Process Field Bus

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

4
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

2 2.1

Encoder Installation Cabling The PROFIBUS-DP devices are supplied with 10 to 30 Vdc by means of the screw terminal strip on the PCB. A shielded power cable should be used. A cable according to the PNO specifications should be used as data cable. Installation of the gateway:
1. Remove the cover of the gateway housing. 2. Strip the cable ends by a suitable length, leaving approx. 15 mm of the cable shield for connection to the cable screw fitting. 3. Slide the power cable through the cable screw fitting. 4. Connect the wires of the power supply through the terminal block +E and 0 V. Tighten the terminal screws. 5. Tighten the cable screw fitting and ensure that the shielding is connected with the fitting.

For the installation of the encoder with integrated PROFIBUS-DP interface, please see the installation instructions supplied with the product, part. No. 640004 or at Leine & Linde web page http://www.leinelinde.se.

2.2

Address The address of the PROFIBUS-DP unit must be set to a value between 0 and 126 by means of the respective address selector switch. The address is set in decimal code (the value for each switch position is marked beside the switch). The encoder reads the address switch only at power-up.
Note!

The PROFIBUS-DP device does not support the setting of the station address by the PROFIBUS master. Setting the address:
1. Switch off the power supply to the PROFIBUS-DP unit if necessary. 2. Use the address selection switches to set the address. 3. Fix cover according to the installation instructions.

2.3

Terminating Resistor If the PROFIBUS-DP device to be installed is used as last participant in the system, the terminating resistor on the PCB must be activated. For the position of the switches see the respective installation instructions.

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

5
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

2.4

GSD File A diskette with the respective GSD files (Gerte Stamm Daten = device identification records) can be ordered from Leine & Linde or downloaded from the Leine & Linde web page http://www.leinelinde.se. Installation:
1. Select the GSD file of the respective device on the diskette and copy the *.gsd file (encoder or gateway) into the respective directory of the PROFIBUS configuration tool. 2. Select the bitmap file (encoder or gateway) of the respective device on the floppy disk and copy the *.bmp file into the respective directory of the PROFIBUS configuration tool. 3. Update the GSD files (SCAN).

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

6
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

Encoder Configuration The PROFIBUS-DP devices can be configured and parameters set according to the user's needs. In this context it is useful to know that with PROFIBUS there are three types of data transmission. Configuration When the system is started, the PROFIBUS devices are configured (DDLM_Set_Prm mode), i.e. the encoder class set by means of the GSD file in the configuration tool (see Chapter 3.1 Encoder class) and the set operating parameters (see Chapter 3.2 Operating parameters) are transferred to the respective slave. This has the advantage that the configuration data need not be modified when a PROFIBUS device is exchanged. Data exchange In the normal mode (DDLM_Data-Exchange mode), data are exchanged between master and slaves. The preset value function can be carried out only in this operating mode. The data exchange is described in Chapter 3.3. Diagnostic messages In the diagnostic mode (DDLM_Slave_Diag) diagnostic data of the slave are transferred on the master's request. The diagnostic messages are described in Chapter 3.4. 3.1 Encoder Class In general, the encoders with PROFIBUS-DP interface are divided into two classes:
CLASS 1

In the CLASS 1 configuration only output values are assigned. Depending on the encoder resolution, this is one output word (16 bits) or two (32 bits). The following functions can be performed:
Changed direction of counting Diagnostic data up to octet 16

Configuration data:
Singleturn Multiturn Class 1 16 Bit: D0hex Class 1 32 Bit: D1hex 1 input data word, data consistency 2 input data words, data consistency

CLASS 2

In the class 2 configuration output values and input words are transferred. Depending on the encoder resolution, this is one output word (16 bits) or two (32 bits). The following functions are available in addition to the class 1 functions:
Scaling function Preset Value Function Extended diagnostic data

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

7
Date

35

DP Encoder and Gateway Application Note Configuration data:


Singleturn

PROFIBUS-DP

JE

04-01-27

Class 2 16 bits: F0hex

Multiturn

1 input data word, 1 output data word for preset value, data consistency Class 2 32 bits: F1hex 2 input data words, 2 output data words for preset value, data consistency

The following table gives an overview of configurations of the individual encoders:


Encoder Positions/ revolution 8 192
1)

Distinguishable revolutions 1 1 4 096

Total resolution 8 192 8 192 33 554 432

CLASS 1

CLASS 2

GSD file

Gateway + Single-turn encoder Single-turn encoder integrated Gateway + Multi-turn encoder Multi-turn encoder integrated

Ll_0680.gsd Lldpa401.gsd Ll_0680.gsd

8 192 8 192
1)

8 192

4 096

33 554 432

Lldpa401.gsd

1)

EnDat encoder connected to PROFIBUS-DP Gateway 01300010, 01300210 or 01300215

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

8
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

The following figure gives an overview of the functions of the encoders:


Encoders according to Class 1 encoder profile: Position Devices of class 1

Basic functions

Code sequence

Display of the position value

Encoders according to Class 2 encoder profile: Position Devices of class 1 ----------

Basic functions Absolute position Scaling function

Code sequence

- Scaling function - Measuring units per revolution - Measuring range in measuring steps - Control function/status

Class 2 encoder Preset function Preset value

Display of the position value

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

9
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.2

Operating Parameters The PROFIBUS-DP encoder is configured by means of the operating parameters. The values selected in the configuration tool are saved in the DP master and are transferred to the PROFIBUS-DP slave each time the network is started. The following table lists all available parameters:

Parameters Code sequence Class 2 functionality Commissioning diagnostics Scaling function control Measuring units per revolution Total measuring range (units)

Data type Bits Bits Bits Bits 32 bits without sign 32 bits without sign

Parameter octet number 9 9 9 9 10 13 14 17

Device class 1 2 Optional 2 2 2

Details 3.2.1 3.2.2 3.2.3 3.2.4 3.2.4 3.2.4

The parameters described in octet 9 is defined bit by bit as follows:


DDLM_Set_Prm
Octet Bits Data 9 70 27 20 Operating parameters

Bits 0

Definition Code Sequence

=0 Clockwise (CW) Increasing position values for clockwise revolutions (seen from flange side) Disable No Disable scaling

=1 Counterclockwise (CCW) Increasing position values for counterclockwise revolutions (seen from flange side) Enable Yes Enable scaling Scaling parameters are taken into octets 10 to 17.

1 2 3

Class 2 functionality Commissioning diagnostics Scaling function control

4 ... 7

Reserved for future applications

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

10
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.2.1

Code Sequence The code sequence defines whether increasing position values for shaft revolutions of the encoder is indicated clockwise or counterclockwise (seen from flange side). The code sequence is set by means of the code sequence bit in the operating parameters. The code sequence is preset to clockwise revolution of the shaft (0). Class 2 Functionality This bit enables/disables class 2 functionality. Class 2 functionality for the PROFIBUS-DP gateway is preset to disabled (0). This means that this control bit must be activated during configuration to support the class 2 functions. For encoders with integral PROFIBUS-DP interface, the default setting is assigned as with the previously selected encoder class.
Note!

3.2.2

If a class 1 encoder uses some optional class 2 functions, the class 2 control bit must be set.

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

11
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.2.3

Commissioning Diagnostics The commissioning diagnostics function makes it possible to check the encoder components responsible for position detection during a standstill of the encoder (e.g. light unit, photo elements and trigger). In conjunction with the position alarms, it enables thorough checking of whether the position values are correct. The commissioning diagnostics function is started by the commissioning bit in the operating parameters. If an error is found, this is indicated in the diagnostic function by the commissioning diagnostics alarm bit (see Chapter 3.4.2 Alarms). The commissioning diagnostics function is an option. To find out whether the encoder supports commissioning diagnostics, the operating status should be read by the diagnostic function and the commissioning diagnostics bit should be checked.

3.2.4

Scaling Functions The scaling function converts the encoder-specific physical position value by means of software in order to change the resolution of the encoder. The parameters "Measuring units per revolution" and "Total measuring range in measuring steps" are the scaling parameters set by the parameter function. Scaling is active only if the control bit for the scaling function is set. When the control bit is set to 0, the scaling function is disabled. The default setting is:
Measuring units per revolution = singleturn resolution. Total measuring range in measuring units = Singleturn resolution x number of distinguishable revolutions.

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

12
Date

35

DP Encoder and Gateway Application Note Format of the scaling parameters:


DDLM_Set_Prm
Octet: Bits Data 10 31 24 231 224 11 23 16 223 216

PROFIBUS-DP

JE

04-01-27

12 15 8 215 28

13 70 27 20

Measuring units per revolution

DDLM_Set_Prm
Octet: Bits Data 14 31 24 231 224 15 23 16 223 216 16 15 8 215 28 17 70 27 20

Total measuring range in measuring units

The data format for both scaling parameters is 32 bits without sign, with a value range from 1 to 232, which is limited by the resolution of the encoder. For a 25bit encoder with a singleturn resolution of 13 bits the permissible value range for "Measuring units per revolution" is between 1 and 213 (8192) and for the "Total measuring range in measuring steps" the permissible value range is between 1 and 225 (33 554 432). The scaling parameters are securely stored in the PROFIBUS-DP master and are reloaded into the main memory of the encoder at each power-up. Both parameters are input in 16-bit format. Here a difference is made between a low and high word. Example of scaling and entry: Total measuring range in measuring units = 4000 steps x 3200 revolutions = 12 800 000 = 00 C3 50 00 hex High word: Low word: 00C3 hex = 195 5000 hex = 20 480

Entry in the configuration software:


Total measuring range (steps) hi = 195 Total measuring range (steps) lo = 20 480 Note!

If the user wants to transmit a parameter telegram without changing the scaling parameters and with the scaling function remaining enabled, the length of the telegram must be limited to 9 and the scaling function control bit must be set. In this case the encoder reacts only to the parameter octets that are received.

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

13
Date

35

DP Encoder and Gateway Application Note


Measuring range

PROFIBUS-DP

JE

04-01-27

The measuring range is defined by the parameter "Total measuring range in measuring units." The encoder has two different operating modes, depending on the specified measuring range. When the encoder receives a parameter message, it checks the scaling parameters for binary scaling. If binary scaling is detected, the encoder selects operating mode A (see following explanation). If not, operating mode B is selected.
A. Cyclic operation (binary scaling)

Measuring mode A is used if the encoder functions with 2x number of revolutions (number of revolutions 2, 4, 8, 16, 32, 64 128, 256, 512, 1024, 2048 and 4096). If the desired measuring range is equal to the specified singleturn resolution 2x (with x 12), the encoder operates in endless cyclic operation (0 to max. position value , 0 to max. position value, etc.). If the position value of the encoder exceeds the maximum value (total measuring range) by a rotation of the axis to be measured, the encoder indicates 0 as position value again. Example of a cyclic scaling: Measuring units per revolution = 1000 Total measuring range = 32,000 (25 = number of revolutions 32)

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

14
Date

35

DP Encoder and Gateway Application Note


B. Noncyclic operation

PROFIBUS-DP

JE

04-01-27

If the measuring range is used to limit the value range of the encoder to a value other than the specified singleturn resolution * 2x, the output position value is limited within the operating range. If the position value resulting from rotation of the encoder exceeds the maximum value or falls below 0, the encoder indicates the value of the measuring range. See figure below. Example of noncyclic scaling:
Measuring units per revolution = 100

Total measuring range = 5000 (number of revolutions 50)

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

15
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.3

Data exchange

3.3.1 Position The input data of the encoder are required only for the position value with a defined length of 32 bits. As an option, the encoder supports a position value length of 16 bits. The value is right-justified in the data field.
DDLM_Data_Exchange mode Standard configuration:
Octet: Bits Data 1 31 24 231 224 2 23 16 223 216 3 15 8 215 28 4 70 27 20

Data_Exchange 32 bits

Configuration data: Device class 1 D1hex 2 input data words, data consistency Device class 2: F1hex 2 input data words, 2 output data words for preset value, data consistency Optional configuration:
Octet: Bits Data 1 15 8 215 28 Data_Exchange 16 bits 2 70 27 20

Configuration data:
Device class 1 Device class 2: D0hex 1 input data word, data consistency F0hex 1 input data words, 1 output data word for preset value, data consistency

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

16
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.3.2

Preset Value Function The preset value function enables the adaptation of the zero point of the encoder to the mechanical zero point of the system. The preset value function sets the actual value of the encoder as preset value. The preset value is saved in the encoder as output value when the Data_Exchange function is activated. The preset value function is used after the scaling function. This means that the preset value is entered in the current measuring unit. The most significant bit (MSB) of the preset value controls the preset value function as follows: Normal operating mode: MSB = 0 (bit 31, optional bit 15) The encoder will not change the preset value. Default mode: MSB = 1 (bit 31, optionally bit 15) With MSB = 1, the encoder accepts the transferred value (bits 0 30) as preset value in the binary code. The encoder reads the current position value and calculates an offset value using the preset value and the read position value. The position value is shifted by the calculated offset value. If the output position value equals the preset value, the preset mode is terminated and the MSB can be set to 0 by the master. The resulting offset value can be read by means of the diagnostic function. In case of a power interruption, it is permanently stored in the encoder and is reloaded at each start-up. After the preset is accepted and a new offset value has been calculated the encoder sends a diagnostic message to acknowledge the preset and to exchange the new offset value. This diagnostic event must be handled by the profibus master and should not be interpreted as an alarm.
Note!

The preset value function should be used only during a standstill of the encoder.
Preset value format (2 words, 32 bits):
Octet: Bits Data 31 0/1 Preset control bit 1 30 - 24 230 224 2 23 16 223 216 3 15 8 215 28 4 70 27 20

Preset value - max. 31 bits

Preset value format (1 word, 16 bits):


Octet: Bits Data 15 0/1 Preset control bit 1 14 8 214 28 2 70 27 20

Preset value - max. 15 bits

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

17
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4

Diagnostic Information The diagnostic information contains diagnostic data which are on the one hand defined in the PROFIBUS-DP specification (octets 1 to 6) but are encoderspecific diagnostic data:
Data type Diagnost. octet number 1 2 3 4 56 7 8 9 10 11 14 15, 16 17 18, 19 20, 21 22, 23 24, 25 26, 27 28 31 32 35 36 39 40 43 44 47 48 57 58 - 61 32 without sign 32 without sign 62 65 66 - 69 Device class 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 Special Special Details

Diagnostic function

Station status 1 Station status 2 Station status 3 Diagnostic master address PNO identification number Extended diagnostic header Alarms Operating Status Encoder type Singleturn resolution (encoder) Measuring unit (linear encoder) Number of distinguishable revolutions Additional alarms Supported alarms Warnings Supported warnings Profile version Software version Operating time Offset value Manufacturer offset value Measuring units per revolution Total measuring range in measuring units Serial number Reserved for future definitions Limit switch minimum Limit switch maximum

Bits Bits Bits Bits Bits Octet string Octet string Octet string Octet string 32 without sign 16 without sign Octet string Octet string Octet string Octet string Octet string Octet string 32 without sign 32 with sign 32 with sign 32 without sign 32 without sign ASCII string

3.4.1 3.4.2 0 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.4.10 3.4.11 3.4.12 3.4.13 3.4.14 3.4.15 3.4.16 3.4.16 3.4.17

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

18
Date

35

DP Encoder and Gateway Application Note


Note!

PROFIBUS-DP

JE

04-01-27

The length of the diagnostic information of class 1 is limited to 16 bytes. It is compatible with former DP versions. For PROFIBUS-DP encoders of class 2, the length of the encoder-specific diagnostic data including the extended diagnostic header is 57 bytes (39 hex). The DDLM_Slave_Diag memory range up to octet 99 is reserved for future diagnostic data of class 2. 3.4.1 Diagnostic Header The header byte specifies the length of the encoder diagnostics including the header byte. The format of the transmission length is hexadecimal. For the PROFIBUS-DP encoder of class 1 the length of the encoder-specific diagnostic data is 10 bytes (0A hex).
DDLM_Slave_Diag
Octet Bits Data 7 0 Set to 00. 7 6 0 50 xxh Length including header Extended diagnosis

3.4.2

Alarms An alarm is given if a malfunction in the encoder can lead to incorrect position values. Octet 8 in the diagnostic function (DDLM_Slave_Diag) indicates the status of the alarms. Additional alarms for device class 2 are added in the diagnostic octet 17. If an alarm is given, the Ext_Diag bit and the Stat_Diag bit in the diagnostic function are set to high until the alarm is reset and the encoder can provide a correct position value. Alarms can be reset (deleted) when all encoder parameters are within the specified value ranges and the position value is correct.
Note

Not every encoder supports every alarm. For encoders of class 2 the diagnostic information "supported alarms" (see Chapter 3.4.8) makes it possible to find out which individual alarm bits are supported.

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

19
Date

35

DP Encoder and Gateway Application Note


DDLM_Slave_Diag
Octet Bits 8 70 ALARMS

PROFIBUS-DP

JE

04-01-27

Bits 0 1 2 3 4 5 6 7

Definition Position error Voltage supply error Current is too high Commissioning diagnostics Memory error

=0 No No No OK No Currently not assigned

=1 Yes Yes Yes Error Yes

3.4.3

Operating Status Octet 9 in the diagnostic function provides information about encoder-specific parameters. A class 2 encoder sets the functionality bit for class 2 commands in order to show the DP master that all class 2 commands are supported. The DP master must activate the class 2 functionality bit in the parameter message (DDLM_Set_Prm) to enable the use of class 2 functions.
The status bit of the scaling function is set when the scaling function is activated and the resolution of the encoder is calculated by means of the scaling parameters. DDLM_Slave_Diag

Octet Bits

9 70 Operating Status

Bits 0

Definition Code sequence

=0 Increasing position values for clockwise revolutions (seen from flange side) No, not supported No, not supported Scaling disabled Currently not assigned

=1 Increasing position values for counterclockwise revolutions (seen from flange side) Yes Yes Scaling enabled

1 2 3 4 5 6 7

Class 2 functionality Commissioning diagnostics Scaling function status

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

20
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.4

Encoder type The type of encoder can be read in octet 10 of the diagnostic function. The type of encoder is defined in hex code in the range from 0 to FF.
DDLM_Slave_Diag

Octet Bits

10 0 - FF Encoder type

Code Definition 00 01 02 03 04 05 06 07 08 09 FF Currently not assigned Absolute singleturn encoder Absolute multiturn encoder Absolute singleturn encoder with electronic revolution counter Incremental rotary encoder Incremental rotary encoder with battery buffer Incremental linear encoder Incremental linear encoder with battery buffer Absolute linear encoder Absolute linear encoder with periodic coding

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

21
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.5

Singleturn Resolution or Measuring Step The singleturn resolution in the diagnostic function has different meanings depending on the type of encoder.
Rotary or Angle Encoder

For rotary or angle encoders, the diagnostic octets 11 to 14 indicate the physical resolution in number of measuring steps per revolution which is transferred for the absolute singleturn position value. The maximum singleturn resolution is 232.
DDLM_Slave_Diag
Octet Bits Data 11 31 24 231 224 12 23 16 223 216 13 15 8 215 28 14 70 27 20

Singleturn resolution

Linear Encoder

For linear encoders, the diagnostic octets 11 to 14 output the measuring step in nm (0.001 m). Example: A 1 m resolution of the linear encoder m results in a value of 00 00 03 E8 hex.
DDLM_Slave_Diag
Octet Bits Data 11 31 24 231 224 12 23 16 223 216 13 15 8 215 28 14 70 27 20

Measuring unit

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

22
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.6

Number of Distinguishable Revolutions The number of distinguishable revolutions that the encoder can transfer is defined by octets 15 and 16 of the diagnostic function. In accordance with the formula below, the measuring range for an encoder results from the number of distinguishable revolutions multiplied by the singleturn resolution. The maximum number of distinguishable revolutions is 65 536 (16 bits). Measuring range = number of distinguishable revolutions x singleturn resolution
DDLM_Slave_Diag

Octet Bits

15 15 8

16 70

Number of distinguishable revolutions

3.4.7

Additional Alarms The diagnostic octet 17 indicates additional alarms for device class 2.
DDLM_Slave_Diag

Octet Bits

17 70 Additional alarms

Bits 0 7

Definition

=0 Currently not assigned

=1

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

23
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.8

Supported Alarms The diagnostic octets 18 and 19 contain information on the supported alarms.
DDLM_Slave_Diag

Octet Bits

18 15 8 Supported alarms

19 70

Bits 0 1 2 3 4 5 15

Definition Position error Voltage supply error Current is too high Commissioning diagnostics Memory error

=0 Not supported Not supported Not supported Not supported Not supported Currently not assigned

=1 Supported Supported Supported Supported Supported

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

24
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.9

Warnings Warnings indicate that tolerances for certain internal parameters of the encoders have been exceeded. Contrary to alarms, no faulty position values are expected in case of warnings. Octets 20 and 21 of the diagnostic function indicate the status of the warnings. If a warning is set, the Ext_Diag bit in the diagnostic function is logically set to 1 until the warning is reset. All warnings are deleted when the diagnostic message of the encoder has been read. However, if the tolerances are still exceeded, the warning is activated again. The warning "Maximum operating time exceeded" (bit 4) is not activated before the system is switched on again. Not every encoder supports every warning. Please refer to the diagnostic information under Supported Warnings (see: Chapter 3.4.10), for information on the support of specific warnings.
DDLM_Slave_Diag

Octet Bits

20 15 8 WARNINGS

21 70

Bits 0 1 2 3 4 5 6 7 15

Definition Frequency exceeded Temperature exceeded Light control reserve CPU monitoring status Maximum operating time exceeded Battery charging Reference point

=0 No No Not reached OK No OK Reached Currently not assigned

=1 Yes Yes Reached Reset Yes Too low Not reached

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

25
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.10 Supported Warnings The diagnostic octets 22 and 23 contain information on supported warnings.
DDLM_Slave_Diag
Octet Bits 22 15 8 Supported Warnings 23 70

Bits 0 1 2 3 4 5 6 7 15

Definition Frequency warning Temperature warning Light control reserve warning CPU monitoring status warning Maximum operating time exceeded warning Battery charging warning Reference point warning

=0 Not supported Not supported Not supported Not supported Not supported Not supported Not supported Currently not assigned

=1 Supported Supported Supported Supported Supported Supported Supported

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

26
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.11 Profile Version Octets 24 and 25 of the diagnostic function provide the PROFIBUS-DP encoder profile version that is implemented in the encoder. The octets revision number and index are combined. Example: Profile version: Octet no. Binary code. Hex:

1.40 24 00000001 1

25 00000001 40

DDLM_Slave_Diag
Octet Bits Data 24 15 8 27 20 Revision number Profile Version 25 70 27 20 Index

3.4.12 Software Version Octets 26 and 27 of the DDLM_Slave_Diag function provide the software version of encoder. The octets revision number and index are combined. Example: Software version: 1.40 Octet no.: 26 Binary code: 00000001 Hex: 1
DDLM_Slave_Diag
Octet Bits Data 26 15 8 27 20 Revision number Software version 27 70 27 20 Index

27 01000000 40

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

27
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.13 Operating Time The operating time monitor stores the operating time for the encoder in operating hours. The operating time is saved every six minutes in the encoders nonvolatile memory. This happens as long as the encoder is under power. The operating time is displayed as a 32-bit value without sign in 0.1 h by the DDLM_Slave_Diag function. If the operating time function is not supported by the encoder, it is set to the maximum value (FFFF FFFF hex). The manufacturer of the encoder can define a maximum operating time. If this limit is exceeded, the "maximum operating time exceeded" bit is activated (see: Chapter 3.4.9 Warnings).
DDLM_Slave_Diag
Octet Bits Data 28 31 24 231 224 29 23 16 223 216 30 15 8 215 28 31 70 27 20

Operating time

3.4.14 Offset Value The offset value is calculated by the preset value function and shifts the position value by the calculated value. The offset value is stored in the encoder and can be provided by the diagnostic octets 32 to 35. The data type for the offset value is a 32-bit binary value with algebraic sign, whereby the offset value range is equal to the measuring range of the encoder. The preset value function is used after the scaling function. This means that the offset value is indicated according to the scaled resolution of the encoder.
DDLM_Slave_Diag
Octet Bits Data 32 31 24 231 224 33 23 16 223 216 34 15 8 215 28 35 70 27 20

Offset Value

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

28
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.15 Offset Value of the Encoder Manufacturer The manufacturer offset value indicates the encoder offset set by the manufacturer. This value gives information on the shift of the position zero point in number of positions from the physical zero point of the encoder. The data type for the offset value is a 32-bit binary value with sign. The value range corresponds to the measuring range of the encoder. The offset value of the manufacturer of the encoder is indicated in the number of units according to the basic resolution of the encoder. The value is stored in write-protected memory, which can be changed only by the encoder manufacturer. This value has practically no importance for the user.
DDLM_Slave_Diag
Octet Bits Data 36 31 24 231 224 37 23 16 223 216 38 15 8 215 28 39 70 27 20

Offset Value of the Encoder Manufacturer

3.4.16 Scaling Parameters Settings The scaling parameters are set in the DDLM_Set_Prm function. The parameters are stored in the octets 40 to 47 of the diagnostic data. The "Measuring units per revolution" and "Total measuring range in measuring units" parameters define the selected resolution of the encoders. The status bit of the scaling function in the operating status (octet 9 of the diagnostic data) indicates whether the scaling function is enabled.
Values preset by the manufacturer of the encoder: Measuring units per revolution = singleturn resolution. Total measuring range in measuring units = singleturn resolution x number of distinguishable revolutions.

The data type for both values is 32 bits without sign.


DDLM_Slave_Diag
Octet Bits Data 40 31 24 231 224 41 23 16 223 216 42 15 8 215 28 43 70 27 20

Measuring units per revolution

DDLM_Slave_Diag
Octet Bits Data 44 31 24 231 224 45 23 16 223 216 46 15 8 215 28 47 70 27 20

Total measuring range in measuring units

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

29
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

3.4.17 Encoder Serial Number Octets 48 to 57 of the diagnostic function provide the serial number of the encoder as a 10-character ASCII string. If the serial number is not supported, the ASCII string consists only of asterisks (**********). This corresponds to hex code 2A.
DDLM_Slave_Diag
Octets Bits Data 48 57 79 0 ASCII Serial number

Example of a serial number


Octet ASCII string Serial (hex.) Serial (dec.) 48 30 0 49 30 0 50 30 0 51 35 5 52 39 9 53 46 F 54 38 8 55 44 D 56 45 E 57 35 5

9434 2629

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

30
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

Configuration Example This example using a Siemens S5 (115 with CPU 942A) with IM 308-C master interface module and the COM PROFIBUS configuration software is intended to illustrate the commissioning of a PROFUBUS-DP Gateway with a 25 bit absolute rotary encoder. The encoder is to be scaled to 3600 measuring units per revolution and a maximum measuring range. Please refer to the respective manufacturer for information on the configuration of other PROFIBUS-DP master interface modules.
Copying the GSD file

First, copy the GSD file Ll_0680.gsd into the directory ...\GSD. Then, all the type files are copied into the configuration software COM PROFIBUS by selecting the File command in the menu bar and the menu item Scan GSD files.
Note!

There is no confirmation after the copying process.


Configuration of the master system

The next step is the configuration of the master system. Using the File menu item, either open an existing file or create a new configuration. In this example a new configuration is created with the master system IM 308-C on the host station type S5-115U/CPU 942A with the station address 1.

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

31
Date

35

DP Encoder and Gateway Application Note


Selecting the DP Slave

PROFIBUS-DP

JE

04-01-27

After confirming with the OK button, select as the next step the PROFIBUS-DP slave. In this example, it is an Encoder. After using the mouse to select the DP slave, append it to the master component IM 308-C and enter the address of the DP slave in the input mask. This must be identical with the address defined for the DP slave. After you select the slave address, the selection menu appears for the station type.

Select the L&L Encoder Gateway. After you select the station type, the selection menu appears for the configuration of the station. Select in our case Encoder Class 2 to be able to use the scaling function and 32 bit to be able to get 25 bit position information.

Assigning parameters for the DP slave

After confirming your input with OK, click the Param. button. An input mask opens for entering the parameters of the DP slave.

In the parameter mask, enter one by one the characteristics for the DP slave. In this example, that means:

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

32
Date

35

DP Encoder and Gateway Application Note Parameter Direction of rotation

PROFIBUS-DP

JE

04-01-27

Value Details in Chapter Increasing 3.2.1 clockwise Class 2 functionality Enabled 3.2.2 Commissioning diagnostics Disabled 3.2.3 Scaling function Enabled 3.2.4 Measuring units per revolution (hi) 0 Measuring units per revolution (lo) 3600 Total measuring range (hi) 225 Total measuring range (lo) 0 The total measuring range is calculated according to the pattern described in the chapter entitled Scaling Function. For this example, the maximum total measuring range is calculated as follows: Scaled total measuring range = scaled measuring steps per revolution x max. number of distinguishable revolutions = 3600 x 4096 = 14 745 600 = 00 E1 00 00 hex Total measuring range (hi) = 00 E1 hex Total measuring range (lo) = 00 00 hex

= 225 decimal = 0 decimal

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

33
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

Appendix A) Overview of encoder functions The encoder specification comprises functions for comprehensive diagnoses and for parameterizing the position value. Tables A.1 and A.2 provide an overview of encoder data for class 1 and class 2 encoders. These data are implemented as user-specific data of the communications functions.

Table A.1:
Function Data_Exchange Data_Exchange

Encoder-specific data class 1 (CLASS 1), mandatory for all DP encoders


Octet no. 14 14 Data type 32-bit unsigned *) 32-bit unsigned *) Name Position value (input) Preset value (output)

RD_Inp

14

32-bit unsigned *)

Position value

Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Set_Prm

7 8 9 10 11 14 15, 16 9

Octet string Octet string Octet string Octet string 32-bit unsigned 16-bit unsigned Octet string

External extended diagnostic header Alarms Operating status Encoder type Singleturn resolution or measuring step Number of distinguishable revolutions Operating parameters

*) Optionally 16-bit unsigned

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

34
Date

35

DP Encoder and Gateway Application Note Table A.2:

PROFIBUS-DP

JE

04-01-27

Encoder-specific data class 2 (CLASS 2), optional functionality As supplement to Table A.1
Octet no. 17 18, 19 20, 21 22, 23 24, 25 26, 27 28 31 32 35 36 39 40 43 44 47 48 57 10 13 14 17 Data type Octet string Octet string Octet string Octet string Octet string Octet string 32-bit unsigned 32-bit signed 32-bit signed 32-bit unsigned 32-bit unsigned ASCII string 32-bit unsigned 32-bit unsigned Name Additional alarms Supported alarms Warnings Supported warnings Profile version Software version Operating time Offset value Manufacturers offset value Measuring units per revolution Total measuring range in measuring units Serial number Measuring units per revolution Total measuring range in measuring units

Function Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Slave_Diag Set_Prm Set_Prm

Application Note
Topic
Project

Document

Revision

Page

Total

DP_appl.DOC

2.1
Sign.

35
Date

35

DP Encoder and Gateway Application Note

PROFIBUS-DP

JE

04-01-27

B) History Revision Date Rev. 1.0 Rev. 1.1 Rev. 1.1 Rev. 1.2 97-06-26 97-09-03 97-12-03 98-02-09

Changes First release Page 5, Serial number description included. Changed to Word 97 format. 1. Preset overview To be able to use the preset function the encoder must be configured as a class2 encoder. 2. GSD-file Further information on the Installation procedure. 3. Parameter settings NOTE on the parameterisation procedure and 32 bit parameters in COM-PROFIBUS. 4. Scaling function Encoder type reference. 5. Encoder type New section 6. References Encoder Profile order number included. 1. Linear Encoders - Software version 1.06 is required for EnDat linear encoders. - Linear encoders is supported with the preset function. 1. Parameter settings Parameterisation examples from COM PROFIBUS included. 2. Configuration data settings COM PROFIBUS Release version 2.0 Revised JH 1.01 2000-08-22 Page 16, Explanation of the diagnostic event following a preset command.

Rev. 1.3

98-05-25

Rev. 1.4

98-10-16

Rev. 2.0

02-08-23

Rev. 2.1

04-01-27

Vous aimerez peut-être aussi