Modbus Interface RISH M01 Info

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

MODBUS interface definition

DME401 / 440
Camille Bauer AG CH-5610 Wohlen, Switzerland
Camille Bauer reserves the right to change the contents of this
document at any time without notice.

Contents
1.

Introduction

2.

Connecting devices to the bus

3.

Realization of interface

3.1

Interface configuration

3.2

Transmission principle

3.3

General form of messages

3.4

Cyclic redundancy check calculation (crc16)

3.5

Special data types

4.

Measurand acquisition

4.1

Measurands

4.2

Measurand tables

4.3.

Optimized data transmission

4.4

Examples for measurands acquisition

4.5

Alternative measurands handling in MODBUS tools

5.

Meter readings

6.

Resetting slave pointers

7.

Configuration of the transducer

8.

Error messages

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 1

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

1. Introduction
The manual in its present form describes in detail all possible functions which may be performed via the RS485
interfacee using protocols defined in the MODBUS specification. The entirety of the provided information allows to
create an independent software solution which uses all possibilities of the transducer.:
- Interrogation of a free selectable number of measurands (till the maximum of available values)
- Interrogation/setting/resetting of programmed internal meters (maximum 4)
- Configuration of all relevant parameters of the transducer including measurands and characteristic of the
analog outputs, rated input values, measurands to evaluate for bus interrogation, meter measurands etc.
- Resetting possibly defined slave pointers
Normally this is undesired because existing hardware and / or software solutions are used. The abundance of
information misguides to read the manual halfway. Obscurities and time-consuming troubleshooting may be the
consequences. Therefore we will give a help to various users which chapters may contain essential information for
him.
Hardware installer
2. Connecting devices to the bus
User of a MODBUStool
4. Measurand acquisition
Engineer who wants to program an independent measurand acquisition
3.
4.
5.
6.

Realization of interface
Measurand acquisition
Meter readings
Resetting slave pointers

Engineer who wants to program an independent transducer configuration tool


3. Realization of interface
7. Configuration of the transducer

MODBUS - Modbus is a registered trademark of Schneider Automation Inc.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 2

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

2. Connecting devices to the bus


The RS485 interfaces of the transducers are connected via an isolated cable. The shield both prevents the coupling
of external noise to the bus and limits emissions from the bus. The shield must be connected to solid ground.
You can connect up to 32 members to the bus (including master). Basically devices of different manufacturers can
be connected to the bus, if they use the standard MODBUS protocol. Devices without galvanically isolated bus
interfaces are not allowed to be connected to the shield.
The optimal topology for the bus is the daisy chain connection from node 1 to node 2 to node n. The bus must form
a single continuous path, and the nodes in the middle of the bus must have short stubs. Longer stubs would have a
negative impact on signal quality (reflexion at the end). A star or even ring topology is not allowed.
There is no bus termination required due to low data rate. If you got problems when using long cables you can
terminate the bus at both ends with the characteristic impedance of the cable (normally about 120 ). Interface
converters RS232RS485 or RS485 interface cards often have a built-in termination network which can be
connected to the bus. The second impedance then can be connected directly between the bus terminals of the
device far most.

Master

+5V

SINEAX DME440

26

Slave 1

GND

25

Tx-/Rx-

24

Tx+/Rx+

23

Built-in RS485 interface card


EURAX DME440

Signal GND 5
1
Data Out A
6
Data Out B
2
Data In A
7
Data In B
3
Handshake Out A
8
Handshake Out A
4
Handshake In A
9
Handshake In B

2z

Slave 2

GND

2d

Tx-/Rx-

6z

Tx+/Rx+

6d

PC mit 13601

With converter RS232/RS485


GND 5
3
TxD
2
RxD

GND
Din
Dout

4
DTR
6
DSR
7
RTS
8
CTS

PC

5
Signal GND
1
Data Out A
6
Data Out B
2
Data In A
7
Data In B
3
Handshake Out A
8
Handshake Out A
Handshake In A 4
Handshake In B 9

SINEAX DME401

26

Slave n

GND

25

Tx-/Rx-

24

Tx+/Rx+

23

86201

The grafic shows the connection of transducers DME401/440 to the MODBUS. The RS485 interface can be
realized by means of PC built-in interface cards or interface converters. Both is shown using i.e. the interfaces
13601 and 86201 of W&T (Wiesemann & Theis GmbH). They are configured for a 2-wire application with
automatic control of data direction.

Important: - Each device connected to the bus must have a unique address
- All devices must be adjusted to the same baudrate
Device address and baudrate can be set via the local RS232 interface only, using the configuration software for
SINEAX / EURAX DME4.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 3

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

3. Realization of interface
3.1 Interface configuration
The bus interface uses the following transmission mode:
- 1 start bit (0), 8 data bits, 1 stop bit (1), no parity
- baudrate 1200..9600 baud (programmable via RS-232), presetting 9600 baud

3.2 Transmission principle


The transmission is fully controlled by the master (PC). No connected device is allowed to send data without prior
request by the master. The master as well monitors possibly occuring timeouts (no response from the addressed
device). Messages are transmitted using the RTU (remote terminal unit) mode.
The MODBUS protocol defines a silent interval of 3,5 characters following the last transmitted character as end of
the message. After this interval a new message can be sent. A typical message frame is shown below:

Pause

Pause

Message 1

Message 2

Pause

Message 3

etc.

The silent interval can be prolongated (configured via RS232 interface).


Remark: A prolongation of the minimal silent interval may be necessary if the master is not able to send
subsequent characters fast enough and therefore causes a transmission break. This effect may occur if a
PC with power management is used (especially notebooks). A high baudrate reinforces this effect.

3.3 General message frame


address (8 bits)

function (8 bits)

data

crc16 (16 bits)

address:

Address of the device which should perform an action (query message from master) or which is
responding (response message from slave). The allowed address range is 1..247.

function:

Tells what kind of action to perform. The following function codes are used in communication with the
DME401/440:
Code MODBUS function
03H

READ HOLDING REGISTERS

Used for ...


- measurand acquisition
- meter reading
- reading scaling factors
- reading measurand table
- reading configuration data

10H

PRESET MULTIPLE REGISTERS

- programming the transducer


- meter setting
- selecting measurands to evaluate
- resetting slave pointers

data:

Contains the information to transmit. This field is divided into register, number of register to transmit and
if necessary read data or information to store. Data is normally transmitted as 16 bit registers but there
are also 32 bit numbers (double registers) and double bytes used (see chapter 3.5).

crc16:

The cyclic redundancy check calculation is performed on the message contents to detect transmission
errors.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 4

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

3.4 Cyclic redundancy check calculation (crc16) (example using C)


The calculation is performed on all message characters, except the check bytes itself. The low-order byte
(Crc_LByte) is appended to the message first, followed by the high-order byte (Crc_HByte). The receiver of the
message calculates the check bytes again and compares them with the received ones.
void main()
{
unsigned char data[NUMDATA+2];
// Message buffer
unsigned char Crc_HByte,LByte;
//
unsigned int Crc;
....
Crc=0xFFFF;
for (i=0; i<NUMDATA; i++) {
Crc = CRC16 (Crc, data[i] );
}
Crc_LByte = (Crc & 0x00FF);
// Calculate low-order byte
Crc_HByte = (Crc & 0xFF00) / 256;
// Calculate high-order byte
}
// CRC16 calculation
// ---------------unsigned int CRC16(unsigned int crc, unsigned int data)
{
const unsigned int Poly16=0xA001;
unsigned int LSB, i;
crc = ((crc^data) | 0xFF00) & (crc | 0x00FF);
for (i=0; i<8; i++) {
LSB=(crc & 0x0001);
crc=crc/2;
if (LSB)
crc=crc^Poly16;
}
return(crc);
}

3.5 Special data types


The standard MODBUS protocol uses 16 bit registers for data transmission. To adapt the transducers data
structure and to improve accuracy the following data types are used as well:
- 32 bit numbers: 32 bit unsigned integers and 32 bit real numbers are transmitted as two consecutive 16 bit
registers. The format of the real number corresponds to the format normally used in PCs.
Type

32 bit real

32 bit unsigned integer


Reg_H

31

Format

30

23

Reg_H

Reg_L
22....

....0

16 15....

exponent

31...

Reg_L
...16

....0

15....

mantissa

sign

Calculation

Value = ( 1) sign * 2 (exponent 126) *

Transmission order:

mantissa + 2 23
2 24

Reg_H
HByte

Reg_L
LByte

HByte

LByte

- Double bytes: In PCs a 16 bit register is stored with the low byte on the lower and the high byte on the higher
address. For the purpose of data transmission they will be swapped. Using double bytes two 8 bit characters are
combined to a 16 bit register. But in opposition to 16 bit registers double bytes are not swapped for data
transmission.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 5

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

4. Measurand acquisition
The measurands are stored as table-oriented raw values. To calculate the real physical values of the measurands a
further table contains appropriate scaling factors for each measurand.

Meaurand = Raw_value Scaling_factor


Scaling factors are constant, as long as the transducers reference quantities are not reprogrammed. If there are
primary transformers defined, their ratings are included in the scaling factors. So the calculated physical values are
always primary values.

Optional: Chap. 4.1

Which measurands are calculated ?

Alternative measurand handling


in MODBUS tools (Chap. 4.5)

Read the measurands scaling factors

Chap. 4.2 / 4.3

Read raw values of measurands

Chap. 4.2 / 4.3


Measurands = Raw_values x scaling

The DME4 supports up to 47 different measurands. If a measurand is calculable depends on the selected
application (system).
Measurand

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:

Single phase
connection

3-wire
unbalanced










U
U1N
U2N
U3N
U12
U23
U31
I
I1
I2
I3
P
P1
P2
P3
Q
Q1
Q2
Q3
PF
PF1
PF2
PF3
QF







-


















Measurand

25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:

QF1
QF2
QF3
F
S
S1
S2
S3
IM
IMS
LF
LF1
LF2
LF3
IB
IB1
IB2
IB3
BS
BS1
BS2
BS3
UM

Single phase
connection

3-wire
unbalanced












-

15 min
15 min
15 min
15 min
15 min
15 min
15 min
15 min

4-wire
unbalanced

































(=Measurand can be calculated)

Table 1

nderung

4-wire
unbalanced

Datum Vis.:

Type:

DME401 / 440

Nr.: 6

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

4.1 Measurands
Which measurands are calculated within the device can be requested or modified via the registers 220..222. If a bit
is set the value will be calculated. The calculable measurands are shown in table 1.
Register 222

Register 221

41. Measurand 33. Measurand

Table 1
Register

220

Content

9. Measurand

25. Measurand 17. Measurand

Register

Measurands 1..8
Measurands 9..16

Register 220

221

Content

Register

Measurands 17..24
Measurands 25..32

222

1. Measurand

Content

Measurands 33..40
Measurands 41..48

4.2 Measurand tables


Register

300
302
304
306
308
310
312
314
316
318
320
322
324
326
328
330

Measurand

Register

U
U1N
U2N
U3N
U12
U23
U31
I
I1
I2
I3
P
P1
P2
P3
Q

332
334
336
338
340
342
344
346
348
350
352
354
356
358
360
362

Measurand

Q1
Q2
Q3
PF
PF1
PF2
PF3
QF
QF1
QF2
QF3
F
S
S1
S2
S3

Register

364
366
368
370
372
374
376
378
380
382
384
386
388
390
392

Measurand

IM
IMS
LF
LF1
LF2
LF3
IB
IB1
IB2
IB3
BS
BS1
BS2
BS3
UM

15 min
15 min
15 min
15 min
15 min
15 min
15 min
15 min

Table 3: Scaling factors (32-Bit real numbers, double registers), read only

Register

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115

Measurand

Register

U
U1N
U2N
U3N
U12
U23
U31
I
I1
I2
I3
P
P1
P2
P3
Q

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

Measurand

Q1
Q2
Q3
PF
PF1
PF2
PF3
QF
QF1
QF2
QF3
F
S
S1
S2
S3

Register

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146

Measurand

IM
IMS
LF
LF1
LF2
LF3
IB
IB1
IB2
IB3
BS
BS1
BS2
BS3
UM

15 min
15 min
15 min
15 min
15 min
15 min
15 min
15 min

Table 4: Raw values (16-Bit integer), read only

Range of values: 10000 corresponds with 100% of the rated value of the measurand
0
corresponds with 0 % of the rated value of the measurand
-10000 corresponds with -100% of the rated value of the measurand
Exception: The frequency is directly stored in [mHz]. The appropriate range of values is 15300...65000.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 7

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

4.3 Optimized data transmission (recommended for independent software solutions only)
These tables contain scaling and raw values for calculated measurands only. Therefore a reduced effort for the
data transmission results. However, the position of each measurand in the data block has to be investigated and
stored in advance. The sequence of raw values and scaling factors is the same as for the previous defined
complete measurand tables (Chap. 4.2), but the non-calculated values are removed. The number of bits set in table
1 (measurands) determines how many registers have to be read.
Table 5 (status: read only)
Register

400..

Content

Scaling factors for all calculated measurands

Table 6 (status: read only)


Register

150..

Content

All calculated measurands

Restriction: The tables have to be read starting at register address 150 or 400 respectively.

4.4 Examples for measurands acquisition


Request for single measurand P (table 1: measurand 12) (Example for device 7):
- Optional request for all measurands really calculated
(Check if the measurand is indeed calculated)

Device

Code

07H

03H

Register
HByte
LByte

00H

DCH

Number of registers
HByte
LByte

00H

03H

Checksum
LByte
HByte

CRC16

Device response:
Device

Code

Number of bytes

Data

Checksum
LByte
HByte

07H

03H

06H

6 data bytes

CRC16

- Request: Complete scaling table (only once)


Device

Code

07H

03H

Register
HByte
LByte

01H

2CH

Number of registers
HByte
LByte

00H

5EH

Checksum
LByte
HByte

CRC16

Device response:
Device

Code

Number of bytes

Data

Checksum
LByte
HByte

07H

03H

BCH

188 bytes

CRC16

- Periodical request: Single measurand P from table 3


Device

Code

07H

03H

Register
HByte
LByte

00H

6FH

Number of registers
HByte
LByte

00H

Checksum
LByte
HByte

01H

CRC16

HByte

LByte

Checksum
LByte
HByte

27H

10H

CRC16

Device response:
Device

07H

Code

Number of bytes

03H

02H

Data

The received measurand in this example is 10000 (2710H). For conversion to physical value it has to be multiplied with the
appropriate scaling factor (register 322 and 323).

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 8

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

Optimized data transmission (Example for device 7)


- Optional: One-time request for scaling factors of all calculated measurands, table 5:
Device

Code

07H

03H

Register
HByte
LByte

01H

90H

Number of registers
HByte
LByte

00H

Checksum
LByte
HByte

10H

CRC16

HByte

LByte

Checksum
LByte
HByte

27H

10H

CRC16

Device response:
Device

07H

Code

Number of bytes

03H

20H

Data

This example shows the interrogation of the scaling factors of 8 measurands. It assumes that the number of really
calculated measurands (chapter 4.1) has 8 bits set in the table.

- Periodical request for all calculated measurands, table 6


Device

Code

07H

03H

Register
HByte
LByte

00H

96H

Number of registers
HByte
LByte

00H

08H

Checksum
LByte
HByte

CRC16

Device response:
Device

Code

Number of bytes

Data

Checksum
LByte
HByte

07H

03H

10H

16 bytes

CRC16

This example shows the acquisition of 8 measurands.

4.5 Alternative measurands handling in MODBUS tools


If tool can handle single register requests only
If the acquisition tool cannot handle requests for multiple register (blocks) you have to use the measurand tables
descripted in chapter 4.2. The tables for optimized data transmission can't be used because the starting address for
the register request is fixed.

If tool can't combine multiple registers to one measurand


Some MODBUS tools don't allow to calculate a measurand out of multiple acquisited register values. But normally
there's the possibility to multiply acquisited data with constants.
The way to handle this best is to do it without a scaling factor request. The factors are entered as constants into the
acquisition tool. However, modifications of the tranducer configuration can't be adopted automatically this way.
On the next page the calculation of the scaling factors for each measurand, depending on the selected application,
is shown. The necessary parameters for the factor calculation may be requested using the DME4 configuration
software (via the local RS232 interface). The shown calculation is valid for the optimized measurand tables as well.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 9

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

Table 7: Scaling factors calculation


Register

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146

Measurand

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:

U
U1N
U2N
U3N
U12
U23
U31
I
I1
I2
I3
P
P1
P2
P3
Q
Q1
Q2
Q3
PF
PF1
PF2
PF3
QF
QF1
QF2
QF3
F
S
S1
S2
S3
IM
IMS
LF
LF1
LF2
LF3
IB
IB1
IB2
IB3
BS
BS1
BS2
BS3
UM

15 min
15 min
15 min
15 min
15 min
15 min
15 min
15 min

Single-phase
system

4-wire
balanced load

3-wire
balanced load

3-wire
unbalanced

4-wire
unbalanced

Un

Un

Un

Un/10000/3

Un/10000/3

Un/10000/3

Un/10000

Un/10000

Un/10000

Un/10000

Un/10000

Un/10000

In

In

In

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

Un*In/10000

Un*In*3/10000

Un*In*3/10000

Un*In*3/1000

Un*In*3/1000

Un*In/3/1000

Un*In/3/1000

Un*In/3/1000

Un*In/10000

Un*In*3/10000

Un*In*3/10000

Un*In*3/1000

Un*In*3/1000

Un*In/3/1000

Un*In/3/1000

Un*In/3/1000

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

Un*In/10000

Un*In*3/10000

Un*In*3/10000

Un*In*3/1000

Un*In*3/1000

Un*In/3/1000

Un*In/3/1000

Un*In/3/1000

In/10000

In/10000

In/10000

In/10000

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

0.0001

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

In/10000

Un/10000/3

In = Ir according to the configuration software (primary value if available, secondary value otherways)
Un = Ur according to the configuration software (primary value if available, secondary value otherways)
nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 10

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

5. Meter readings
Up to four internal counters can be configured at the same time. The meter readings are stored as unsigned 32 bit
integers. For every meter there is also a scaling factor available (32 bit real number), which represent the
conversion from secondary to primary values if transformers are used. The current meter standings are already
scaled in the basic units [Wh, Varh, Vah, mAh].
Table 8
Register

200
202

Content

Register

Internal meter 1
Internal meter 2

204
206

Content

Internal meter 3
Internal meter 4

Table 9 (status: read only)


Register

500
502

Content

Register

Scaling for meter 1


Scaling for meter 2

504
506

Content

Scaling for meter 3


Scaling for meter 4

Meter readings (shown for device 7)


- Single request for the meters scaling factors
Device

Code

07H

03H

Register
HByte
LByte

01H

F4H

Number of registers
HByte
LByte

00H

08H

Checksum
LByte
HByte

CRC16

Device response:
Device

Code

Number of bytes

Data

Checksum
LByte
HByte

07H

03H

10H

16 data bytes

CRC16

- Periodical request for current meter standings


Device

Code

07H

03H

Register
HByte
LByte

00H

C8H

Number of registers
HByte
LByte

00H

08H

Checksum
LByte
HByte

CRC16

Device response:
Device

Code

Number of bytes

Data

Checksum
LByte
HByte

07H

03H

10H

16 data bytes

CRC16

Messages settings (shown for device 7)


You have to store secondary values for the meters (conversion maybe required).
- Request: Setting meter 1 to a specific value
Device

Code

07H

10H

Register
HByte
LByte

00H

C8H

Number of registers
HByte
LByte

00H

02H

Number of bytes

Data

Checksum
LByte
HByte

04H

4 data bytes

CRC16

Device response:
Device

Code

07H

10H

nderung

Register
HByte
LByte

00H

C8H

Number of registers
HByte
LByte

00H

02H

Checksum
LByte
HByte

CRC16

Datum Vis.:

Type:

DME401 / 440

Nr.: 11

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

6. Resetting slave pointers


A maximum of four slave pointers can be defined for the analog outputs A to D (DME440 only) and for the bus
measurands 43..46 (with fixed response time of 15 min.). They can be resetted by setting the appropriate bit(s) in
the following register.
15

14

13

12

11

10

BS3
BS2

B
BS1

C
D

BS
Table 8
Register

Content

slave pointers reset

230

After resetting the slave pointers the transducer will initialize the register to all zeroes.

Resetting a slave pointer (example for device 7):


- Request: Reset slave pointer of analog output B
Device

Code

07H

10H

Register
HByte
LByte

00H

E6H

Number of registers
HByte
LByte

00H

01H

Number of bytes

Daten

Checksum
LByte
HByte

02H

00H, 02H

CRC16

Device response:
Device

Code

07H

10H

nderung

Register
HByte
LByte

00H

E6H

Number of registers
HByte
LByte

00H

01H

Checksum
LByte
HByte

CRC16

Datum Vis.:

Type:

DME401 / 440

Nr.: 12

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

7. Configuration of the transducer


By changing the parameters the transducer can be suit to changing conditions. Its possible to change individual
registers or multiple contiguous registers at once.

Following each step changing parameters the transducer starts up to initialize the new configuration. For
about 3 seconds the transducer cannot handle communication requests.
(Used data types (C): BYTE=unsigned char, WORD=unsigned int, LONG=unsigned long)
Table 9.1

Register Type
700 WORD
701 BYTE
BYTE
702 WORD
703 LONG
705 WORD
706 LONG
708 BYTE
714 int
726 int
738 WORD
750 WORD
772 int
776 int
780 char

Variable name
ProgDate
Application
Freqmeas
Ir
PrimaryIr
Ur
PrimaryUr
Meas[12]
XA[4][3]
YA[4][3]
Ydel[12]
NotUsed1[22]
Y0Limit[4]
Y2Limit[4]
FileInfo[94]

Informal data (not used for device function)

Meaning
Date of last configuration
Connected system
Frequency measurement U/I, rated frequency
Rated current [mA]
Primary rated value of input current transformer [A]
Rated voltage
Primary rated value of input voltage transformer [V]
Measurands (used: 0..6 and 9)
Characteristic of analog measurands: X0;X1;X2
Characteristic of analog outputs:Y0;Y1;Y2Software
Response time of measurands
Not used for DME401/440
Lower range limit of analog outputs
Upper range limit of analog outputs
User defined text for device description

Table 9.2 (status: read only, to be used for verification purpose only)

Register Type
600 BYTE
602 WORD
606 BYTE
BYTE
607 char
611 char
BYTE
612 BYTE

Variable name
OutpType[4]
Y2HW[4]
DeviceType
CalFreq
Password[8]
PasswValidity
CalVers
EPROMVers[2]

*
*
*
*
*
*
*
*

Meaning
HW-Info:

type of analog outputs


hardware range limit of analog outputs
device type (constant)
calibration frequency
User defined password
Validity of password protection
Calibration version
EPROM version, [0]=high_byte, [1]=low_Byte

Informal data (not used for device function) 

Password protection: A possible defined password and its validity represent a protection mechanism against
unpermitted modification of transducer data which is used in the standard software of
DME4 for programming via RS232 interface. If you use this protection mechanism for the
bus interface as well depends on your own requirements.

ATTENTION:

The individual parameters have to match with each other. So i.e. if you want to change the application
(system) you have to check if all the configured measurands for the analog outputs are still measurable.
If you perform a non balanced configuration the transducer may not work correctly.

The individual parameters will be descripted on the following pages.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 13

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

WORD ProgDate
Date of the last configuration of the transducer (informal).
15

14

13

12

11

10

Month (1..12)

Day (1..31)

Year (0..99)

BYTE Application
Contains the application of the transducer. This information allows to derive which measurands in fact can be
calculated respectively which of them are valid for measurand display (see table 1).
phase shift

A12: same as A13, but U-meas. U12 0 1


A15: same as A13, but U-meas. U31 1 0
A16: same as A13, but U-meas. U23 1 1

mult.phase

one-phase

A11: Single phase system


A13: 3-wire, 3-phase system, symmetric load
A14: 4-wire, 3-phase system, symmetric load
A24: 4-wire, 3-phase system, asymmetric load (open Y)
A34: 3-wire, 3-phase system, asymmetric load (Aron)
A44: 4-wire, 3-phase system, asymmetric load

BYTE Freqmeas
Defines the rated frequency and the kind of frequency measurement. Frequency is measured via voltage path
normally. If there is no voltage input or in cases of instability frequency measurement can be performed via current
path. When programming, rated frequency and calibration frequency should be checked against each other. They
should be the same, otherwise permissible variations will increase.
7

Rated frequency 16 2/3 Hz


Rated frequency 50 Hz
Rated frequency 60 Hz
Frequency measurement via voltage
Frequency measurement via current

WORD Ir
Rated value of input current. Ir may be 0 (no current input) or 1000...6000 [mA].

LONG PrimaryIr
Defines the primary rated current of a possible current transformer in [A]. If there is no current transformer, this
value should be zero otherwise maximum 200000 A.

WORD Ur
Rated value of input voltage. You have to store always the phase-to-phase voltage, even if i.e. you measure in a
single phase system where no phase-to-phase voltage exists. Ur contains the voltage [V]*50, so the allowed range
is 5000 ... 34641 (100 ... 692.8V). Without input voltage you can set Ur to zero but you have to switch frequency
measurement to via current (see Freqmeas).

LONG PrimaryUr
Primary rated voltage of a possible voltage transformer in [V]. If there is no voltage transformer, this value should be
zero otherwise maximum 2000000 V.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 14

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

BYTE Meas[12]
Here the measurands for the analog outputs and the internal meters are defined.
Messgr

DME440
DME401

[0]

[1]

[2]

[3]

[4]

[5]

[6]

[7]

[8]

[9]

[10]

[11]

A
FFH

B
FFH

C
FFH

D
FFH

Z1
Z1

Z2
Z2

Z3
Z3

FFH
FFH

FFH
FFH

Z4
Z4

FFH
FFH

FFH
FFH

[0]...[3]: Analog outputs

[4],[5],[6],[9]: Internal meters

The measurand for unused outputs is 00H and FFH if the output doesnt exists. Normally you have to use the last
two numbers of the measurand code in the order sheet, i.e. 12 for P, 25 for QF1 etc. (see also table 2). There are
a few exceptions:
- For meters you have to use the same measurand as for the appropriate analog output, i.e the apparent power of
the system S is 29 not 54.
- Measurands for outgoing active power: 48..51
- Measurands for reactive power capacitive: 52..55
- For applications A24, A34 and A44 the measurand 1 (U12 with X0=0, X2=Ur) must be changed to 5.

int XA[4][3] (DME440 only)


Here you can define the lower and the upper range limits and if necessary the break points of the measurands
which should appear at the analog outputs.
XA[A,B,C,D][X0,X1,X2].
The range of values for X0..X2 is as follows:
10000
0
-10000
15291

corresponds with 100% of the rated value of the appropriate measurand


corresponds with
0 % of the rated value of the appropriate measurand
corresponds with -100% of the rated value of the appropriate measurand
(3BBBH) is the value for X1 if no break point is defined

Examples for XA[ ][ ]: Rated input voltage Ur=100 V (phase-to-phase), rated input current Ir=1A

- Output A, Measurand I1 (9), linear 0..1 [A]


XA[0][0] = 0
XA[0][1] = 15291
XA[0][2] = 10000

(0 % of the input)
(no break point, linear)
(100 % of the input)

- Output B, Measurand U1N (2), linear 40..60 [V], 100 % of the input is 100/3=57.74 V
XA[1][0] = 6928
XA[1][1] = 15291
XA[1][2] = 10391

(69.28 % of the input)


(no break point, linear)
(103.91 % of the input)

- Output C, Measurand P1 (13), -50..50 W, break point at 10 W, 100 % of the input is Ur*Ir/3=57.74 W
XA[2][0] =-8660
XA[2][1] = 1732
XA[2][2] = 8660

(-86.60 % of the input)


(17.32 % of the input, independent of what analog output you got for it)
(86.60 % of the input)

The programming of frequency measurement is an exception:

The values are directly in [mHz].


15,3 Hz -> 15300 [mHz]
65,0 Hz -> 65000 [mHz]
!!! ATTENTION: Here an unsigned int will be stored in an int.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 15

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

int YA[4][3] (DME440 only)


Here you can define the lower and the upper range limits and if necessary the break points of the analog outputs.
The upper range limit Y2 is always 10000 (100% of the output) and therefore dont have to be programmed.
YA[A,B,C,D][Y0,Y1,Y2SW]
- Lower range limit Y0 and break point Y1are proportional in the range -10000..10000
- If there is no break point Y1 is 15291 (3BBBH)
- Using Y2SW you can reduce the output value by software:
YA[A,B,C,D][Y2SW] = 10000
YA[A,B,C,D][Y2SW] =

if Y2 corresponds to the rated value of hardware output

desired range limit


10'000
hardware range limit

if Y2 doesnt correspond to the rated value of hardware output

- For unused or non existing analog outputs all values should be set to zero
Examples for YA[ ][ ]:
- Output A, configured 4..20 mA linear, hardware 20 mA
YA[0][0] = 2000
(20 % of the configured upper range limit)
YA[0][1] = 15291
(no break point defined, linear)
YA[0][2] = 10000
(configured upper range limit = hardware range limit)

- Output B, configured -16..16 mA linear, hardware 20 mA


YA[1][0] =-10000
(-100 % of the configured upper range limit)
YA[1][1] = 15291
(no break point defined, linear)
YA[1][2] = 8000
(configured upper range limit = 8000/10000 * 20mA = 16mA)
- Output C, configured 2..10V linear, hardware 10V, break point at 2V
YA[2][0] = 2000
(20 % of the configured upper range limit)
YA[2][1] = 2000
(break point at 20 % of the configured upper range limit)
YA[2][2] = 10000
(configured upper range limit = hardware range limit)

WORD Ydel[12]
Theres the possibility to define a response time for each measurand. You have to distinguish between measurands
with short response time (1..30 s) and those with long response time (1..30 min). Unused elements should be set to
zero. The assignment of the elements to the outputs is the following:
Tein

[0]

[1]

[2]

DME440
DME401

[0]...[3]: Analog outputs

[3]

D
not used

[4]..[11]

not used

[4]...[11]: not used

The range of values is 1000..30000 [ms] for those measurands with short response time. To choose minimal
response time you can set the value to zero.
For bimetal measuring functions and slave pointers the range is 1..30 min (*1000), zero is not allowed.

int Y0Limit[4]

(DME440 only)
Lower range limit of the analog outputs. The range of values is {YA[i][0]-2500} ... YA[i][0]. So the range limit can be
maximum 25 % below the configured lower range limit of the output (Y0). For non existing analog outputs set the
appropriate element to zero.

int Y2Limit[4]

(DME440 only)
Upper range limit of the analog outputs. The range of values is 10000..12500 representing 100..125 % of the
configured upper range limit. For non existing analog outputs set the appropriate element to zero.
Example: Output A, output range 4..20mA, desired range limits at 2.5 and 22 mA

-> Y0Limit[0] = 1250


-> Y2Limit[0] = 11000

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 16

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

char FileInfo[94]
User defined text for a device description. You can use characters with ASCII code higher than 32 or the value 0 for
unused characters at the end of the text. In the standard software DME4 this text is normally divided into 3 lines.
The position of the linefeed is realized with the characters <CR> and <LF> (ASCII code 13 and 10). These
characters are part of FileInfo and therefore the maximum of usable characters is reduced to 94 characters.

The following parameters are read only:


BYTE OutpType[4]

(DME440 only)
Specifies the kind of analog outputs A..D. Valid arguments are 1 (current output) and 2 (voltage output). All other
values should be interpreted as non existing outputs. These parameters have no influence on the device function
and are used for display functions only.

WORD Y2HW[4]

(DME440 only)
The hardware range limits of the analog outputs are fixed by the PCB assembly. The format is the following:

- Voltage output:

Upper_ range_ limit[V]

10000
10[V]

- Current output:

Upper_ range_ limit[mA]

10000
20[mA]

BYTE DeviceType
40 (DME440) or 1 (DME401).

BYTE CalFreq
Contains the information for what rated frequency the transducer is calibrated. This frequency should be the same
as defined in Freqmeas otherwise permissible variations will increase.

0
Calibration frequency 16 2/3 Hz
Calibration frequency 50 Hz

Calibration frequency 55 Hz
Calibration frequency 60 Hz

char Password[8]
User defined password. Allowed characters are those with ASCII code 32 to 127. To set password protection
inactive all characters should be set to 32 (space). Use the password protection to prevent from unpermitted
modifications of transducer data. See PasswValidity to know for what operations password protection will be active.

BYTE PasswValidity
Defines for what operations the password protection mechanism will be valid:

Storing a new configuration


Setting meters
Resetting slave pointers
Performing a customer output calibration
Simulation of output values

BYTE CalVers
Version of used calibration program (0..255)

BYTE EPROMVers[2]
EPROM version, [0]=high_byte, [1]=low_byte

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 17

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

Messages for the configuration:


- Request: Changing the upper range limit of analog output A to 105 % of the rated value
Device

Code

07H

10H

Register
HByte
LByte

00H

20H

Number of registers
HByte
LByte

00H

Number of bytes

01H

02H

Daten
HByte
LByte

29H

04H

Checksum
LByte
HByte

CRC16

Device response:
Device

Code

07H

10H

Register
HByte
LByte

00H

20H

Number of registers
HByte
LByte

00H

Checksum
LByte
HByte

01H

CRC16

ATTENTION:
Following each step changing parameters the transducer starts up to initialize the new configuration.
During about 3 seconds the transducer cannot handle communication requests.

8. Error messages
If the receiver of a message detects an error he sends back an appropriate error message to the master.
Device response:
Device

Code

Data

Checksum
LByte
HByte

07H

Code+80H

error code

CRC16

The device sends the received function code back. However, to signal the error the most significant bit (MSB) of the
function code byte will be set. The error code always signals a programming or operating error (never a
transmission error). The following error codes will be used:
Error code

Meaning

01H

Use of a unsupported function code

02H

Use of an invalid memory register address: Use of invalid register number or attempt to
write to a memory protected register.

03H

Use of invalid data, i.e. an invalid number of registers

06H

Device is busy. This code signals that the transducer is occupied with functions performed
via the local RS232 interface. These may be: changing configuration, simulation or
calibration of analog outputs.

If a transmission error occurs of that kind that the receivers crc16 calculation does not match the received
one, by no means a response is sent to the master therefore provoking a timeout. The same happens if a
non existing or switched-off device will be addressed.

nderung

Datum Vis.:

Type:

DME401 / 440

Nr.: 18

/ 18

22.03.03 RR

Bezeichnung:

MODBUS Interface definition

Zeichnr.:

gez.:

15.02.99 RR

W 2403 e

You might also like