Sei sulla pagina 1di 15

ENERGY METER READING PROTOCOL AND CALIBRATION PROTOCOL VTEMS11-VT11

Author: Narender Rao Saineni , Narender.saineni@gmail.com , Narender@Vijethatechnologies.com

Revision: 1.0, Dated 7 July 2012

1 Introduction
These days in India several electric utility companies are procuring the single and 3 phase energy meters with meter reading facility from the optical port or a variation 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 the Indians 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 does not specify the product , vijethat intends to implement the protocol as specified in this document. enough effort has been put to make this protocol server all the benefits normally expected from the protocol as listed in the above requirements of the protocol. Even when customer specifies his own protocol, we will implement the customer protocol for reading the meters, but in addition to the customer protocol we will implement the features of this protocol for identification purpose and the calibration purpose. going forward when we implement the RF communication in the meters, we need as protocol between the RF module and the energy chip, then also we will use this protocol.

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 enhancements easily It should give full product identification wake up from sleep condition should be defined even if it can not be implemented now collision avoidance for global enquires should be there should detect errors in the packets and repeat attempt procedure should be 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 future enhancement 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 full identity i.e the make,model,srno,protocol,s/w version,basicdata-size etc. The reader reads one block of basic data which is typically about 30 bytes with single read n registers query, the response takes about 30 msecs, reader issues session close command which takes about 10msec @ 9600 baudrate. the meter displays done on LCD and does not respond to the global queries for about 15 mins.

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 directory register block, by reading this block the reader can collect all the data the meter has , even though the reader is not aware of the mapping of the extra data collected 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 is followed.The automatic product and protocol recognition helps in a common meter reader to used the appropriate protocol to read the meter and store its data This also helps the mfr in calibrating the device automatically as per the mfrg protocol mfr may be manufacturing the single phase /3 phase energy meters for different customers as per customer protocol, and also may be manufacturing the DIN industrial meters or any other data acquisition system. -------------------------Reading Session Overview -----------------------------------------Reader: Meter: Reader: Meter: Reader: Meter: Identify yourself global enquiry Identification Give Data, meter specific enquiry Data Close Session , meter specific OK

3.2 Protocol Details

3.2.1 Wakeup command


This is not really command because the meter is not expected to receive the full byte sequence sent, however meter is expected to get some interrupt and wake up from the sequence sent. This is not possible on all h/w versions, this is mainly to be used for future planning. Query: Resp: 0x00000000 wakes up but does not give any response

//implementation Normally the serial line is in mark condition (no optical signal through optical port), when we send 0 the signal switches from mark to space sufficient amount of time. We can make RXD going to zero for long using rc filter to generate an interrupt 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 all devices, if help is followed by a number, only the addressed device should respond otherwise all who receive it should respond, lower 2 digit partial sno match supported Response= binary 000000 wakes up device, whoareyou gives MAKE,PROD,MODEL,SERIALNO,PROTOCOL,FWVERSION, PROTOCO for protocoldetails check http://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 case where the meter type and protocol is known. only in case the reader is handling many types of meters with different protocols

issue of this command helps it determine how to read the meter based on response to this command Query= whoareyou crlf or whoareyou n,a,b,c,CS crlf n= whoareyou command version n for version 1 the parameters a,b,c mean a=respond in one of a time slots b=time slot period in milliseconds CS= checksum for the basic whoareyou command CS is not required for extended whoareyou with parameters CS is required ( we need to detect errors in the parameters, if whoareyou word itself is errored it will not get response) Respone= MAKE,PRODUCT,MODEL,SRNO,F/WVERSION,PROTOCOL,CS CRLF example response NPPL,1PEMU,DGS1206,12345678,vt-aab,dgs-10,CS crlf MAKE: is a four letter word PRODUCT: tells us what type of product is it, single phase/ 3phase meter , utility meter or DIN meter etc MODEL: is a string which tells if it is a specific customer tender model or our generic model etc, if its customer model 4 letter customer name and YYMM will be 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 this model , usually it is 4 letter customer name if customer has specified a spec ,if not our own string indicating the feature set, the word will have 2 number suffix indicating major version and bugfix versions i.e 21 means version 2 with bugfix release 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

PROTOCOL: Protocol is nothing but the procedure defined for how we read the product and how we calibrate the product. protocol = apc11-vt11 apcommon Reading Protocol Version1 Having ReadableParameterSet1 Calibration Protocol Vijetha Technlogies Procedure1 ParamsList1 protocol = vtems11-vt11 VijethaTechnologies EnergyMeter SerialPort Reading Protocol Version1 Having ReadableParameterSet1 - Calibration Protocol Vijetha Technlogies Procedure1 ParamsList1

whoareyou can be issued with multiple options R = whoareyou,2,4,100,cs crlf 2=respond in time slotted manner 4=4 slots 100= each slot 100 msecs each

3.2.4 Reading Data


Reading the meter is as per the modbus binary reading mode known as rtu mode, however there is a small change made to it , normally modbus-rtu uses crc16 as the checksum. but we are using 16 bit checksum ( ~cs16) , the computation of cs16 is very simple compare to the crc16, crc16 needs 512 byte page 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 the option of using such protocol when meter uses reading protocol vtmb1x i.e Vijetha Technologies modbus protocol version11 then it is ~cs16 when meter uses reading protocol vtmb2x , then we use crc16 as per modbus standard

as per modbus standard the device publishes some 16 bit registers having the readable 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 can use 0xff which means global address any meter , or if it wishes it can use lower 2 digits from the meter serial number as the bcd devid 03 = function code to read registers aaaa = 16 bit starting address of the register block nnnn = 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 cmd n Data cs16 = slave device id = same as in query = no of data bytes ( n = 2 * n of query) = data bytes HHLL HHLL = 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 know exactly how many registers are there in the block ( this can be found in the register map) the nof regs to be read can be given as 0xff, then only the available no regs in the basic block are returned with appropriate parameter n ( the no of data bytes)

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 data having 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 read command The reader can also read the archived data like load profile, last 6 months KWH,MD records by issuing read archive block command. However all of them can be read by using the same read registers command only. The registers block starting address will change as shown in the register map for the model of the meter. the maximum block size that can be read in one command is 252 bytes. modbus cmds supported 0x03 0x04 Read Registers Write Registers ( for TOD related parameters )

// manufacturer specific commands 0x60 0x61 0x62 0x70 0x71 0x72 0x7f Display a parameter on LCD Read a parameter using parameter ID Set the parameter/Calibrate ( discussed in calibration section) Flash area dump // for debug purpose RAM area dump // for debug purpose All records dump // for debug purpose Session Close

3.2.5 Register Map


The map of registers is defined in the excel file embedded here

1 6 1 8 2 2 2 4 2 6 3 0 3 2 3 4 3 8 4 0

21 3 24 41 3 57 2468 2 0 ,9 0 9 21 3 24 41 3 57 2468 2 0 ,9 0 9 21 3 24 41 3 57 2468 2 0 ,9 0 9 21 3 24

MDof la m st onth c uKW of la m H st onthc S Avg of the la on uT , PF stm MDof la m st onth c uKW of la m H st onthc S Avg of the la on uT , PF stm MDof la m st onth c uKW of la m H st onthc S Avg of the la on uT , PF stm MDof la m st onth

0 2 8 1 4 3 8 6 2 8 6 10 1

A C IV O T M E R C R S@0 1 0 RH E F A PR E O D x 20 20 1 5 x4 ,5 B kType-R m p,NofR sin thisbloc loc eg a eg k 6 tS Y ,Y MMD H MM DH 6 tS Y ,Y MMD H MM DH 2 tS Y 4 ,Y MMD H MM DH 2 tS Y 4 ,Y MMD H MM DH 2 tS Y 4 ,Y MMD H MM DH 2 tS Y 4 ,Y MMD H MM DH 2 tS Y 4 ,Y MMD H MM DH

T evnt L test-1 a T evn L test-2 a T evnt C * 4 O T evnt S *4 W T a n*4 mg T rev*4 Ta E rth*4

A C IV O L A R C R S O DP O IL )@0 2 0 R H E F O D E O D (L A R F E x 00 21 0 ,2 R m p,NofR sin this bloc eg a eg k 21 5 Tim interva m e l ins 4 MMD H MM S e Tim DH inc e BD C 2 9 ,2 5 0 4 Pf*1 0 0 ,kw*1 0 2 9 ,2 5 0 4 Pf*1 0 0 ,kw*1 0 2 9 ,2 5 0 4 Pf*1 0 0 ,kw*1 0 2 0 ,0 xf0 xf0 R esta a rt fter power fa ilure MAR R KE 4 MMD H MM S e Tim DH inc e 2 9 ,2 5 0 4 Pf*1 0 0 ,kw*1 0 2 9 ,2 5 0 4 Pf*1 0 0 ,kw*1 0 ..

F C O YM D C M A D ATR OE O MNS m odbus c dform t m a sla veid_8 m ,pa ,c d_8 rid_8 rva ,[pa lue_8 ],[pa lue_8 rc 6 rva ],c 1

c dc a tion m ode c 6 0 displa on lc y d 6 1 R dapa m ea ra eter 6 2 S the pa m et ra eter

pa rid-hex 0 0 fied m ode displa y 0 1 Model 0 2 S l no eria 0 3 D te a 0 4 Tim e 0 5 D teT e a im 0 6 D teT e L stR n a im a a 1 0 1 1 1 3 1 4 1 7 1 8 1 B 1 8 1 9 2 B 2 C 3 0 3 1 3 2 4 0 4 1 4 2 4 3 5 0 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9 5 C VR x Ma VR Min VY x Ma VY Min VB x Ma VB Min Va ll IR MAX IR MIN INMAX INMIN IAC H TC L IAL L LO K C R _PF Y_PF B _PF AL _PF L C MKW U H C R NT KW U MO H H C R NT MD U MO H C R ND U W MD R _KW H Y_KW H B _KW H N_KW H R _KW _C R E T H ORC N_KW _C R E T H O RC

6 + PR VMONXR CD MP 0X E E U 7 0 7 1 7 2 FL HAR A D MP AS E U R AR A D MP AM E U AL E SD MP RC U

3.2.6 Session close command

Query: devid closecmd nofmins cs16 Response: ACK // meter after sending ACK char displays done on lcd after this does not respond to global address requests for nofmins however 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 protocol and export the data to the head end / meter reader using the RF domain standards 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 RF communication 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?

Modbus Protocol is a messaging structure developed by Modicon in 1979. It is used to establish master-slave/client-server communication between intelligent devices. It is a de facto standard, truly open and the most widely used network protocol in the industrial manufacturing environment. It has been implemented by hundreds of vendors on thousands of different devices to transfer discrete/analog I/O and register data between control devices. It's a lingua franca or common denominator between different manufacturers. One report called it the "de facto standard in multi-vendor integration". Industry analysts have reported 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

4.2 DLMS International Standard


Q: R: Q: R: /? DeviceAdress ! CR LF /XXXZ\;W;Identification CRLF ACK V Z Y CR LF STX DATABLOCK ! CR LF ETX BCC

4.3 Comparsion of Protocols

MODBUSASCII APCOMMON Modbus-rtu Vt21 Vt11

StartChar : : 3.5charga p 3.5charga p 3.5charga p

devid n devid devid devid

cmd cmd cmd cmd cmd

data data data data data

cs cs Crc16 Crc16 CS16

EndChars CRLF CRLF

Potrebbero piacerti anche