Skip to content

DL/T645 Driver

dc3-driver-dlt645 reads electricity meters speaking the Chinese DL/T645-2007 protocol over RS485. It builds the meter request frame (68H ... 16H), verifies the response checksum, and parses the data identifier (DI0-DI3) value; writes use the DL/T645 operator codes for meter programming.

Protocol background

DL/T645-2007 is the Chinese national standard for multi-function electricity meters. Frames are delimited by 68H, carry a 6-byte BCD meter address, and end with a cumulative checksum. Each measured quantity (voltage, current, power, energy) is addressed by a 4-byte data identifier DI0-DI3.

  • Driver name / code: DL/T645 Driver / Dlt645Driver
  • Type: DRIVER_CLIENT (opens the serial port and polls the meter)
  • Underlying library: jSerialComm (self-built DL/T645-2007 frame encode/decode)

Attribute configuration

Driver attributes (device-level driver-attribute)

AttributecodeTypeDefaultDescription
Serial PortportSTRING/dev/ttyUSB0Serial port device path
Baud RatebaudRateINT2400Baud rate (DL/T645 default 2400)
Data BitsdataBitsINT8Data bits
Stop BitsstopBitsINT1Stop bits
ParityparityINT2Parity (2=Even, DL/T645 default)
TimeouttimeoutINT1000Read timeout in milliseconds
Meter AddressmeterAddressSTRING00000000000012-digit BCD meter address
PasswordpasswordSTRING00000000Meter password for writes
Operator CodeoperatorCodeSTRING00000000Operator code for writes

Point attributes (point-attribute)

AttributecodeTypeDefaultDescription
Data IdentifierdiSTRING(empty)4-byte data identifier as 8 hex chars (DI0-DI3)
Data FormatdataFormatSTRINGFLOATData format: FLOAT, HEX, ASCII, BINARY

Collection and health

  • Collection cycle: default cron 0/30 * * * * ? (one polling round over all points every 30 seconds).
  • Health/online: device health defaults to cron 0/15 * * * * ?, lease timeout 45 seconds.

Capability matrix

CapabilitySupportedNotes
Read
Write
Subscribe

Implementation status: available ::

The frame encoder/decoder (Dlt645Frame) and serial connection (Dlt645SerialPortConnection) are fully implemented, including address BCD encoding, checksum verification, and read/write frame building.

Minimal onboarding example

  1. Create a Device using DL/T645 Driver, set port=/dev/ttyUSB0, baudRate=2400, parity=2, meterAddress=<your 12-digit address>.
  2. Add a Point (READ_ONLY) with di=02010100 (phase A voltage) and dataFormat=FLOAT.
  3. Start the driver; within 30 seconds the value appears in PointValue.

Further reading

Last updated:

Released under the AGPL-3.0 License