Presentation is loading. Please wait.

Presentation is loading. Please wait.

DLMS Server Protocol Object Layer

Similar presentations


Presentation on theme: "DLMS Server Protocol Object Layer"— Presentation transcript:

1 DLMS Server Protocol Object Layer
2020/1/24 © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

2 Renesas DLMS/COSEM

3 Client Requesting for Data from Server (EM)
Wrapping /Unwrapping Renesas DLMS/COSEM © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

4 Client Setting Parameter in Server (EM)
Wrapping /Unwrapping Renesas DLMS/COSEM © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

5 Initialization

6 The functions used for initializing the object layer.
Initializations The functions used for initializing the object layer. Initialize the interface. COSEMObjectLayerInit(); Allocate the memory and initialize the parameters. ObjectLayerMemInit(); Free allocated memory ObjectLayerMemFree(). © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

7 Interface between Energy meter and Object layer

8 Instantaneous parameters
“The instantaneous parameters shall be continuously updated by the meter hardware/software as per internal sampling and computation time.”--<India Standard> © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

9 DLMS Parameters Update via Real time clock
TimerREinit(); Timer RE is used to simulate the RTC in the meter. The timer will generate the interrupt every second. In the real time clock interrupt routine RealTime_IRQ(), the following data are updated. Instantaneous parameters Billing profile Activity calendar Event log profile © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

10 1. Instantaneous Parameters Update
In Renesas sample code, the update timing is 1s. In the interrupt routine RealTime_IRQ(), costumer needs to update the instantaneous values by themselves. ActiveEnergy = ; MeterConstant_RW = 0.128; ActivePowerSum = 123.4; ReactivePowerSum = 340.3; ApparentPowerSum = 650.7; PowerFactorSum = 0.89; SupplyFrequency = 50; L1_Current = 10.10; L1_Voltage = ; L1_PowerFactor = 0.1; L2_Current = 10.10; L2_Voltage = ; L2_PowerFactor = 0.1; L3_Current = 10.10; L3_Voltage = ; L3_PowerFactor = 0.1; Renesas DLMS Code © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

11 2. Billing profile In the interrupt routine RealTime_IRQ(), the program will check when is the billing date coming, and call the function BillingProfileMethodCapture() triggered by the first second of the billing date. The function BillingProfileMethodCapture() captures all the billing parameters from instantaneous parameters, and stores them to the billing profile buffer. © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

12 3. Activity calendar In the interrupt routine RealTime_IRQ(), the program will continuously check the calendar, if the timing is matched, the function ScriptExecution() will be called, and the actions in the script table will be executed. The function ScriptExecution() executes the script table based on the activity calendar. © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

13 Costumer may do these in the interrupt routine RealTime_IRQ().
4. Event log profile When the event occurs and restores, the event code (EventCodeX) will be assigned and the function EventXProfileMethodCapture() will be called. The function of EventXProfileMethodCapture() store the event code and associated information into the event log buffer (EventLogX). Costumer may do these in the interrupt routine RealTime_IRQ(). © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

14 Interface between Energy meter and Object layer

15 DLMS Server Protocol Stack Library
© 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

16 Supported services in the application layer
SET GET SELECTIVE-ACCESS BLOCK-TRANSFER-WITH-SET BLOCK-TRANSFER-WITH-GET ATTRIBUTE0-SUPPORTED-WITH-GET © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

17 Data access and transport
Object layer Server protocol stack library GET Name Attribute 1 Object ... Attribute n Method(s) COSEM Application COSEM Application COSEM Application ... ... ... SET Data link layer Data link layer Data link layer Physical layer Physical layer Physical layer COMM. MEDIA Access to the attributes and methods of COSEM obejcts is provided by the DLMS services. These services are based on the Client-Server appoach where the data collection system plays the role of the Client and the meter palys the role of the server. The DLMS service request identifies the interface class, the object isntance(s) and the attribute(s) / part of attribute(s) to retrieve, or the method(s) to activate. The DLMS service reponse contains the data, with the data type, or eventually an error message. The DLMS services are defined ina verbal form and formally using the ASN.1 standard. The information is turned into bytes using the A-XDR standard (a performance optimised version of BER). The resulting APDU-s are transported then by the lower protocol layer over the media selected. SET GET COSEM Client © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

18 Interface between object layer and application layer
Unsigned8 ObjectOBISDecode ( st_Cosem_Attr_Desc *Cosem_Attr_Desc , Unsigned8 *data, Unsigned16 service_code ); The function decodes the OBIS code, and call the corresponding service function to reply. OBIS_Get_Area.Ptr This pointer points to a buffer which is used to reply the Get service. The object layer writes the data to the buffer temporarily and the application layer divides it into small blocks (BLOCK-TRANSFER-WITH-GET) if the data length is more than one block. The maximum data length is defined as follows in the DLMS_User.h. #define SERVICE_DATA_BUFFER_LEN 4000 © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

19 Steps to add a new object

20 Steps to add a new object--Overview
Micro definition and Increase OBJECT_NUMBER Add the OBIS code to g_OBIS_CODE Add one more item to the object list g_ObjectList Implement the service function Add the function API to ObjectOBISDecode() © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

21 1. Micro definition and Increase OBJECT_NUMBER
Definition for OBIS code #define OBIS_ASSOCIATION_LN 0 #define OBIS_CLOCK_OPERATION 1 #define OBIS_LOGIC_DEVICE_NAME 2 #define OBIS_PHASE_CURRENT 3 #define OBIS_VOLTAGE 4 #define OBIS_POWER_FACTOR 5 #define OBIS_FREQUENCY 6 Note: make sure the code is continuous. Increase OBJECT_NUMBER from 6 to 7 #define OBJECT_NUMBER 7 © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

22 2. Add the OBIS code to g_OBIS_CODE
const Unsigned8 g_OBIS_CODE [OBIS_CODE_NUMBER][OBIS_CODE_SIZE] = { {0x00,0x00,0x28,0x00,0x00,0xFF}, //OBIS_ASSOCIATION_LN {0x00,0x00,0x01,0x00,0x00,0xFF}, //OBIS_CLOCK_OPERATION {0x00,0x00,0x2A,0x00,0x00,0xFF}, //OBIS_LOGIC_DEVICE_NAME {0x01,0x00,0x1F,0x07,0x00,0xFF}, //OBIS_PHASE_CURRENT {0x01,0x00,0x20,0x07,0x00,0xFF}, //OBIS_VOLTAGE {0x01,0x00,0x21,0x07,0x00,0xFF}, //OBIS_POWER_FACTOR {0x01,0x00,0x0E,0x07,0x00,0xFF}, //OBIS_FREQUENCY }; © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

23 3. Add one more item to the object list g_ObjectList
Note: In the structure of st_OBIS_ObjectList, there are two members maybe not easy to understand. const st_AttributeAccess *attribute_access; const st_MethodAccess *method_access; If an object of new classes (not belong to the existing classes) is added, the access rights of the new classes need to be defined. © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

24 3. Object list g_ObjectList-- attribute_access
Associations: Public client association (PC); Meter reader association (MR); © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

25 3. Object list g_ObjectList-- method_access
Note: If no need to implement methods, just put 0 to the object list. © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

26 3. Object list g_ObjectList
Note: The whole object list will be store in the buffer of OBIS_Get_Area.Buffer while the client tries to get the object list, please make sure the maximum buffer length (SERVICE_DATA_BUFFER_LEN) is enough to hold the data. The buffer length can be calculated by: OBJECT_NUMBER x 56 (bytes) © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

27 4. Implement the service function
Get the access mode of current attribute based on attribute_access defined in the object list. Pass the buffer address to the pointer. OBIS_Get_Area.Ptr = &OBIS_Get_Area.Buffer[0]; 3) Write the buffer according to the attribute ID. 4) Calculate the data length. SERVICE_DATA_BUFFER_LEN is the maximum buffer, the actual buffer length is OBIS_DataLength. © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

28 5. Add the function API to ObjectOBISDecode()
Parameters passed in the API. data: the function implements the SET service, these data are from COSEM client. Service_code: Different services are used in the function. If just GET service is needed, no need to pass the parameter. Obis_f: Used to get the historical data. TZ: Time slot of following parameters. Cumulative Energy kWH TZx Cumulative Energy kVAH TZx MD kW TZx MD kVA TZx © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.

29 2020/1/24 © 2010 Renesas Electronics Hong Kong Limited. All rights reserved.


Download ppt "DLMS Server Protocol Object Layer"

Similar presentations


Ads by Google