Planning and commissioning

Wired M-Bus commissioning for heat meters

Commission wired M-Bus: unit loads, bus voltage, capacitance, primary addresses, telegram records, failure tests and checks against the meter display.

Wired M-Bus is a common wired interface on European heat, water and gas meters. EN 13757-2 covers the physical and link layers, and EN 13757-3 covers the application layer that carries the readings. The expensive commissioning fault is rarely a dead bus. It is a value that looks plausible and comes from the wrong record, such as the energy stored at last year's due date mapped as the current reading.

Download the acceptance record (.txt). Print it, or fill it in on site.

How a wired M-Bus segment works

The master sends data by switching the bus voltage. A mark (logical 1) is 24 to 42 V at the master, and a common value is 36 V. A space (logical 0) is about 12 V lower, so a 36 V master drops to 24 V. A meter replies by changing its current. At rest it draws at most 1.5 mA for each unit load. To send a space, it draws 11 to 20 mA more. The master treats a current step above 50 mA as a collision, which is what two meters answering at the same time look like (OMS TR09, sections 2.6 and 2.7).

The bus stays powered in both states, so a meter can take its communication power from the bus. Meters connect in parallel and the two wires have no polarity. Star and tree layouts are permitted. Closed rings and terminating resistors are not.

A wired M-Bus segment An M-Bus master supplies a two-wire bus. Three heat meters connect to the bus in parallel, each with its own primary address and one unit load. M-Bus master Supplies the bus and polls each meter 2400 baud M-Bus Heat meter address 1 Heat meter address 2 Heat meter address 3 Two wires, no polarity Each meter: one unit load (1.5 mA) and a unique address from 1 to 250
A wired M-Bus segment. The master supplies the bus; each meter connects in parallel and has its own primary address.

The EpiSensor ZHM M-Bus interface is a master for one meter. It has a 2 m flying lead, supports up to 1,000 m of cable to the meter and polls at 300 to 9600 baud. It sends the readings over the Zigbee mesh to the Gateway. A one-meter segment has no load budget or address conflict to solve. The record map, the display check and the failure tests below apply to it in full. For a shared segment with many meters and one master, do every step.

Inventory the segment

Record these for every meter:

  • manufacturer, model and firmware, where the meter shows it;
  • the identification number read over the bus;
  • the unit loads, from the datasheet or the label (OMS requires the number on both);
  • the primary address and baud rate;
  • the values that you need from it.

The secondary address is 8 bytes: an 8-digit BCD identification number, a 2-byte manufacturer code, a version byte and a medium byte. The identification number is often the printed serial number, but not always. TR09 also reports meters that put a different ID in the telegram header from the one they answer to. Record the ID that the master actually read.

Put planned meters in a separate column. The load budget must include them. The address check and the discovery count must not.

Check addresses

Primary addresses 1 to 250 are for meters. Many meters leave the factory at address 0, so a new bus often has several meters answering at 0. Addresses 251 and 252 are reserved. Address 253 tells the meter that it was selected by secondary address. At address 254 every meter answers, which causes a collision on any bus with more than one meter, so use it only on a single meter. At address 255 no meter answers. Two meters with the same primary address answer together, and the master sees a collision or a checksum error instead of either reply.

The address planner finds duplicates and special values in a schedule. Here it finds address 5 used twice:

Secondary addressing avoids duplicate primary addresses. The master selects one meter by its full secondary address, then reads it at address 253. A wildcard search finds unknown meters by narrowing the ID one digit at a time. TR09 gives less than 10 minutes for a small bus and up to hours for a large one. OMS requires meters to support secondary addressing, but older meters may not. Confirm it for each model before you rely on it.

Calculate electrical margins

One unit load (UL) is 1.5 mA. EN 13757-2 allows up to 4 UL per meter, and meters of 2 UL are common. Add the unit loads of every installed and planned meter. Compare the total with the rated capacity of the master.

The cable has two separate limits. The resistive limit comes from the loop resistance between the master and the farthest meter. The idle current of the whole bus through that resistance is the voltage lost before the last meter, and TR09 expects at least 24 V DC at every meter. The capacitive limit comes from the total length of all the cable on the segment, branches included. The OMS planning limits for total segment capacitance are 1,000 nF at 300 baud, 400 nF at 2400 baud and 100 nF at 9600 baud, and each meter can add up to 0.5 nF. A star layout keeps the resistive length short and makes the capacitive length long. A single line does the opposite.

TR09 recommends J-Y(St)Y 2×2×0.8 mm cable: 0.5 mm² conductors, 37 Ω/km for each conductor and 100 nF/km. The loop has two conductors, so 800 m to the farthest meter is 0.8 × 2 × 37 = 59 Ω. LiYCY 2×1.5 mm² is 13 Ω/km and 120 nF/km.

Take a plant room master rated 60 UL with a 36 V mark. It feeds 40 meters of 1 UL, with a reserve of 10 UL for planned meters. The farthest meter is 800 m out, and the branches bring the total cable to 1.2 km. The idle current is 50 × 1.5 = 75 mA. The farthest meter gets 36 − 0.075 × 59 = 31.6 V, which is 7.6 V above the 24 V target. The capacitance is 1.2 × 100 + 40 × 0.5 = 140 nF. That fails at 9600 baud and passes at 2400 baud with 260 nF spare:

TR09 table 2 agrees. With 50 meters on 0.5 mm² cable, 9600 baud reaches 1,000 m and 2400 baud reaches 2,000 m. Most segments run at 2400 baud. EN 13757-2 makes 300 baud mandatory for meters, and OMS makes both 300 and 2400 baud mandatory.

Prove discovery and identity

Set the master to the baud rate of the site. Connect one known meter, then add meters in groups of five to ten. After each group, run a scan and compare the count with the inventory.

A read starts with SND_NKE, which resets the link layer of the meter. REQ_UD2 then asks for the data, and the meter replies with an RSP_UD long frame. If a meter does not reply within 330 bit times plus 50 ms, the master sends the request again, up to two more times. At 2400 baud one attempt waits about 190 ms, so a dead meter adds about 0.6 s to each polling cycle.

Faults at this stage have typical signs:

  • The count stops increasing when you add a group. Look for a duplicate primary address or a meter left at address 0.
  • One address gives checksum or framing errors. Two meters share it.
  • A meter answers at 300 baud but not at 2400 baud. It has no automatic baud rate detection. Set it to the bus rate from the master or from the meter menu.
  • A meter answers and then goes quiet. Many battery heat meters limit the number of M-Bus readouts to save the battery, and stop answering for a period (TR09, section 2.12).
  • A whole group is missing. Find the wiring fault with the voltage, current and resistance checks in TR09 section 4.

Poll no faster than the values need. TR09 gives daily readouts for billing heat and water meters, and one-minute readouts for heat meters used in control. One read takes about 2 s per meter at 2400 baud and 8 s at 300 baud, so 40 meters at 2400 baud need at least 80 s per cycle.

When you replace a meter, record the change. The new meter has a new ID and can have a different record layout, so it needs its own record map.

Map telegram records

Each value in an RSP_UD telegram is a record. The record starts with a data information field (DIF), optional extensions (DIFE) and a value information field (VIF), followed by the data. The DIF gives the data type and length, the function (instantaneous, maximum, minimum or value during error) and the lowest bit of the storage number. The DIFE carries the rest of the storage number, the tariff and the subunit. The VIF gives the quantity, the unit and the decimal multiplier.

Two records from one heat meter show why this matters:

BytesDIFVIFValue
04 06 C5 BC 00 0032-bit integer, storage 0Energy, kWh48 325 kWh, current reading
44 06 1A 9E 00 0032-bit integer, storage 1Energy, kWh40 474 kWh, stored at the last due date

The two records have the same VIF and differ by one bit in the DIF. A point mapped as "energy in kWh" with no storage number can take either value, and both look plausible. The multiplier is a second trap. VIF 06 is kWh, VIF 07 is 10 kWh and VIF 0E is MJ, so a map that ignores the VIF is wrong by a factor of 10 or 3.6. On a combined heat and cooling meter, cooling energy is usually a second energy record with the same VIF, separated by tariff or subunit in the DIFE. The manufacturer's M-Bus telegram description tells you which.

For each value, record the unit and multiplier, the storage number, the tariff, the subunit and the function. The acceptance record has a column for each.

Check against the meter display

For a heat meter, the calculator in the meter is the reference. It uses a matched pair of temperature sensors, the flow sensor and the configured fluid properties. Read the energy, volume and temperatures on the display, and take the collected values from the same poll.

Compare at the resolution of the display. A meter that displays 48.325 MWh and sends 48 325 kWh agrees. A meter that displays whole MWh can differ from the telegram by up to 1 MWh and still be correct. Any other difference is a mapping or multiplier error. Also check what happens when a register rolls over. An 8-digit BCD register goes from 99 999 999 to 0, and the data path must record a rollover, not a reset.

A calculation from flow and temperature difference finds unit, sign and order-of-magnitude errors in the power record. Heat power is mass flow × specific heat × temperature difference. At 10 m³/h with 70 °C flow and 50 °C return, the mass flow is 10 × 977.8 ÷ 3600 = 2.716 kg/s. The power is 2.716 × 4.19 × 20 = 227.6 kW:

With a steady flow, the power record of the meter should agree to within a few per cent, because the meter uses its own density and heat capacity at the measured temperatures. A factor of 10 or 1,000 points to the VIF multiplier. A factor of 3.6 points to kWh and MJ mixed up. A negative power, or a return temperature above the flow temperature, usually means that the temperature sensors are swapped or that cooling energy is mapped as heating energy. This is a check on the data path. The approved energy register of the meter stays the value for billing.

Failure and freshness tests

Agree the tests with the site before you start, because they interrupt readings. Then do these tests:

  1. Disconnect one meter from the bus. Only that meter goes stale, and the master continues to poll the others at their normal interval.
  2. Remove power from the master for a known interval, then restore it. The cumulative totals continue from their last values, and no reading is duplicated.
  3. With a ZHM, break its link to the Gateway for a known interval. The ZHM logs up to 70,000 readings in flash. Check that the readings for the interval arrive when the link returns, with their original timestamps.
  4. Compare the date and time record of the meter (VIF 6D) with the collected timestamp, and record the offset. A stored due-date value carries the meter's clock, not the Gateway's.
  5. Check that stale values are not shown as fresh, and that each alarm clears only when good data returns.

Acceptance record

Keep one record for each segment. The downloadable template covers these fields. The examples come from the 40-meter segment above:

FieldExample
Master or interface, model and firmwareMaster rated 60 UL, 36 V mark, 2400 baud
Meter make, model, ID read over the bus and primary addressHeat meter, ID 67214018, primary address 7, 1 UL
Unit loads, far-end voltage (calculated and measured)50 UL with reserve; 31.6 V calculated, 31.2 V measured at the farthest meter
Records mapped: energy, volume, flow and return temperatureEnergy: DIF 04, VIF 06 (kWh), storage 0, tariff 0
Display comparison (meter and collected, same poll)Display 48.325 MWh, collected 48 325 kWh
Failure tests passedMeter 12 disconnected; master power off for 10 minutes
Name and date

Repeat the tests after a meter replacement, a change to the bus, or a change to the master's firmware or decoding. Continue with the wired M-Bus application guide, or build a system from the meter list.