meterreadingprotocol standard public
TRANSCRIPT
-
7/31/2019 MeterReadingProtocol Standard Public
1/15
ENERGY METER READING PROTOCOL
AND
CALIBRATION PROTOCOL
VTEMS11-VT11
Author: Narender Rao Saineni , [email protected] ,[email protected]
Revision: 1.0, Dated 7 July 2012
mailto:[email protected]:[email protected]:[email protected]:[email protected] -
7/31/2019 MeterReadingProtocol Standard Public
2/15
1 Introduction
These days in India several electric utility companies are procuring the single and3 phase energy meters with meter reading facility from the optical port or avariation of the optical port like IRDA, CIR etc.
However to read the measured parameters and the logged data like tamper log,load survey log from the meter no standard protocol has been specified by theIndians standardization body, hence every utility is specifying their own protocol.If utility does not specify the mfr implements his own protocol.
in the case of meters shipped using vijethat technology and the customer doesnot specify the product , vijethat intends to implement the protocol as specified i
this document.
enough effort has been put to make this protocol server all the benefits normallyexpected from the protocol as listed in the above requirements of the protocol.
Even when customer specifies his own protocol, we will implement the customerprotocol for reading the meters, but in addition to the customer protocol we willimplement the features of this protocol for identification purpose and thecalibration purpose.
going forward when we implement the RF communication in the meters, we needas protocol between the RF module and the energy chip, then also we will usethis protocol.
-
7/31/2019 MeterReadingProtocol Standard Public
3/15
2 Requirements of the Protocol
To design this protocol we have taken the following list of requirements.
It should have protocol version identifier and allow future enhancementseasily
It should give full product identification
wake up from sleep condition should be defined even if it can not beimplemented now
collision avoidance for global enquires should be there
should detect errors in the packets and repeat attempt procedure shouldbe defined
It should be easy to implement
Reader should be able to read the normally used basic data very fast
It should be compatible to add the next communication module i.e LPRF
ZIGBEE It should give self documentation to the extent feasible
It should allow setting of some parameters as future enhancement
It should allow authentication to field set TOD times etc as futureenhancement
Facility to Calibrate/Set with computer and test bench on the prodn floor.Voltages, Currents, KWhs, Lead/Lag factor, Time, Srno, Lock
3 Vijetha 1 Phase Energy Meter Protocol
In normal situation
The reader first issues the whoareyou command to the meter. meter gives its fulidentity i.e the make,model,srno,protocol,s/w version,basicdata-sizeetc.
The reader reads one block of basic data which is typically about 30 bytes withsingle read n registers query, the response takes about 30 msecs, reader issuessession close command which takes about 10msec @ 9600 baudrate.
the meter displays done on LCD and does not respond to the global queries forabout 15 mins.
-
7/31/2019 MeterReadingProtocol Standard Public
4/15
that is the end of the meter reading session
To read archive data like accumulated tampers & load survey if implemented
The reader does not close the session after first read but issues more read
commands that it is interested in and collects the data
The data available with the meter is published by the meter in its directoryregister block, by reading this block the reader can collect all the data the meterhas , even though the reader is not aware of the mapping of the extra datacollected it can still collect it and upload it to BCS.
3.1 Reading Session Overview
A typical Meter Reading session in the field
The meter reader ( MRI/CMRI/ISBM) can read the meter if the protocol isfollowed.The automatic product and protocol recognition helps in a commonmeter reader to used the appropriate protocol to read the meter and store itsdata
This also helps the mfr in calibrating the device automatically as per the mfrgprotocol mfr may be manufacturing the single phase /3 phase energy meters fordifferent customers as per customer protocol, and also may be manufacturing thDIN industrial meters or any other data acquisition system.
-------------------------Reading Session Overview ------------------------------------------
Reader: Identify yourself global enquiryMeter: Identification
Reader: Give Data, meter specific enquiryMeter: Data
Reader: Close Session , meter specificMeter: OK
-
7/31/2019 MeterReadingProtocol Standard Public
5/15
3.2 Protocol Details
3.2.1 Wakeup command
This is not really command because the meter is not expected to receive the fullbyte sequence sent, however meter is expected to get some interrupt and wakeup from the sequence sent.This is not possible on all h/w versions, this is mainly to be used for futureplanning.
Query: 0x00000000Resp: wakes up but does not give any response
//implementationNormally the serial line is in mark condition (no optical signal through opticalport), when we send 0 the signal switches from mark to space sufficient amountof time. We can make RXD going to zero for long using rc filter to generate aninterrupt to the cpu to wake up instead of every RXD waking it up.
3.2.2 Help command
Query= help,sno cr lf
// this is a very generic ascii query which should be supported by alldevices, if help is followed by a number, only the addressed deviceshould respond otherwise all who receive it should respond, lower digit partial sno match supported
Response=binary 000000 wakes up device, whoareyou givesMAKE,PROD,MODEL,SERIALNO,PROTOCOL,FWVERSION, PROTOCOfor protocoldetails checkhttp://sites.google.com/site/energymetersindia.com/protocol-vjt-sem01,lrs
3.2.3 Whoareyou command
Issuing this command is optional, this is not required to be issued in normal casewhere the meter type and protocol is known.
only in case the reader is handling many types of meters with different protocols
http://sites.google.com/site/energymetersindia.com/protocol-vjt-sem01,lrshttp://sites.google.com/site/energymetersindia.com/protocol-vjt-sem01,lrs -
7/31/2019 MeterReadingProtocol Standard Public
6/15
issue of this command helps it determine how to read the meter based onresponse to this command
Query= whoareyou crlforwhoareyou n,a,b,c,CS crlf
n= whoareyou command version nfor version 1 the parameters a,b,c meana=respond in one of a time slotsb=time slot period in millisecondsCS= checksum
for the basic whoareyou command CS is not requiredfor extended whoareyou with parameters CS is required ( we need to detecterrors in the parameters, if whoareyou word itself is errored it will not getresponse)
Respone=MAKE,PRODUCT,MODEL,SRNO,F/WVERSION,PROTOCOL,CS CRLF
example responseNPPL,1PEMU,DGS1206,12345678,vt-aab,dgs-10,CS crlf
MAKE: is a four letter wordPRODUCT: tells us what type of product is it, single phase/ 3phase meter , utilitymeter or DIN meter etc
MODEL: is a string which tells if it is a specific customer tender model or ourgeneric model etc, if its customer model 4 letter customer name and YYMM willbe part of this string
SRNO: is usually a numeric string giving the product serial number in this model
F/WVERSION= is the word which tells us the feature set of the firmware in thismodel , usually it is 4 letter customer name if customer has specified a spec ,ifnot our own string indicating the feature set, the word will have 2 number suffixindicating major version and bugfix versions i.e 21 means version 2 with bugfixrelease 1, the numerics can cross 9 and increase as a,b,c also
1x //customer features dgs, version=1, x=bugfix level starts with 0,procees as 1..9,then a,b,c
-
7/31/2019 MeterReadingProtocol Standard Public
7/15
PROTOCOL: Protocol is nothing but the procedure defined for how we read theproduct and how we calibrate the product.protocol = apc11-vt11apcommon Reading Protocol Version1 Having ReadableParameterSet1 -Calibration Protocol Vijetha Technlogies Procedure1 ParamsList1
protocol = vtems11-vt11VijethaTechnologies EnergyMeter SerialPort Reading Protocol Version1 HavingReadableParameterSet1 - Calibration Protocol Vijetha Technlogies Procedure1ParamsList1
whoareyou can be issued with multiple options
R = whoareyou,2,4,100,cs crlf
2=respond in time slotted manner4=4 slots100= each slot 100 msecs each
3.2.4 Reading Data
Reading the meter is as per the modbus binary reading mode known as rtumode, however there is a small change made to it , normally modbus-rtu usescrc16 as the checksum. but we are using 16 bit checksum ( ~cs16) , thecomputation of cs16 is very simple compare to the crc16, crc16 needs 512 bytepage table to compute it in byte mode or bit mode convolution which takes time.
however in meters having the capability to implement crc16 we provide theoption of using such protocol
when meter uses reading protocol vtmb1x i.e Vijetha Technologies modbusprotocol version11 then it is ~cs16
when meter uses reading protocol vtmb2x , then we use crc16 as per modbusstandard
-
7/31/2019 MeterReadingProtocol Standard Public
8/15
as per modbus standard the device publishes some 16 bit registers having thereadable data.
we have to use modbus read registers command to read those registers.the registers can be read in any number and in any sequence.
the read registers command format is
Query: devid 03 aaaa nnnn cs16
where devid is the one byte slave device id, here in the case of meter reader canuse 0xff which means global address any meter , or if it wishes it can use lower 2digits from the meter serial number as the bcd devid
03 = function code to read registersaaaa = 16 bit starting address of the register blocknnnn = number of registers to read ,two bytes
cs16 = our variant of ( in standard it is crc16) checksum
example:
ff0310000002xxxx // Hello anyone read 0x0002 regs from 0x1000
Response Packet Format is
devid cmd n Data cs16
devid = slave device idcmd = same as in queryn = no of data bytes ( n = 2 * n of query)Data = data bytes HHLL HHLLcs16 = 16 bit checksum
example:01030401020304xxxx // devid=0x01, cmd=0x03,n=0x04,data=01020304
When you want to read the basic block of registers to be read and do not knowexactly how many registers are there in the block ( this can be found in theregister map)
the nof regs to be read can be given as 0xff, then only the available no regs inthe basic block are returned with appropriate parameter n ( the no of data bytes)
-
7/31/2019 MeterReadingProtocol Standard Public
9/15
How to read data from different meters having different amount of data ?One feature of this protocol is that the reader can read the basic block of datahaving the important parameters like cuKWH,MD , cumultative TamperStatus,time stamp quickly in about less than 0.1 sec.
However if the customer wants to read more data , the extra data is avalibale in
the additional parameters blocks they can be read by issuing another readcommand
The reader can also read the archived data like load profile, last 6 monthsKWH,MD records by issuing read archive block command.
However all of them can be read by using the same read registers command onlyThe registers block starting address will change as shown in the register map forthe model of the meter.
the maximum block size that can be read in one command is 252 bytes.
modbus cmds supported
0x03 Read Registers0x04 Write Registers ( for TOD related parameters )
// manufacturer specific commands
0x60 Display a parameter on LCD
0x61 Read a parameter using parameter ID0x62 Set the parameter/Calibrate ( discussed in calibration section)0x70 Flash area dump // for debug purpose0x71 RAM area dump // for debug purpose0x72 All records dump // for debug purpose0x7f Session Close
3.2.5 Register Map
The map of registers is defined in the excel file embedded here
-
7/31/2019 MeterReadingProtocol Standard Public
10/15
16 2 1234 MDof last month
18 4 12345678 cuKWH of last month-
22 200,99 cuTS, AvgPF of the lastmon
24 2 1234 MDof last month
26 4 12345678 cuKWH of last month-
30 200,99 cuTS, AvgPF of the lastmon
32 2 1234 MDof last month
34 4 12345678 cuKWH of last month-
38 200,99 cuTS, AvgPF of the lastmon
40 2 1234 MDof last month
0 2 0x41,55 BlockType-Regmap,NofRegs in this block
2 6 tS,YYMMDDHHMM Tevnt Latest-1
8 6 tS,YYMMDDHHMM Tevn Latest-2
14 24 tS,YYMMDDHHMM Tevnt CO * 4
38 24 tS,YYMMDDHHMM Tevnt SW*4
62 24 tS,YYMMDDHHMM Tmagn *4
86 24 tS,YYMMDDHHMM Trev*4
110 24 tS,YYMMDDHHMM TEarth*4
0 21,20 Regmap,NofRegs in this block
215 Time interval mins
4 MMDDHHMM Since Time BCD
2 90,245 Pf*100,kw*10
2 90,245 Pf*100,kw*10
2 90,245 Pf*100,kw*10
2 0xf0,0xf0 Restart after power failure MARKER
4 MMDDHHMM Since Time
2 90,245 Pf*100,kw*10
2 90,245 Pf*100,kw*10
..
FACTORY MODECOMMANDS
modbus cmd format
slaveid_8,cmd_8,parid_8,[parvalue_8],[parvalue_8],crc16
cmdcoaction
60 display on lcd
61 Read a parameter
62 Set the parameter
parid-hex
00 fied mode display
01 Model
02 Serial no
03 Date
04 Time
05 DateTime
06 DateTime LastRan
10 VRMax
11 VRMin
13 VYMax
14 VYMin
17 VBMax
18 VBMin
1B Vall
18 IRMAX
19 IRMIN
2B INMAX
2C INMIN
30 IACTCHL
31 IALL
32 LOCK
40 R_PF41 Y_PF
42 B_PF
43 ALL_PF
50 CUMKWH
51 CURMONTH KWH
52 CURMONTH MD
53 CURWNDMD
54 R_KWH
55 Y_KWH
56 B_KWH
57 N_KWH
58
59 R_KWH_CORRECT
ARCHIVEOFTAMPERRECORDS@ 0x1200
ARCHIVEOFLOADRECORDS(LOADPROFILE) @ 0x2000
-
7/31/2019 MeterReadingProtocol Standard Public
11/15
3.2.6 Session close command
Query: devid closecmd nofmins cs16Response: ACK // meter after sending ACK char displays done on lcd
after this does not respond to global address requests for nofminshowever device specific query resets the timer.
3.3 Calibration Session
3.4 Future Enhancements
How to use this protocol if meter uses RF Module.
RF module should have an application which reads the meter using this protocoland export the data to the head end / meter reader using the RF domainstandards for example smart energy.
The meter chip will have the firmware of this protocol. and the meter chip need
not be aware whether communication module is Optical port , or RFcommunication port.
All the code related to RF communication will be handled by the RF module app.
However support of additional registers will be added based on the requirement.Only the register map need be known to the end user. (BCS)
4 References
4.1 Modbus and International Standard
What is Modbus protocol?
-
7/31/2019 MeterReadingProtocol Standard Public
12/15
Modbus Protocol is a messaging structure developed by Modicon in 1979. It isused to establish master-slave/client-server communication between intelligentdevices. It is a de facto standard, truly open and the most widely used networkprotocol in the industrial manufacturing environment. It has been implementedby hundreds of vendors on thousands of different devices to transferdiscrete/analog I/O and register data between control devices. It's a lingua francaor common denominator between different manufacturers. One report called it
the "de facto standard in multi-vendor integration". Industry analysts havereported over 7 million Modbus nodes in North America and Europe alone.
The RTU mode(binary mode frame) will be as follows
The ASCII mode ( 7 bit ascii +1 bit parity chars) frame will be as follows
-
7/31/2019 MeterReadingProtocol Standard Public
13/15
-
7/31/2019 MeterReadingProtocol Standard Public
14/15
4.2 DLMS International Standard
Q: /? DeviceAdress ! CR LFR: /XXXZ\;W;Identification CRLFQ: ACK V Z Y CR LFR: STX DATABLOCK ! CR LF ETX BCC
-
7/31/2019 MeterReadingProtocol Standard Public
15/15
4.3 Comparsion of Protocols
StartChar EndCharsMODBUS-ASCII
: devid cmd data cs CRLF
APCOMMON : n cmd data cs CRLFModbus-rtu 3.5charga
pdevid cmd data Crc16
Vt21 3.5chargap
devid cmd data Crc16
Vt11 3.5chargap
devid cmd data CS16