1.5 DCU App

The DCU App is an application example which shows the Meters And More Stack functionality on Data Concentrator side, including some Network Management processes and Data Collection from nodes in the Network, bot in Plain and Encrypted mode.

The following table shows the available DCU App projects:

Table 1-5. DCU App projects
Bare-Metal / FreeRTOSPathBoards
Bare-Metalsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_dcu\pic32cx_mtg_ek_pl460.XPIC32CXMTG-EK + PL460-EK
FreeRTOSsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_dcu\pic32cx_mtg_ek_pl460_freertos.XPIC32CXMTG-EK + PL460-EK
Bare-Metalsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_dcu\sam_d20_xpro_pl460.X SAMD20-XPRO+ PL460-EK
FreeRTOSsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_dcu\sam_d20_xpro_pl460_freertos.X SAMD20-XPRO+ PL460-EK

The DCU Application interfaces with the AL component, which is the Meters And More Stack API to interact with the PLC protocol.

Documentation of AL component can be found here: onlinedocs.microchip.com/v2/keyword-lookup?keyword=MM_AL_Description&redirect=true

The AL component on DCU side (Master mode) offers a limited set of capabilities:
  • Decryption and Authentication of encrypted received frames
  • Encryption and Authentication Tag addition on outgoing frames requiring encryption

Other functionalities that are present on Meter (Slave) side, such as Network Maintenance and LMON storage for nodes in the Network, are left to Application, and thus not part of AL.

Application Functionality

The DCU App functionality comprises the following tasks:

Upon initialization, the Application configures the Meters And More Stack by setting the following parameters:
  • Write Key
  • Read Key

Although in normal operation, a different Key pair will be used for every Meter, for the sake of simplicity, this example uses a unique Key pair, same for every Meter.

Other Encryption and Authentication parameters, such as LMON and Destination ACA, are set prior to Data Transmission in case encryption and/or authentication is to be used.

Also on initialization, application registers the required callbacks to be notified by AL upon Data or Event Indications, and Data Confirms.

Then the Application’s State Machine follows an infinite loop of stages depicted on the following figure:
Figure 1-91. DCU App State Machine