Paul Le · ELV Consultant
BMS Mitsubishi · Tích hợp hệ thốngBMS Mitsubishi · System integration

Đồng hồ điện Modbus vào BMSModbus power meters into the BMS

Phần lớn lỗi khi đưa đồng hồ điện lên BMS không nằm ở phần mềm mà ở 4 thông số: địa chỉ, baudrate, parity và register map. Bài này đi qua từng thông số, cách đấu trục RS-485 về DCM 9000 và cách kiểm tra số đọc trước khi nghiệm thu.Most failures when bringing power meters onto a BMS are not software problems but four settings: address, baud rate, parity and the register map. This post walks through each one, how to wire the RS-485 trunk to a DCM 9000, and how to check readings before handover.

THỨ SÁU · 27/11/2026FRIDAY · 27 NOV 2026Paul Le · DHP
Modbus RTUModbus TCPĐồng hồ điệnRS-485DCM 9000Niagara 4Đo đếm năng lượngDiamond Controls
Đồng hồ điện gắn tường, ảnh đen trắng
Photo: Jon Moore / Unsplash

Sơ đồ nguyên lýSchematic diagram

Vuốt ngang để xem toàn bộ sơ đồSwipe sideways to see the full diagram
Niagara 4 SupervisorHistory 15 min · energy reports · alarms ICONICS GENESIS (BEMS)kWh per tenant / per system · Law 77/2025 energy balance DCM 9000Niagara 4.13+ · Modbus driver included2× isolated RS-485 (bias / termination)Licence counts devices: 1 meter = 1 BMS switchMeter VLANStatic IP per meter MSB main metersModbus TCPUnit ID per manual Meter ID 1MSB-1 outgoing Meter ID 2DB chiller Meter ID 3DB AHU Meter ID 1DB tenant L2 Meter ID 2DB tenant L3 Meter ID 3DB lighting Up to 32 unit loads per trunk without repeater · daisy-chain, no stubs · shield earthed at one point Serial settings: same on the whole trunkAddress 1–247, unique per trunk (0 = broadcast)Baud 9600 or 19200 · Modbus default 8E1No parity: 2 stop bits (8N2)≤ 1,000 m at 9,600 bps, termination both ends Register map checksManual 40001 = PDU address 0 (offset 1)FC 03 holding / FC 04 input registersfloat32 / int32 = 2 registers: check word order≤ 125 registers per read request MANAGEMENT LEVEL BACnet/IP · Niagara Fox (TLS) AUTOMATION LEVEL GbE Modbus TCP :502 COM1 · Modbus RTU · 19200 8E1 COM2 · Modbus RTU · 9600 8E1 FIELD LEVEL · RS-485
SĐNL đo đếm điện năng: đồng hồ tủ tổng qua Modbus TCP, đồng hồ tủ nhánh trên 2 trục Modbus RTU về 2 cổng RS-485 cách ly của DCM 9000, dữ liệu lên Niagara 4 Supervisor và ICONICS GENESIS. Thông số controller theo catalog Mitsubishi Electric Asia, thông số Modbus theo spec Modbus Organization.Energy metering schematic: main switchboard meters over Modbus TCP, sub-board meters on two Modbus RTU trunks into the two isolated RS-485 ports of a DCM 9000, data up to Niagara 4 Supervisor and ICONICS GENESIS. Controller ratings per Mitsubishi Electric Asia catalogue, Modbus figures per the Modbus Organization specifications.

Vấn đềThe problem

Đồng hồ điện thường do nhà thầu điện mua và lắp, còn nhà thầu BMS chỉ nhận về một sợi cáp RS-485. Đến lúc chạy thử, Niagara báo timeout, hoặc đọc được nhưng kW ra số 0, số âm, hoặc lớn gấp 65.536 lần thực tế. Nguyên nhân gần như luôn là một trong 4 thứ: hai đồng hồ trùng địa chỉ, baudrate hoặc parity không khớp, đọc lệch một thanh ghi, hoặc ghép sai thứ tự 2 word của số 32 bit.

Từ 01/01/2026, Luật 77/2025/QH15 yêu cầu cơ sở sử dụng năng lượng trọng điểm duy trì hệ thống đo đếm đạt chuẩn. Số liệu kWh sai trên BMS thì báo cáo cân bằng năng lượng cũng sai.

Power meters are usually bought and installed by the electrical contractor; the BMS contractor receives one RS-485 cable. At commissioning Niagara reports timeouts, or it reads values but kW shows zero, a negative number, or 65,536 times the real value. The cause is almost always one of four things: two meters on the same address, a baud rate or parity mismatch, reading one register off, or the two words of a 32-bit value joined in the wrong order.

From 1 January 2026, Law 77/2025/QH15 requires designated energy users to keep compliant metering. Wrong kWh on the BMS means a wrong energy balance report.

Giải phápSolution

Chốt thông số Modbus trong hồ sơ thiết kế, trước khi nhà thầu điện đặt hàng đồng hồ:

  • Đồng hồ tủ tổng (MSB): chọn loại có Ethernet, đọc Modbus TCP cổng 502 qua switch BMS, IP tĩnh trên VLAN riêng.
  • Đồng hồ tủ nhánh: Modbus RTU, đi daisy-chain về cổng RS-485 cách ly của DCM 9000. DCM 9000 có 2 cổng, mỗi cổng là một trục độc lập, nên chia theo khu vực hoặc theo baudrate.
  • Địa chỉ: 1 đến 247, không trùng trong một trục. Hai trục khác nhau được phép dùng lại địa chỉ.
  • Khung truyền: cả trục cùng một baudrate và parity. Mặc định của spec Modbus là 19200 bps, 8 bit dữ liệu, parity chẵn, 1 stop bit (8E1).
  • Register map: lấy từ manual đúng model và đúng firmware đồng hồ, ghi vào point schedule cùng mã chức năng, kiểu dữ liệu và hệ số nhân.

Trên Niagara, driver Modbus đã có sẵn trong license DCM-9005 đến DCM-9200. Mỗi đồng hồ tính là 1 thiết bị trong license.

Fix the Modbus parameters in the design documents, before the electrical contractor orders meters:

  • Main switchboard (MSB) meters: pick models with Ethernet, read over Modbus TCP port 502 through the BMS switch, static IP on a dedicated VLAN.
  • Sub-board meters: Modbus RTU, daisy-chained to an isolated RS-485 port on the DCM 9000. The DCM 9000 has 2 ports, each an independent trunk, so split by area or by baud rate.
  • Address: 1 to 247, unique within one trunk. Two different trunks may reuse addresses.
  • Framing: the whole trunk shares one baud rate and parity. The Modbus specification default is 19200 bps, 8 data bits, even parity, 1 stop bit (8E1).
  • Register map: taken from the manual for the exact meter model and firmware, written into the point schedule with function code, data type and scale factor.

On Niagara, the Modbus driver is included in licences DCM-9005 to DCM-9200. Each meter counts as 1 device against the licence.

Phân tích kỹ thuậtEngineering notes

  • Lệch 1 thanh ghi: manual nhiều hãng ghi theo kiểu 4xxxx, trong đó 40001 tương ứng địa chỉ PDU 0. Nếu nhập 40001 hoặc 1 vào chỗ cần địa chỉ 0, giá trị đọc về là nửa sau của số này ghép với nửa đầu của số kế tiếp. Kiểm tra manual ghi địa chỉ theo kiểu nào trước khi nhập.
  • Số 32 bit: float32 hoặc int32 chiếm 2 thanh ghi 16 bit. Thứ tự word (ABCD hoặc CDAB) mỗi hãng một kiểu. Sai thứ tự thì kW ra số vô nghĩa dù kết nối vẫn tốt.
  • Mã chức năng: FC 03 đọc holding register, FC 04 đọc input register. Đồng hồ chỉ hỗ trợ một trong hai thì đọc sai mã sẽ nhận exception.
  • Gom thanh ghi liền kề: một lệnh đọc tối đa 125 thanh ghi. Ở 9600 bps, mỗi ký tự 11 bit, đường truyền chỉ chuyển khoảng 870 byte mỗi giây, nên đọc 30 thanh ghi liền nhau trong 1 lệnh nhanh hơn nhiều so với 30 lệnh lẻ.
  • Vật lý RS-485: tối đa 32 tải đơn vị mỗi trục khi không có repeater, chiều dài tới 1.000 m ở 9600 bps với cáp AWG26 trở lên, điện trở cuối ở 2 đầu trục (spec Modbus nêu 150 Ω), chống nhiễu nối đất 1 điểm, không đi nhánh rẽ. Cổng RS-485 của DCM 9000 chọn được bias và termination, nên đầu trục phía controller bật ngay trên cổng.
  • Không parity: nếu đồng hồ đặt None thì phải dùng 2 stop bit (8N2) để giữ khung 11 bit. Nhiều trục lỗi chập chờn vì để 8N1.
  • One register off: many manuals list registers in 4xxxx style, where 40001 maps to PDU address 0. Entering 40001 or 1 where address 0 is expected returns the second half of one value joined to the first half of the next. Check which convention the manual uses before entering points.
  • 32-bit values: float32 or int32 spans two 16-bit registers. Word order (ABCD or CDAB) varies by manufacturer. Wrong order gives nonsense kW even with a healthy link.
  • Function codes: FC 03 reads holding registers, FC 04 reads input registers. A meter that supports only one returns an exception for the other.
  • Group adjacent registers: one read request carries up to 125 registers. At 9600 bps with 11-bit characters the line moves roughly 870 bytes per second, so reading 30 adjacent registers in one request is far faster than 30 single reads.
  • RS-485 physical layer: up to 32 unit loads per trunk without a repeater, up to 1,000 m at 9600 bps on AWG26 or heavier cable, termination at both ends (the Modbus specification gives 150 Ω), shield earthed at one point, no stubs. The DCM 9000 RS-485 ports have selectable bias and termination, so the controller end is set on the port itself.
  • No parity: a meter set to None needs 2 stop bits (8N2) to keep the 11-bit frame. Many flaky trunks are simply left at 8N1.

Ứng dụngWhere it fits

  • Văn phòng cho thuê: đồng hồ theo tầng hoặc theo khách thuê, ICONICS GENESIS xuất kWh từng khách thuê theo tháng.
  • Cơ sở sử dụng năng lượng trọng điểm: đo tổng và đo theo hệ thống (chiller, AHU, chiếu sáng) làm số liệu cho cân bằng năng lượng theo Luật 77/2025/QH15.
  • Công trình xanh: đo phụ tải lớn, ghi history 15 phút trên Niagara, đáp ứng yêu cầu đo đếm của LEED, EDGE, LOTUS.
  • Cải tạo tòa nhà cũ: đồng hồ có sẵn cổng RS-485 chỉ cần kéo trục về DCM 9000, không phải thay đồng hồ, miễn có manual register map.
  • Leased offices: meters per floor or per tenant, ICONICS GENESIS exports monthly kWh per tenant.
  • Designated energy users: main and per-system metering (chiller, AHU, lighting) as input to the energy balance under Law 77/2025/QH15.
  • Green buildings: sub-meter major loads, 15-minute history on Niagara, meeting LEED, EDGE and LOTUS metering requirements.
  • Retrofits: existing meters with an RS-485 port only need a trunk run to the DCM 9000, no meter replacement, as long as the register map manual is available.

Phiếu chạy thử từng đồng hồ ModbusCommissioning sheet per Modbus meter

Thông số / ParameterGiá trị đặt / SettingCách kiểm tra / Check
Địa chỉ / Address1–247, không trùng trong trục / unique per trunkPing từng ID trên Niagara / poll each ID
Baudrate9600 hoặc 19200, cả trục giống nhau / same on trunkĐọc lại trên màn hình đồng hồ / read back on meter display
Parity, stop bit8E1 (mặc định Modbus) hoặc 8N2Không còn lỗi CRC trên driver / no CRC errors
Địa chỉ thanh ghi / RegisterPDU = số trong manual trừ offset / manual number minus offsetSo kW, V, A với màn hình đồng hồ / compare with display
Kiểu dữ liệu / Data typefloat32 hoặc int32, 2 thanh ghi, thứ tự word / word orderGiá trị hợp lý, không nhảy 65.536 lần / sane values
Hệ số / ScaleTheo manual (×1, ×0,1, ×0,01) / per manualkWh Niagara khớp kWh đồng hồ / kWh matches
Điện trở cuối / Termination2 đầu trục / both trunk endsĐo khoảng 75 Ω giữa A và B khi tắt nguồn / ~75 Ω A to B, power off
NguồnSources
  1. Mitsubishi Electric Asia, Diamond Controls catalogue (2023)
  2. Mitsubishi Electric Vietnam, Building Management System
  3. Modbus Organization, MODBUS over Serial Line Specification and Implementation Guide V1.02
  4. Modbus Organization, MODBUS Application Protocol Specification V1.1b3
  5. LuatVietnam, Luật 77/2025/QH15 sửa đổi Luật Sử dụng năng lượng tiết kiệm và hiệu quả