TapHome

Carlo Gavazzi EM340F

Modbus RTU
Submitted by
Last updated: 03. 2026
Carlo Gavazzi EM340F

The Carlo Gavazzi EM340F is a DIN rail-mounted 3-phase bidirectional energy meter with 65 A direct connection. It communicates via Modbus RTU over RS-485 and provides separate production (export) and consumption (import) energy counters per phase, making it well suited for solar and prosumer installations where energy flows in both directions.

The TapHome template reads 8 parameters covering per-phase and total energy counters for both production and consumption, plus system power demand. All values use INT32 format with a division factor of 20000 to convert from the meter’s native scaled-integer representation to kWh and kW.

Hardware connection

Power connection

The EM340 supports three system types. Choose the wiring diagram that matches your installation:

3-phase 4-wire (3Pn) — with neutral:

Carlo Gavazzi EM340 — 3-phase 4-wire wiring diagram

3-phase 3-wire (3P) — without neutral:

Carlo Gavazzi EM340 — 3-phase 3-wire wiring diagram
RS-485 wiring

The EM340 uses a 2-wire RS-485 interface with terminals A-, B+, and a dedicated T terminal for bus termination on the last instrument in the chain.

Carlo Gavazzi EM340 — RS-485 Modbus daisy chain wiring
  • A- (Data-) — connect to B-/D- on TapHome RS-485
  • B+ (Data+) — connect to A+/D+ on TapHome RS-485
  • T (Termination) — connect A- to T on the last meter in the daisy chain
ParameterValue
InterfaceRS-485, 2-wire, half-duplex
CableAWG24 balanced pair, shielded recommended, third wire for GND
Max cable length1000 m (with 1/5 unit load, signal repeater for longer distances)
Max devices on bus247
Termination120 ohm resistor at both ends of the bus; EM340 has built-in termination via A- to T jumper on last unit
TopologyDaisy chain only

Pay attention to the terminal labeling: Carlo Gavazzi uses A- for Data- and B+ for Data+. Connect A- to TapHome B-/D- and B+ to TapHome A+/D+. Swapped polarity is a common cause of communication failure.

GND should be connected to ground only on the master side. For bus connections longer than 1000 m or networks with more than 160 instruments, use a signal repeater.

Configuration

Modbus serial settings

The communication parameters are configured via the meter’s front panel parameter menu (P14–P16) or via Modbus registers:

ParameterDefault valueModbus register
Baud rate9600H:2001 (values: 1=9600, 2=19200, 3=38400, 4=57600, 5=115200)
ParityNoneH:2002 (1=none, 2=even)
Stop bits1H:2003 (0=1 stop, 1=1 stop default, 2=2 only if parity is even)
Slave address1 (range 1–247)H:2000

The TapHome template SlaveId parameter must match the configured address on the meter.

Measurement mode

The EM340F supports bidirectional measurement (PFB model), which tracks energy flow direction. In bidirectional mode:

  • Positive power values = imported (consumed) active power
  • Negative power values = exported (produced) active power
  • kWh(+) counters increase when power is imported
  • kWh(-) counters increase when power is exported

The measurement mode is set via register H:1103 (0=A, 1=B). Ensure the meter is configured for measurement mode B (bidirectional) if you need separate import/export tracking.

System type

The system configuration is set via the front panel parameter P6 (SYSEM) or register H:1002:

System typeCodeDescription
3-phase with neutral (3Pn)03-phase 4-wire system — all measurements available
3-phase without neutral (3P)13-phase 3-wire system
2-phase with neutral (2P)22-phase 3-wire system
Password

Configuration parameters are password-protected. The default password is 0000. Enter the password via the front panel (P1) or write to register H:1000 before changing settings.

Device capabilities

Production (export) energy metering

The template includes a dedicated energy meter device (ModbusElectricityMeter) for total production:

  • Total Production — reads total export active energy from register H:274 (kWh) and system power demand from register H:282 (kW), both with a ÷20000 conversion factor

Three additional sensors track per-phase production energy:

  • Production Energy L1 (kWh) — phase 1 export active energy from register H:064
  • Production Energy L2 (kWh) — phase 2 export active energy from register H:066
  • Production Energy L3 (kWh) — phase 3 export active energy from register H:068
Consumption (import) energy metering

A second energy meter device tracks total consumption:

  • Total Consumption — reads total import active energy from register H:278 (kWh) and shares the power demand register H:282 (kW) with the production meter

Three sensors track per-phase consumption energy:

  • Consumption Energy L1 (kWh) — phase 1 import active energy from register H:096
  • Consumption Energy L2 (kWh) — phase 2 import active energy from register H:098
  • Consumption Energy L3 (kWh) — phase 3 import active energy from register H:100
Data format and scaling

All registers use INT32 format with a value weight of kWh*10 (the raw value is 10 times the actual kWh). The template applies a ÷20000 divisor to the raw INT32 value, which accounts for both the ×10 scaling and an additional factor. Verify the readings against the meter’s display after installation.

The per-phase consumption registers (H:096–H:100) are documented in the communication protocol as “only ET series.” However, the TapHome template includes them for the EM340F — verify that these registers return valid data on your specific meter. If they return zero, the meter firmware may not support per-phase consumption breakdown.

Additional capabilities

The EM340 also exposes registers for per-phase voltage (L-N and L-L), current, active/apparent/reactive power, power factor, frequency, system totals, THD measurements, tariff-based energy counters (tariff 1 and tariff 2), partial energy counters (resettable), peak demand, phase sequence, and run hour meter. These can be added in a future template update.

The EM340 supports a connection check feature (parameter P7 / InbALL) that verifies correct wiring by checking voltage sequence and current signals. Enable this after installation to confirm the meter is wired correctly.

Troubleshooting

No communication via Modbus RTU
  1. Verify the RS-485 wiring polarity: EM340 A- connects to TapHome B-/D-, EM340 B+ connects to TapHome A+/D+
  2. Check the bus termination: connect A- to T on the last meter, and ensure 120 ohm termination at the TapHome end
  3. Confirm serial settings match: 9600 baud, no parity, 1 stop bit (default)
  4. Verify the slave address — TapHome SlaveId must match the meter’s address (parameter P14 / register H:2000)
  5. Check the Modbus timing: the EM340 has a 500 ms response time — ensure the master allows sufficient timeout
Energy readings show zero
  1. Check the measurement mode — register H:1103 must be set to B (bidirectional) for separate import/export tracking
  2. Verify the system type (P6 / H:1002) matches the actual wiring configuration
  3. For per-phase consumption registers (H:096–H:100): these may not be available on all EM340F firmware versions — check if the meter displays per-phase consumption on the front panel
  4. Confirm that actual load or generation is connected and the meter’s display shows non-zero values
Readings appear incorrect or scaled wrong
  1. The template uses a ÷20000 conversion. If readings are exactly 2× too high or too low, the CT/VT ratio on the meter may not be set to 1. Check registers H:1003 (CT ratio) and H:1005 (VT ratio) — both should be 10 (= 1.0) for direct connection
  2. Compare the TapHome reading with the meter’s front panel display to identify the scaling discrepancy
  3. The word order for INT32 values is LSW→MSW (low word first). If values appear garbled, verify the byte/word order configuration

The EM340 supports up to 50 registers per Modbus request. The TapHome template polls 8 devices at a 1.5-second interval, requiring minimal bus bandwidth.

Available devices

Carlo Gavazzi EM340F Module
Total Production Electricity Meter Read-only

Total export active energy (kWh) and system power demand (kW)

Register: H:274 (readtotalconsumption), H:282 (readdemand) Int32 Unit: kWh / kW numeric

Total Production

Read total consumption
MODBUSR(H, 274, Int32) / 20000
Read demand
MODBUSR(H, 282, Int32) / 20000
Production Energy L1 Variable Read-only
Register: H:064 Int32 Unit: kWh numeric

Production Energy L1

Read
MODBUSR(H, 064, Int32) / 20000
Production Energy L2 Variable Read-only
Register: H:066 Int32 Unit: kWh numeric

Production Energy L2

Read
MODBUSR(H, 066, Int32) / 20000
Production Energy L3 Variable Read-only
Register: H:068 Int32 Unit: kWh numeric

Production Energy L3

Read
MODBUSR(H, 068, Int32) / 20000
Total Consumption Electricity Meter Read-only

Total import active energy (kWh) and system power demand (kW)

Register: H:278 (readtotalconsumption), H:282 (readdemand) Int32 Unit: kWh / kW numeric

Total Consumption

Read total consumption
MODBUSR(H, 278, Int32) / 20000
Read demand
MODBUSR(H, 282, Int32) / 20000
Consumption Energy L1 Variable Read-only
Register: H:096 Int32 Unit: kWh numeric

Consumption Energy L1

Read
MODBUSR(H, 096, Int32) / 20000
Consumption Energy L2 Variable Read-only
Register: H:098 Int32 Unit: kWh numeric

Consumption Energy L2

Read
MODBUSR(H, 098, Int32) / 20000
Consumption Energy L3 Variable Read-only
Register: H:100 Int32 Unit: kWh numeric

Consumption Energy L3

Read
MODBUSR(H, 100, Int32) / 20000
Connection: Modbus RTU • 9600 baud• 8N1 • Slave ID: $[SlaveId]
Possible improvements (40)
  • H:000 V L1-N — Phase 1 line-to-neutral voltage, INT32 Volt×10
  • H:002 V L2-N — Phase 2 line-to-neutral voltage, INT32 Volt×10
  • H:004 V L3-N — Phase 3 line-to-neutral voltage, INT32 Volt×10
  • H:006 V L1-L2 — Line-to-line voltage L1-L2, INT32 Volt×10
  • H:008 V L2-L3 — Line-to-line voltage L2-L3, INT32 Volt×10
  • H:010 V L3-L1 — Line-to-line voltage L3-L1, INT32 Volt×10
  • H:012 A L1 — Phase 1 current, INT32 Ampere×1000
  • H:014 A L2 — Phase 2 current, INT32 Ampere×1000
  • H:016 A L3 — Phase 3 current, INT32 Ampere×1000
  • H:018 W L1 — Phase 1 active power, INT32 Watt×10
  • H:020 W L2 — Phase 2 active power, INT32 Watt×10
  • H:022 W L3 — Phase 3 active power, INT32 Watt×10
  • H:024 VA L1 — Phase 1 apparent power, INT32 VA×10
  • H:026 VA L2 — Phase 2 apparent power, INT32 VA×10
  • H:028 VA L3 — Phase 3 apparent power, INT32 VA×10
  • H:030 var L1 — Phase 1 reactive power, INT32 var×10
  • H:032 var L2 — Phase 2 reactive power, INT32 var×10
  • H:034 var L3 — Phase 3 reactive power, INT32 var×10
  • H:036 V L-N sys — System average line-to-neutral voltage, INT32 Volt×10
  • H:038 V L-L sys — System average line-to-line voltage, INT32 Volt×10
  • H:040 W sys — Total system active power, INT32 Watt×10
  • H:042 VA sys — Total system apparent power, INT32 VA×10
  • H:044 var sys — Total system reactive power, INT32 var×10
  • H:046 PF L1 — Phase 1 power factor, INT16 PF×1000. Negative=exported, positive=imported
  • H:047 PF L2 — Phase 2 power factor, INT16 PF×1000
  • H:048 PF L3 — Phase 3 power factor, INT16 PF×1000
  • H:049 PF sys — System power factor, INT16 PF×1000
  • H:051 Hz — Supply frequency, INT16 Hz×10
  • H:052 kWh (+) TOT — Total import active energy (from Table 2.4-1 at register 0x0034), INT32 kWh×10. Partially covered by device 0 via Table 2.6-1 register
  • H:054 kvarh (+) TOT — Total import reactive energy, INT32 kvarh×10
  • H:056 kW dmd — Power demand, INT32 Watt×10
  • H:058 kW dmd peak — Peak power demand, INT32 Watt×10
  • H:060 kWh (+) PARTIAL — Partial import active energy counter, INT32 kWh×10
  • H:062 kvarh (+) PARTIAL — Partial import reactive energy counter, INT32 kvarh×10
  • H:070 kWh (+) t1 — Tariff 1 import active energy, INT32 kWh×10
  • H:072 kWh (+) t2 — Tariff 2 import active energy, INT32 kWh×10
  • H:078 kWh (-) TOT — Total export active energy (Table 2.4-1), INT32 kWh×10. Partially covered by device 4 via Table 2.6-1 register
  • H:080 kvarh (-) TOT — Total export reactive energy, INT32 kvarh×10
  • H:086 kVAh TOT — Total apparent energy
  • H:050 Phase sequence — Phase sequence indicator: 0=L1-L2-L3, 1=L1-L3-L2. INT16

Sources