You are on page 1of 14

Multi-function watt-hour meter communication protocol DL/T 645-1997

1. Range
The standardization is used for the tariff device of multi-function watt-hour meter to do point to
point or one master to multi-slaves data exchange with hand-held unit(HHU) or other data terminal
equipments. It defines the technical specification of physical connection, communication link and
application.
4 Physical layer
………………………………………………….
4.1.6 Electrical characteristics of reading head
The reading head should be able to do data exchange with data terminal equipment. Its
communication interface is TTL level, or according to ITU-TV.24 and ITU-TV.28. The
electrical characteristics of reading head are shown in fig.4.
4.1.6.1 Working limit of reading head
Signal level

OFF status ON status


Binary “1” Binary “0”
MARK SPACE
Switch off light source Switch on light source
<-3V(V.28) >+3V(V.28)
<=0.8V(TTL input) >=2V(TTL input)
-0.5V~0.4V(TTL output) 2.4V~Up(TTL output)
Note: TTL negative logic is used here.
4.1.6.2 Transfer speed
Max transfer speed should be no lower than 2400bps.
4.1.7 Power supply for working
The power supply of reading head is provided by hand-held unit or other data terminal
equipment connected with it.
a)

0 1 0 1
(b)
OFF

ON 0 1 0 1
Fig.5 signal and modulation
a) electrical signal with no modulation b)infrared light signal after modulation

Fig.6 angle of light radiation


4.2 Infrared light interface of modulation type
4.2.1 Modulation characteristics
The modulation of the signal is as Fig.5. The carrier frequency is 38kHz±1kHz
4.2.2 Optical characteristics
4.2.2.1 Reference temperature 23℃±2℃
4.2.2.2 Half-angle of light radiation θ
θ ≥15° (as Fig.6)
4.2.2.3 Wave length
The wave length of infrared light is 900nm~1000nm
4.2.2.4 Emitter
The emitter produces infrared light with irradiance Ee/r ≥50mW/m2 on the light axis 1m
away from the surface of emitter
4.2.2.5 Receiver
The irradiance Ee/r of the receiver on the light axis 10mm away from the surface of receiver
should satisfy following conditions:
Irradiance of infrared light Status of receiver
0.35mW/m ≤Ee/r ≤20000mW/m
2 2
ON
Ee/r ≤0.2mW/m 2
OFF
4.2.2.6 Environment condition of the light
According to 4.1.5.4, the valid distance of communication is longer than 4m under the
environment.
4.2.3 Electrical characteristics
It's according to 4.1.6, but transfer speed should be no higher than 1200bps.
4.2.4 Use condition
4.2.4.1 It's should be avoided that strong light (sunlight and fluorescent light) directly irradiate the
receiving window of infrared light receiver.
4.2.4.2 It should be tried to keep the optical axis of the receiver consistent with that of the emitter
when working.
4.2.4.3 Avoid of appearing multiple consecutive“0” in the data.
4.3 Electrical interface of serial port RS-485
RS-485 is used by the standardization which make it's possible for multi-points connection. The
general performance of RS-485 interface should accord with following specification.
4.3.1 Electrostatic discharge (ESD) resistance of driver and receiver side is ±15V (human-body
model)
4.3.2 Common mode input voltage: -7V~+12V.
4.3.3 Differential mode input voltage: upper than 0.2V
4.3.4 Output voltage of driver: When the impedance of load is 54, the max output voltage of
driver is 5V and the min is 1.5V.
4.3.5 Tri-state output
4.3.6 Half-duplex communication mode
4.3.7 The driven capability should be no less than 32 interfaces of the same type
4.3.8 The valid distance of transfer should be no less than 1200m when the transfer speed is no
higher than 100kbps.
4.3.9 The bus is passive power. The tariff device or data terminal equipment provide isolation
power for it.
5 Data-link layer
The protocol uses communication mode of master-slave structure and half-duplex. The
hand-held unit or other data terminal is master station and tariff device is salve station. Each tariff
device has its own address code. The creation and release of communication link is controlled by
the master station sending information frame. Each frame is composed of 7 parts including start
flag, address field of slave station, control code, data length, data field, check code of frame and end
flag, in which each part is composed of several bytes.
5.1 Byte format
Transfer direction
dDvdirection
0 D0 D1 D2 D3 D4 D5 D6 D7 P 1

Start bit Data of 8 bits Even check bit Stop bit


Fig.7 transfer sequence of byte

Instruction Code
Frame start flag 68H
Address field A0
A1
A2
A3
A4
A5
Frame start flag 68h
Control code C
Data length L
Data DATA
Check code CS
End flag 16H
Fig.8 Frame format
Each byte has 8 bits binary code. A start bi t (0), an even check bit and a stop bit are added when
transferring. So the total is 11 bits. The sequence of transfer is as Fig.7. The D0 is the LSB (least
significant bit) and D7 is the MSB (most significant bit). The transfer order is that the bit in
lower address is transferred first and then the bit in higher address.
5.2 Frame format
The frame is the basic unit for transferring information. The frame format is shown in fig.8.
5.2.1 Frame start flag: indicate the start of one frame, its value is 68H=01101000B
5.2.2 Address field A0~A5: The address field comprises 6 bytes and each byte is composed of 2
BCD codes. It can express the address with 12 decimal digits at most. The address can be ID of
meter, or asset number, user number or device number, and so on which can be decided by users.
When the length of address is less than 6 bytes, the rest bytes can be filled with hexadecimal
number AAH. The lower address code is prior while higher one is in the latter. It's a broadcast
address when the address value is 999999999999H.
5.2.3 Control code: the format of control code is as following:

D7 D6 D5 D4 D3 D2 D1 D0

Function code
Flag of subsequent frame
Flag indicates whether slave station is abnormal
Transfer direction
D7=0: command frame from master station
D7=1: response frame from slave station
D6=0: slave station response correctly
D6=1: slave station response abnormally
D5=0: no subsequent data frame
D5=1: has subsequent data frame
D4~D0: function code of request and response
00000: reserved
00001: read data
00010: read subsequent data
00011: re-read data
00100: write data
01000: correcting time by broadcast
01010: write device address
01100: change communication speed
01111: change password
10000: clear maximum demand
5.2.4 Data length L: L describes the bytes number of data field. L<=200 when reading data, L <=50
when writing data, and L=0 indicates no data.
5.2.5 Data field DATA: data field can be data identifier, data or password, etc whose structure
change with different control codes. The sender adds 33H to each byte when transferring while the
receiver subtract 33H from each byte when received.
5.2.6 Check code CS: It's the sum with modular operation on 256 of all bytes from the start flag to
the byte before check code namely it's binary arithmetic sum of each byte deducting overflowing
value over 256.
5.2.7 End flag 16H: indicates the end of the frame, its value is 16H=00010110B
5.3 Transfer
5.3.1 Front-leading bytes
To awaken the receiver, it should send FEH with 1~4 bytes before sending the frame.
5.3.2 Transfer order
All items in data field should be transferred with the order that the byte in lower position
should be transferred firstly and then the bytes in higher position.
For example, if power energy value is 123456.78kWh, the transfer order is as fig.9.

CS

AB 89 67 45 78 56 34 12

5.3.3 Transfer response


Each communication is initiated by master station with request command frame to slave station.
The requested slave station responses according to the33H
request which is described by control
code in the command frame.
33H is received: 20ms<=Td<=500ms
Td----Response delay after command frame
Tb----Pause time between bytes: Tb<=500ms
5.3.4 Error control
78 56 34 12 AB 89 67 45
....................................
5.3.5 Transfer speed
initial speed: 1200bps CS
standard speed: 300,600,1200,2400,4800,9600bps
Fig.9 Transfer order
special speed: defined by manufacturer
5.3.3 Response of transfer
Each communication starts from master station sending request command to slave station
which is selected according to address code in the frame. Then the slave station responses
according to the control code in command frame.
Response delay Td after command frame is received: 20ms≤ Td≤500ms
Pause time between bytes Tb: Tb≤500ms
5.3.4 Error control
Byte check use even check method while frame check uses checksum of longitudinal bytes
in frame. The receiver should discard the frame and not response when even check or checksum
is wrong.
6 Data identifier
6.1 Classification of data
Except measurement value, the counting value, happen time of max demand, instantaneous
voltage, electric current and power value are classified as variable; the calendar, time, user
setting value, characteristic word and status word of tariff device, tariff period are classified as
parametric variable.
6.2 Structure and code of data identifier
Tariff device stores all kinds of data with different types and attributes. The standardization
use four-layers tree structure to represent these data. It uses 4 fields in two bytes to represent
type and attribute of data respectively. These two bytes are DI1 and DI0 which is divided into
four fields DI1H, DI1L, DI0H and DI0L where DI0L is the least significant filed and DI1H is the most
significant field.
DI1H describes type of data and is shown as following:
DI1 DI0
DI1H DI1L DI0H DI0L
D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0

1001 power energy


1010 max demand
1011 variable
1100 parametric variable
1101 load curve
1110 user self defined
1111 reserved

DI1L, DI0H and DI0L describe different attributes of data. For the data of energy and max demand
which have multiple attributes such as attribute of time domain(current value, value of last
month, value of the month before last month), classification attribute(active, reactive), attribute
of power direction(positive, negative), tariff attribute( total amount, amount of different tariff)
and so on, their identifier is shown in 6.2.1 and 6.2.2.
6.2.1 Data identifier of energy
DI1
DI1H DI1L
D7 D6 D5 D4 D3 D2 D1 D0

1001 Energy 00 currently 00 active


01 last month 01 reactive
10 month before last month 10 reserved
11 collection 11 collection
DI0
DI0H DI0L
D7 D6 D5 D4 D3 D2 D1 D0

0001 positive energy 0000 total energy


0010 negative energy 0001 tariff 1
0011 reactive power in 1st quadrant 0010 tariff 2
0100 reactive power in 4th quadrant ….
0101 reactive power in 2nd quadrant 1110 tariff k
0011 reactive power in 3rd quadrant 1111 collection of local data block
0111~1110 reserved
1111 collection

The coding of all data identifier of energy is shown in table A1.


6.2.2 Data identifier of max demand
DI1
DI1H DI1L
D7 D6 D5 D4 D3 D2 D1 D0

1010 max demand 00 currently 00 active


01 last month 01 reactive
10 month before last month 10 reserved
11 collection 11 collection

DI0
DI0H DI0L
D7 D6 D5 D4 D3 D2 D1 D0

0001 positive active max demand 0000 total energy


0010 negative active max demand 0001 tariff 1
0011 reactive power in 1st quadrant 0010 tariff 2
0100 reactive power in 4th quadrant ….
0101 reactive power in 2nd quadrant 1110 tariff k
0011 reactive power in 3rd quadrant 1111 collection of local data block
0111~1110 reserved
1111 collection

The coding of all data identifier of max demand is shown in table A2.
6.2.3 According to the data classification of the standardization, the happen time of max demand is
classified as variable. It is listed in table A3 individually which has same code but different type
symbol (A, B) with corresponding max demand considering the convenience for data terminal
reading data. The identifier codes of other data which are classified as variable and parametric
variable are listed in table A4, A5.
6.2.4 The identifier code of load record data block is listed in table A6.There is no definition about
the format and data length of this data in related standardization, so it can be self-defined by user.
6.3 Data set
6.3.1 Brief introduction
The identifier code of data represents single data item or collection of data items. A single data
item can be denoted uniquely by identifier code of corresponding data item in appendix A. The
identifier code of data block and data set can be used when requesting to access data set which
is composed of multiple data items.
6.3.2 Data item, data block and data set
6.3.2.1 Data item
They are some BCD codes which reflect a certain time-space value or digital value in tariff
device. For example, 9010H in NO. 1 in appendix A represents current positive active
energy whose format is XXXXXX.XX(kWh).
6.3.2.2 Data block
The data block is a group of data composed of continuous data items whose identifier fields
DI1H, DI1L, DI0H is same while DI0L is different (0,1,2,...,k(k is the possible maximum) in data
identifier. The identifier feature of data block is DI0L=1111B.
6.3.2.3 Data set
A data set is composed of 1 or more data blocks. In data identifier, it is a data set
when DI1H, DI1L, DI0H is 1111B or 11B, which is composed of all possible value of the filed
and multiple data blocks in its next field. At this condition, no matter what value of its next
field is, it’s viewed as a data set identifier namely 11B or 1111B.
Then end flag of each data block which constitute the data set is AAH when
transferring. Tow continuous AAH represents a null data block. As Fig.10, the data set has
four data blocks in which data block 1 has m1 data and data block 2 has m2 data, data block
3 has no data, and data block 4 has m4 data,

m1 Data block 1(m1)

AAH

m2 Data block 2(m2)

AAH

m3 AAH Data block 3(0)

m4 Data block 4(m4)

AAH
Fig.10 data set when transferring

6.3.3 Example of identifier of data set


a) identifier code DI1DI0=9010H(data item)
represents current positive active energy
b)identifier code DI1DI0=901FH(data block)
represents current positive total energy and the set of energy with all tariff (total energy,
energy of tariff 1, tariff 2, ....tariff k)
c)identifier code DI1DI0=90F0H(data set)
represents current positive and negative active energy. Is is make up of two items namely
9010H(current positive active energy) and 9020H(current negative active energy).
According to 6.3.2.3, the identifier is viewed as same with 90FFH.
d)identifier code DI1DI0=90FFH(data set)
represents the set of current positive and negative active energy which has 2(k+1) items
totally from 9010H to 902kH in table A1.
7 Application layer
7.1 Read data
7.1.1 Request frame from master station
function: request reading data
control code: C=01H
data length: L=02H
frame format:

68H A0 … A5 68H 01H 02H DI0 DI1 CS 16H

Identifier of data
Data length
Control code

7.1.2 Normally response from slave station


function: slave station response normally
control code: C=81H, no subsequent data frame
C=A1H, has subsequent data frame
data length: L=02H+m(data length)
format of no subsequent data frame:

68H A0 … A5 68H 81H L DI0 DI1 N1 … Nm CS 16H

Data identifier
Data item
Data length
Control code

format of has subsequent data frame:


68H A0 … A5 68H C1H 01H ERR CS 16H

7.1.3 Salve station response abnormally


function: slave station receives wrong request or no corresponding data
control code: C=C1H
data length: L=01H
frame format:
68H A0 … A5 68H C1H 01H ERR CS 16H

Error information word


Note: for error information word, please refer appendix B5.
7.2 Read subsequent data
7.2.1 Request frame from master station
function: request reading subsequent data
control code: C=02H
data length: L=02H
frame format:
68H A0 … A5 68H 02H 02H DI0 DI1 CS 16H

7.2.2 Slave station response normally


function: subsequent data is transferred according to the format of normal data frame
control code: C=82H, no subsequent data frame
C=A2H, has subsequent data frame
data length: L=02H+m(data length)
format of no subsequent data frame :
68H A0 … A5 68H 82H L DI0 DI1 N1 … Nm CS 16H
format of has subsequent data frame:
68H A0 … A5 68H A2H L DI0 DI1 N1 … Nm CS 16H

7.2.3 Salve station response abnormally


function: slave station receives wrong request or no corresponding data
control code: C=C2H
data length: L=01H
frame format:
68H A0 … A5 68H C2H 01H ERR CS 16H

7.3 Re-read data


7.3.1 Request frame from master station
function: request slave station re-transferring the data in last frame
control code: C=03H
data length: L=00H
frame format:
68H A0 … A5 68H 03H 00H CS 16H
7.3.2 Slave station response normally
control code: C=83H, no subsequent frame
C=A3H, has subsequent frame
data length: L=02H+m(data length)
format of no subsequent frame :
68H A0 … A5 68H 83H L DI0 DI1 N1 … Nm CS 16H
format of has subsequent frame:
68H A0 … A5 68H A3H L DI0 DI1 N1 … Nm CS 16H
7.3.3 Salve station response abnormally
control code: C=C3H
data length: L=01H
frame format:
68H A0 … A5 68H C3H 01H ERR CS 16H

7.4 Write data


7.4.1 Request frame for writing data
function: master station requests slave station to set data(or program)
control code: C=04H
data length: L=02H+m(data length)
frame format:
68H A0 … A5 68H 04H L DI0 DI1 N1 … Nm CS 16H

7.4.2 Slave station response normally


function: slave station notify the executing result of the request to master station
control code: C=84H
data length: L=00H
frame format
68H A0 … A5 68H 84H 00H CS 16H
7.4.3 Salve station response abnormally
control code: C=C4H
data length: L=01H
frame format:
68H A0 … A5 68H C4H 01H ERR CS 16H

7.5 Correcting time with broadcast


function: make the time of slave station is synchronous with master slave
control code: C=08H
data length: L=06H
data field: YYMMDDhhmmss (year.month.day.hour.minute.second)
frame format:
68H 99H … 99H 68H 08H 06H ss mm h DD MM YY CS 16H
h

1. It doesn't need response for correcting time with broadcast


2.Only when the time difference between slave station and master station is under ±5min, it
executes correcting time command by setting the time of slave station same with that in the
command.
3. It doesn't recommend correcting time at 0 clock in case that it will affect some regular
operations at 0 clock.
4. It allows correcting time only once every day.
7.6 Write address of device
7.6.1 Request for write address of device
function: set address code for some slave station
control code: C=0AH
address field: 99...99H
data length: L=06H
data field: A0...A5 (address code of device)
frame format
68H 99H … 99H 68H 0AH 06H A0 A5 CS 16H

Note: The request uses broadcast address, which requires the slave station that is set address has
corresponding key (switcher) cooperating with the command. The slave station whose key is
pressed during the period of master station broadcasting request will response, others will not
response.

7.6.2 Slave station response normally


function: the device which execute the request correctly responses
control code: C=8AH
address field: A0...A5 (new address code of the device)
data length: L=00H
frame format
68H A0 … A5 68H 8AH 00H CS 16H
7.7 change communication speed
7.7.1 request for changing communication speed
function: request new communication speed other than 1200bps
control code: C=0CH
data length: L=01H
frame format:

68H A0 … A5 68H 8CH 01H Z CS 16H

Feature word of speed

7.7.2 salve station response with confirmation


function: slave station confirms the request of changing communication speed
control code: C=8CH
data length: L=01H
frame format:
7.7.368H
Slave station
A0 deny
… theA5request
68Hof changing
8CH communication
01H Z CSspeed 16H
control code: C=8CH
data length: L=01H Same with feature word in request
speed
data field: Z=FFH, represent deny
frame format:
68H A0 … A5 68H 8CH 01H FFH CS 16H

7.8 change password


7.8.1 Request for changing password
function: change current password of slave station
control code:C=0FH
data length:L=08H
data field: PAoP0oP1oP2oPANP0NP1NP2N
frame format:
68H A0 … A5 68H 0FH 08H PAo P0o P1o P2o PAN P0N P1N P2N CS 16H

P0oP1oP2o is original password or password with higher authority. PAo represent authority of the
password; P0NP1NP2N represents new password or password that need be set.
PAN is the authority of new password. The data range of PAo,PAN is 0~9 which 0 is the
highest authority. The number is larger while the authority is lower. The level of authority is divided
into highest, programming and clear max demand.
7.8.2 Slave station response normally
function: slave station notify changing password correctly
control code: C=8FH
data length: L=04H
data field: authority of password and password PANP0NP1NP2N
frame format:
68H A0 … A5 68H 8FH 04H PAN P0N P1N P2N CS 16H

7.8.3 slave station doesn't response when it go wrong


7.9 Clear max demand
7.9.1 request for clearing max demand
function: for tariff device which is working on non-automatically meter reading mode, the
command can implement clearing max demand and data rolling of energy in current month, last
month, the month before last month and register of max demand.
Control code:C=10H
data length: L=00H
frame format:
68H A0 … A5 68H 10H 00H CS 16H

You might also like