1. Introduction
Model catalog
Search for these models in ThinkLink by name or ID.
| Model type | Name | id_name | Platform model ID |
|---|---|---|---|
| RPC | [DLT64507-3P GET] para | dlt64507_3p_get_23107 | 101053879206023173 |
| RPC | [DLT64507-3P SET] para | dlt64507_3p_set_23107 | 98887635589664773 |
| Template | DLT64507-3P | 101054643093639173 | |
| Thing Model | [DLT64507-3P] | dlt64507_3p_23107 | 101022486501527557 |
| Thing Model | [MT-23107-DLT64507-3P资产] 区域聚合 | dlt64507_3p_asset_23107 | 119677189950959621 |
| Parameter Thing Model | [DLT64507-3P-PARA] | dlt64507_3p_para_23107 | 98889760482791429 |
The DL/T 645-2007 three-phase energy meter is a three-phase power metering device compliant with the DL/T 645-2007 communication protocol. It can be used to collect electrical parameters such as three-phase voltage, three-phase current, active energy, reverse energy, active power, reactive power, power factor, and grid frequency.
This solution uses the DL/T 645-2007 three-phase energy meter as the access target. The meter is connected through the RS-485 interface of the KC11 LoRaWAN data acquisition device. The built-in EdgeBus script of KC11 is used to complete DL/T 645-2007 protocol acquisition, data encapsulation, and LoRaWAN uplink reporting.
2. Product Features
- Supports data acquisition from DL/T 645-2007 three-phase energy meters
- Supports RS-485 interface access
- Enables wireless LoRaWAN access for meter data through KC11
- Supports separate configuration of upload period and acquisition period
- Supports configuration of the DL/T 645 meter address
- Supports unified acquisition of three-phase electrical parameters
- Supports ThinkLink thing model parsing
- Supports RPC-based parameter configuration
- Supports sub-device address identification, suitable for multi-meter or multi-device management scenarios
3. Application Scope
This solution is suitable for scenarios where traditional DL/T 645-2007 three-phase energy meters need to be connected to ThinkLink / LoRaWAN systems, such as:
- Power monitoring in industrial parks
- Building power distribution monitoring
- Remote meter reading for distribution cabinets
- Energy consumption management systems
- Power consumption monitoring for factory equipment
- Wireless retrofit of existing energy meters
- MQTT data subscription by third-party platforms
- Data integration with PLC / SCADA / energy management systems
4. Data Acquisition Device Information
4.1 Hardware Information
| Item | Description |
|---|---|
| Data acquisition device model | KC11 |
| Communication interface | RS-485 |
| Power supply | 220V power supply |
| Communication method | LoRaWAN |
| EdgeBus support | Supported |
| Adapted protocol | DL/T 645-2007 |
| Business code | 23107 |
| Template | DLT645-2007-3P |
4.2 Wiring Information
Power and Communication Interfaces
| Interface | Description |
|---|---|
| Power input | KC11 uses 220V power supply |
| RS-485 A/B | Connected to the RS-485 communication interface of the DL/T 645-2007 three-phase energy meter |
| LoRaWAN | KC11 reports collected data to the gateway / ThinkLink through LoRaWAN |
Sensor Interface
In this solution, the three-phase energy meter is connected to KC11 through RS-485.
KC11 acts as a LoRaWAN acquisition terminal and is responsible for DL/T 645 data reading and LoRaWAN uplink reporting.
5. Data Acquisition
In this solution, the following data items are read through the DL/T 645-2007 protocol:
| No. | Data Item | Field Name | Unit |
|---|---|---|---|
| 1 | Forward active total energy | energy_import_total | kWh |
| 2 | Reverse active total energy | energy_export_total | kWh |
| 3 | Phase A voltage | voltage_a | V |
| 4 | Phase B voltage | voltage_b | V |
| 5 | Phase C voltage | voltage_c | V |
| 6 | Phase A current | current_a | A |
| 7 | Phase B current | current_b | A |
| 8 | Phase C current | current_c | A |
| 9 | Total active power | active_power_total | kW |
| 10 | Phase A active power | active_power_a | kW |
| 11 | Phase B active power | active_power_b | kW |
| 12 | Phase C active power | active_power_c | kW |
| 13 | Total reactive power | reactive_power_total | kvar |
| 14 | Phase A reactive power | reactive_power_a | kvar |
| 15 | Phase B reactive power | reactive_power_b | kvar |
| 16 | Phase C reactive power | reactive_power_c | kvar |
| 17 | Total power factor | power_factor_total | - |
| 18 | Phase A power factor | power_factor_a | - |
| 19 | Phase B power factor | power_factor_b | - |
| 20 | Phase C power factor | power_factor_c | - |
| 21 | Grid frequency | frequency | Hz |
5.1 Register Definition
DL/T 645-2007 does not use the Modbus register method. Instead, data is read through the data identifier, DI.
In this solution, EdgeBus reads each data item through DL/T 645-2007 meter-reading commands and packages the returned data into the LoRaWAN uplink frame.
| Data Item | DI | listVal | Description |
|---|---|---|---|
| Forward active total energy | 00010000 | listVal[0] = EPI_T | Read forward active total energy |
| Reverse active total energy | 00020000 | listVal[0] = EPO_T | Read reverse active total energy |
| Three-phase voltage | 0201FF00 | listVal[0] = UA, listVal[1] = UB, listVal[2] = UC | Read A/B/C phase voltage |
| Three-phase current | 0202FF00 | listVal[0] = IA, listVal[1] = IB, listVal[2] = IC | Read A/B/C phase current |
| Active power | 0203FF00 | listVal[0] = PT, listVal[1] = PA, listVal[2] = PB, listVal[3] = PC | Read total / A / B / C phase active power |
| Reactive power | 0204FF00 | listVal[0] = QT, listVal[1] = QA, listVal[2] = QB, listVal[3] = QC | Read total / A / B / C phase reactive power |
| Power factor | 0206FF00 | listVal[0] = PFT, listVal[1] = PFA, listVal[2] = PFB, listVal[3] = PFC | Read total / A / B / C phase power factor |
| Grid frequency | 02800000 | listVal[0] = FREQ | Read grid frequency |
5.2 Status Bit Definition
The thing model parsing logic in this solution includes status judgment:
if ((tdata?.status & 0x02) === 0x02) {
// time out, just update the status.
}| Status Bit | Meaning |
|---|---|
| status & 0x02 | Acquisition timeout |
When an acquisition timeout occurs, the thing model script keeps the telemetry data from the previous frame and only updates the status field. This avoids abnormal clearing of business data caused by a single acquisition failure.
6. EdgeBus Model
The meter itself is not a LoRaWAN device. It needs to use KC11 + EdgeBus to complete RS-485 / DL/T 645 protocol acquisition and report data to ThinkLink through LoRaWAN.
import { Buffer } from "buffer";
import { buildOtaFile } from "@EBSDK/run";
import {
ActionAfertExpr, CalcData,
CrcMode,
CvtRule,
EBBuffer,
EBModel,
ExprCondition,
LoraUpEvent,
QueryEvent, SetUpCovDataType,UserConfUPItem,EventInfoItem
} from "@EBSDK/EBCompiler/all_variable";
import { CheckbitEnum, getOtaConfig, HwTypeEnum, UpgrdTypeEnum } from "@EBSDK/otaConfig";
////////////////////////////////////////////////////////////////////////////////////////
const eventInfo: UserConfUPItem[] = [
{
name: "DLT64507_3P", port: 22, version: "0x87", dataType: "0x07", upPeriodIndex: 70,
indexAddr: 5, addrSize: 6,
quInfo: [
// 正向有功总电能 ,listVal[0] = EPI_T,DI: 00010000
{
protocol: "DLT64507", periodIndex: 74,
indexAPP: 150, indexCMD: 1, copySize: 6, preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 33 34 33 25 16",
ack: "0x68 22 01 13 07 11 25 68 91 08 33 33 34 33 33 33 33 33 75 16",
listVal: [ { start: "14", end: "17" }]
},
// 反向有功总电能,listVal[0] = EPO_T, DI: 00020000
{
protocol: "DLT64507", periodIndex: 74,
indexAPP: 150, indexCMD: 1, copySize: 6, preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 33 35 33 26 16",
ack: "0x68 22 01 13 07 11 25 68 91 08 33 33 35 33 33 33 33 33 76 16",
listVal: [ { start: "14", end: "17" }]
},
// 三相电压,listVal[0] = UA,listVal[1] = UB,listVal[2] = UC,DI: 0201FF00
{
protocol: "DLT64507", periodIndex: 74,
indexAPP: 150, indexCMD: 1, copySize: 6, preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 34 35 26 16",
ack: "0x68 22 01 13 07 11 25 68 91 0A 33 32 34 35 33 33 33 33 33 33 DE 16",
listVal: [
{ start: "14", end: "15" },
{ start: "16", end: "17" },
{ start: "18", end: "19" }
]
},
// 三相电流,listVal[0] = IA,listVal[1] = IB,listVal[2] = IC,DI: 0202FF00
{
protocol: "DLT64507", periodIndex: 74,
indexAPP: 150, indexCMD: 1, copySize: 6, preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 35 35 27 16",
ack: "0x68 22 01 13 07 11 25 68 91 0D 33 32 35 35 33 33 33 33 33 33 33 33 33 7B 16",
listVal: [
{ start: "14", end: "16" },
{ start: "17", end: "19" },
{ start: "20", end: "22" }
]
},
// 有功功率,listVal[0] = PT,listVal[1] = PA,listVal[2] = PB,listVal[3] = PC,DI: 0203FF00
{
protocol: "DLT64507", periodIndex: 74,
indexAPP: 150, indexCMD: 1, copySize: 6, preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 36 35 28 16",
ack: "0x68 22 01 13 07 11 25 68 91 10 33 32 36 35 33 33 33 33 33 33 33 33 33 33 33 33 18 16",
listVal: [
{ start: "14", end: "16" },
{ start: "17", end: "19" },
{ start: "20", end: "22" },
{ start: "23", end: "25" }
]
},
// 无功功率,listVal[0] = QT,listVal[1] = QA,listVal[2] = QB,listVal[3] = QC, DI: 0204FF00
{
protocol: "DLT64507", periodIndex: 74,
indexAPP: 150, indexCMD: 1, copySize: 6, preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 37 35 29 16",
ack: "0x68 22 01 13 07 11 25 68 91 10 33 32 37 35 33 33 33 33 33 33 33 33 33 33 33 33 19 16",
listVal: [
{ start: "14", end: "16" },
{ start: "17", end: "19" },
{ start: "20", end: "22" },
{ start: "23", end: "25" }
]
},
// 功率因数,listVal[0] = PFT,listVal[1] = PFA,listVal[2] = PFB,listVal[3] = PFC,DI: 0206FF00
{
protocol: "DLT64507", periodIndex: 74,
indexAPP: 150, indexCMD: 1, copySize: 6, preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 39 35 2B 16",
ack: "0x68 22 01 13 07 11 25 68 91 0C 33 32 39 35 33 33 33 33 33 33 33 33 4B 16",
listVal: [
{ start: "14", end: "15" },
{ start: "16", end: "17" },
{ start: "18", end: "19" },
{ start: "20", end: "21" }
]
},
// 电网频率,listVal[0] = FREQ,DI: 02800000
{
protocol: "DLT64507", periodIndex: 74,
indexAPP: 150, indexCMD: 1, copySize: 6, preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 33 B3 35 A6 16",
ack: "0x68 22 01 13 07 11 25 68 91 06 33 33 B3 35 33 33 8E 16",
listVal: [
{ start: "14", end: "15" }
]
}
]
}
]
let otaConfig = getOtaConfig({
BaudRate: 9600,
StopBits: 1,
DataBits: 8,
Checkbit: CheckbitEnum.EVEN,
Battery: false, // 非电池供电,Class C模式
ConfirmDuty: 60,
BzType: 23107,
BzVersion: 11
})
const MODBUS_TT = (ebModel: EBModel) => {
for (let i=0; i<eventInfo.length; i++){
let event=new EventInfoItem(eventInfo[i]);
event.upEventSetup()
event.eventInstall()
}
return JSON.stringify(ebModel, null, 2)
}
buildOtaFile(import.meta.url, otaConfig, MODBUS_TT)6.1 EB Configuration Parameters
| Parameter | Value | Description |
|---|---|---|
| BaudRate | 9600 | RS-485 baud rate |
| StopBits | 1 | Stop bit |
| DataBits | 8 | Data bit |
| Checkbit | EVEN | Even parity |
| Battery | false | Non-battery powered |
| Class mode | Class C | Non-battery powered, suitable for Class C |
| ConfirmDuty | 60 | Confirmation period configuration |
| BzType | 23107 | Business code |
| BzVersion | 11 | Business version |
Period and Parameter Addresses
| Parameter | APP Address | Description |
|---|---|---|
| period_up | 70 | Upload period |
| period_read | 74 | Acquisition period |
| addr_645 | 150 | DL/T 645 meter address, 6 bytes |
Note: The acquisition period should be shorter than the upload period.
6.2 EB Code
import { Buffer } from "buffer";
import { buildOtaFile } from "@EBSDK/run";
import {
ActionAfertExpr, CalcData,
CrcMode,
CvtRule,
EBBuffer,
EBModel,
ExprCondition,
LoraUpEvent,
QueryEvent, SetUpCovDataType, UserConfUPItem, EventInfoItem
} from "@EBSDK/EBCompiler/all_variable";
import { CheckbitEnum, getOtaConfig, HwTypeEnum, UpgrdTypeEnum } from "@EBSDK/otaConfig";
const eventInfo: UserConfUPItem[] = [
{
name: "DLT64507_3P",
port: 22,
version: "0x87",
dataType: "0x07",
upPeriodIndex: 70,
indexAddr: 5,
addrSize: 6,
quInfo: [
{
protocol: "DLT64507",
periodIndex: 74,
indexAPP: 150,
indexCMD: 1,
copySize: 6,
preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 33 34 33 25 16",
ack: "0x68 22 01 13 07 11 25 68 91 08 33 33 34 33 33 33 33 33 75 16",
listVal: [{ start: "14", end: "17" }]
},
{
protocol: "DLT64507",
periodIndex: 74,
indexAPP: 150,
indexCMD: 1,
copySize: 6,
preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 33 35 33 26 16",
ack: "0x68 22 01 13 07 11 25 68 91 08 33 33 35 33 33 33 33 33 76 16",
listVal: [{ start: "14", end: "17" }]
},
{
protocol: "DLT64507",
periodIndex: 74,
indexAPP: 150,
indexCMD: 1,
copySize: 6,
preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 34 35 26 16",
ack: "0x68 22 01 13 07 11 25 68 91 0A 33 32 34 35 33 33 33 33 33 33 DE 16",
listVal: [
{ start: "14", end: "15" },
{ start: "16", end: "17" },
{ start: "18", end: "19" }
]
},
{
protocol: "DLT64507",
periodIndex: 74,
indexAPP: 150,
indexCMD: 1,
copySize: 6,
preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 35 35 27 16",
ack: "0x68 22 01 13 07 11 25 68 91 0D 33 32 35 35 33 33 33 33 33 33 33 33 33 7B 16",
listVal: [
{ start: "14", end: "16" },
{ start: "17", end: "19" },
{ start: "20", end: "22" }
]
},
{
protocol: "DLT64507",
periodIndex: 74,
indexAPP: 150,
indexCMD: 1,
copySize: 6,
preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 36 35 28 16",
ack: "0x68 22 01 13 07 11 25 68 91 10 33 32 36 35 33 33 33 33 33 33 33 33 33 33 33 33 18 16",
listVal: [
{ start: "14", end: "16" },
{ start: "17", end: "19" },
{ start: "20", end: "22" },
{ start: "23", end: "25" }
]
},
{
protocol: "DLT64507",
periodIndex: 74,
indexAPP: 150,
indexCMD: 1,
copySize: 6,
preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 37 35 29 16",
ack: "0x68 22 01 13 07 11 25 68 91 10 33 32 37 35 33 33 33 33 33 33 33 33 33 33 33 33 19 16",
listVal: [
{ start: "14", end: "16" },
{ start: "17", end: "19" },
{ start: "20", end: "22" },
{ start: "23", end: "25" }
]
},
{
protocol: "DLT64507",
periodIndex: 74,
indexAPP: 150,
indexCMD: 1,
copySize: 6,
preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 32 39 35 2B 16",
ack: "0x68 22 01 13 07 11 25 68 91 0C 33 32 39 35 33 33 33 33 33 33 33 33 4B 16",
listVal: [
{ start: "14", end: "15" },
{ start: "16", end: "17" },
{ start: "18", end: "19" },
{ start: "20", end: "21" }
]
},
{
protocol: "DLT64507",
periodIndex: 74,
indexAPP: 150,
indexCMD: 1,
copySize: 6,
preamble: 4,
cmd: "0x68 22 01 13 07 11 25 68 11 04 33 33 B3 35 A6 16",
ack: "0x68 22 01 13 07 11 25 68 91 06 33 33 B3 35 33 33 8E 16",
listVal: [
{ start: "14", end: "15" }
]
}
]
}
];
let otaConfig = getOtaConfig({
BaudRate: 9600,
StopBits: 1,
DataBits: 8,
Checkbit: CheckbitEnum.EVEN,
Battery: false,
ConfirmDuty: 60,
BzType: 23107,
BzVersion: 11
});
const MODBUS_TT = (ebModel: EBModel) => {
for (let i = 0; i < eventInfo.length; i++) {
let event = new EventInfoItem(eventInfo[i]);
event.upEventSetup();
event.eventInstall();
}
return JSON.stringify(ebModel, null, 2);
};6.3 Description
Description of the current EB logic:
- KC11 connects to the DL/T 645-2007 three-phase energy meter through the RS-485 interface.
- The EB script periodically collects data from the meter according to
periodIndex: 74. - The upload period parameter is stored at APP parameter address
70. - The acquisition period parameter is stored at APP parameter address
74. - The DL/T 645 meter address is stored at APP parameter address
150, with a length of 6 bytes. - Before each DL/T 645 meter-reading command is sent, the 6-byte DL/T 645 meter address is copied from APP parameter address
150into the command. - The number of DL/T 645 preamble bytes
FEis 4. - After EB collects the returned data from the meter, it combines the data segments specified by
listValinto the LoRaWAN uplink frame. - The ThinkLink thing model is responsible for restoring the DL/T 645 offset code, BCD decoding, unit conversion, and field mapping.
- Since KC11 is powered by 220V,
Battery: falseis configured, making it suitable for Class C mode.
7. Thing Model
7.1 Basic Thing Model Information
Data Thing Model
| Item | Description |
|---|---|
| Name | DLT64507-3P |
| id Name | dlt64507_3p_23107 |
| LoRaWAN Port | 22 |
| Data length | 68 |
| RSSI included | Yes |
| Sub-device address | index: 5, type: hexBE6 |
| Tag 1 | index: 0, tag: 0x87 |
| Tag 2 | index: 1, tag: 0x07 |
Parameter Thing Model
| Item | Description |
|---|---|
| Name | DLT64507-3P-PARA |
| id Name | dlt64507_3p_para_23107 |
| Parameter report Port | 214 |
| Parameter content | Upload period, acquisition period, DL/T 645 address |
7.2 Uplink Frame Structure
| Field | Position / Type | Description |
|---|---|---|
| port | 22 | Data uplink port |
| dataLen | 68 | Data length |
| rssi | true | Includes RSSI |
| subDevice | index: 5, type: hexBE6 | DL/T 645 meter address / sub-device address |
| tagList[0] | index: 0, tag: 0x87 | Business version identifier |
| tagList[1] | index: 1, tag: 0x07 | Data type identifier |
| appData | index 11-67 | DL/T 645 acquisition data area |
DL/T 645 uses offset code encoding. In the EB uplink, appData stores the original response data from the meter. That means each data byte is still in the +0x33 format.
Therefore, before parsing the thing model, the application data area must be restored from the DL/T 645 offset code.
Processing rule:
for (let i = 11; i < payload.length; i++) {
payload[i] = (payload[i] - 0x33 + 0x100) & 0xff;
}7.3 Thing Model Script
import { Buffer } from "buffer";
import { BufferTKL, PayParser } from "../../tklHelper.js";
function payload_parser({ device, msg, thingModelId, noticeAttrs }) {
let frameInfo = {
port: 22,
dataLen: 68,
rssi: true,
subDevice: { index: 5, type: "hexBE6" },
tagList: [
{ index: 0, tag: 0x87 },
{ index: 1, tag: 0x07 }
]
};
if (msg?.userdata?.payload == undefined) return null;
if (msg?.userdata?.payload == "") return null;
/**
* DL/T 645 uses offset code encoding:
* The appData in the EB uplink stores the original response data from the meter,
* which means each data byte is still in the +0x33 format.
*
* Therefore, before entering PayParser,
* each byte in the application data area needs to be subtracted by 0x33.
*
* Note:
* Bytes 0-10 are the EB uplink header + meter address and should not be processed.
* Bytes 11-67 are the DL/T 645 data area and need offset code restoration.
*/
let payload = Buffer.from(msg.userdata.payload, "base64");
for (let i = 11; i < payload.length; i++) {
payload[i] = (payload[i] - 0x33 + 0x100) & 0xff;
}
msg = JSON.parse(JSON.stringify(msg));
msg.userdata.payload = payload.toString("base64");
let appInfo = [
{ name: "Forward active total energy", unit: "kWh", field_name: "energy_import_total", index: 11, dataType: "bcdle4", coefficient: 0.01, decimal: 2 },
{ name: "Reverse active total energy", unit: "kWh", field_name: "energy_export_total", index: 15, dataType: "bcdle4", coefficient: 0.01, decimal: 2 },
{ name: "Phase A voltage", unit: "V", field_name: "voltage_a", index: 19, dataType: "bcdle2", coefficient: 0.1, decimal: 1 },
{ name: "Phase B voltage", unit: "V", field_name: "voltage_b", index: 21, dataType: "bcdle2", coefficient: 0.1, decimal: 1 },
{ name: "Phase C voltage", unit: "V", field_name: "voltage_c", index: 23, dataType: "bcdle2", coefficient: 0.1, decimal: 1 },
{ name: "Phase A current", unit: "A", field_name: "current_a", index: 25, dataType: "bcdle3", coefficient: 0.001, decimal: 3 },
{ name: "Phase B current", unit: "A", field_name: "current_b", index: 28, dataType: "bcdle3", coefficient: 0.001, decimal: 3 },
{ name: "Phase C current", unit: "A", field_name: "current_c", index: 31, dataType: "bcdle3", coefficient: 0.001, decimal: 3 },
{ name: "Total active power", unit: "kW", field_name: "active_power_total", index: 34, dataType: "bcdle3", coefficient: 0.0001, decimal: 4 },
{ name: "Phase A active power", unit: "kW", field_name: "active_power_a", index: 37, dataType: "bcdle3", coefficient: 0.0001, decimal: 4 },
{ name: "Phase B active power", unit: "kW", field_name: "active_power_b", index: 40, dataType: "bcdle3", coefficient: 0.0001, decimal: 4 },
{ name: "Phase C active power", unit: "kW", field_name: "active_power_c", index: 43, dataType: "bcdle3", coefficient: 0.0001, decimal: 4 },
{ name: "Total reactive power", unit: "kvar", field_name: "reactive_power_total", index: 46, dataType: "bcdle3", coefficient: 0.0001, decimal: 4 },
{ name: "Phase A reactive power", unit: "kvar", field_name: "reactive_power_a", index: 49, dataType: "bcdle3", coefficient: 0.0001, decimal: 4 },
{ name: "Phase B reactive power", unit: "kvar", field_name: "reactive_power_b", index: 52, dataType: "bcdle3", coefficient: 0.0001, decimal: 4 },
{ name: "Phase C reactive power", unit: "kvar", field_name: "reactive_power_c", index: 55, dataType: "bcdle3", coefficient: 0.0001, decimal: 4 },
{ name: "Total power factor", unit: "", field_name: "power_factor_total", index: 58, dataType: "bcdle2", coefficient: 0.001, decimal: 3 },
{ name: "Phase A power factor", unit: "", field_name: "power_factor_a", index: 60, dataType: "bcdle2", coefficient: 0.001, decimal: 3 },
{ name: "Phase B power factor", unit: "", field_name: "power_factor_b", index: 62, dataType: "bcdle2", coefficient: 0.001, decimal: 3 },
{ name: "Phase C power factor", unit: "", field_name: "power_factor_c", index: 64, dataType: "bcdle2", coefficient: 0.001, decimal: 3 },
{ name: "Grid frequency", unit: "Hz", field_name: "frequency", index: 66, dataType: "bcdle2", coefficient: 0.01, decimal: 2 }
];
let payParser = new PayParser({
device: device,
msg: msg,
frameInfo: frameInfo,
appInfo: appInfo
});
let tdata = payParser.telemetry();
if ((tdata?.status & 0x02) === 0x02) {
const status = tdata.status;
tdata = { ...(device.telemetry_data?.[thingModelId] ?? {}) };
tdata.status = status;
}
return {
sub_device: tdata?.addr === undefined ? null : tdata.addr,
telemetry_data: tdata,
server_attrs: null,
shared_attrs: {
class_mode: msg?.userdata?.class
}
};
}8. Third-Party Platform Data Subscription
8.1 MQTT Topic
/v32/{Organization Account}/tkl/up/telemetry/{eui}8.2 Example Reported Data
{
"eui": "6353012af10a9331",
"active_time": "2026-02-05T08:35:48.000Z",
"thingModelId": "dlt64507_3p_23107",
"thingModelIdName": "DLT64507-3P",
"sub_device": "221113071125",
"telemetry_data": {
"snr": 13.5,
"rssi": -51,
"status": 0,
"addr": "221113071125",
"energy_import_total": 12345.67,
"energy_export_total": 12.34,
"voltage_a": 220.1,
"voltage_b": 219.8,
"voltage_c": 220.5,
"current_a": 5.123,
"current_b": 4.987,
"current_c": 5.001,
"active_power_total": 3.4567,
"active_power_a": 1.1234,
"active_power_b": 1.1567,
"active_power_c": 1.1766,
"reactive_power_total": 0.2345,
"reactive_power_a": 0.0781,
"reactive_power_b": 0.0764,
"reactive_power_c": 0.0800,
"power_factor_total": 0.986,
"power_factor_a": 0.981,
"power_factor_b": 0.987,
"power_factor_c": 0.990,
"frequency": 50.01
}
}9. RPC
9.1 RPC Names
Parameter Configuration
| Item | Description |
|---|---|
| Name | DLT64507-3P SET |
| Type | para |
| id Name | dlt64507_3p_set_23107 |
Parameter Reading
| Item | Description |
|---|---|
| Name | DLT64507-3P GET |
| Type | para |
| id Name | dlt64507_3p_get_23107 |
9.2 Parameter Definition
| Parameter Name | Field Name | APP Address | Type | Unit | Description |
|---|---|---|---|---|---|
| period_up | period_up | app_70 | uint32LE | s | Upload period |
| period_read | period_read | app_74 | uint32LE | s | Acquisition period |
| addr_645 | addr_645 | app_150 | hexBE6 | - | DL/T 645 meter address |
Parameter definition code:
let paraDef = {
app_70: {
name: "period_up",
field_name: "period_up",
unit: "s",
type: "uint32LE"
},
app_74: {
name: "period_read",
field_name: "period_read",
unit: "s",
type: "uint32LE"
},
app_150: {
name: "addr_645",
field_name: "addr_645",
unit: "",
type: "hexBE6"
}
};9.3 RPC Code
Parameter Configuration RPC
let classMode = (device && device.shared_attrs && device.shared_attrs.class_mode) || "ClassA";
const rpcName = "dlt64507_3p_para_23107";
let paraDef = {
app_70: { name: "period_up", field_name: "period_up", unit: "s", type: "uint32LE" },
app_74: { name: "period_read", field_name: "period_read", unit: "s", type: "uint32LE" },
app_150: { name: "addr_645", field_name: "addr_645", unit: "", type: "hexBE6" }
};
logger.info("set paras");
let frames = RPCHelper.buildFrame({
paraDef: paraDef,
params: params
});
let redoBuffer = RPCHelper.redo();
let dnBuffer = Buffer.alloc(frames.writeBuffer.length + frames.readBuffer.length);
frames.writeBuffer.copy(dnBuffer, 0);
frames.readBuffer.copy(dnBuffer, frames.writeBuffer.length);
let msgQue = Utils.makeParaSetMSG({
device: device,
classMode: classMode,
rpcName: rpcName,
params: params,
paraDownBuffer: dnBuffer,
extraAppBuffer: redoBuffer
});
if (msgQue.length == 0) return null;
return msgQue;Parameter Reading RPC
let paraDef = {
app_70: { name: "period_up", field_name: "period_up", unit: "s", type: "uint32LE" },
app_74: { name: "period_read", field_name: "period_read", unit: "s", type: "uint32LE" },
app_150: { name: "addr_645", field_name: "addr_645", unit: "", type: "hexBE6" }
};
let frames = RPCHelper.buildFrame({
paraDef: paraDef,
params: params
});
let msg = RPCHelper.makeMSG({
msgType: Utils.msgType.paras,
device: device,
dnBuffer: frames.readBuffer,
sleepTime: 0
});
return [msg];10. Template Selection
Search for the following template in the ThinkLink platform:
DLT645-2007-3POr search by business type:
DLT645-2007 Three-Phase Energy MeterRecommended selection:
| Template Type | Name / id Name |
|---|---|
| Data thing model | DLT64507-3P / dlt64507_3p_23107 |
| Parameter thing model | DLT64507-3P-PARA / dlt64507_3p_para_23107 |
| Set parameter RPC | DLT64507-3P SET / dlt64507_3p_set_23107 |
| Read parameter RPC | DLT64507-3P GET / dlt64507_3p_get_23107 |