
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:

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

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.

- 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
| Parameter | Value |
|---|---|
| Interface | RS-485, 2-wire, half-duplex |
| Cable | AWG24 balanced pair, shielded recommended, third wire for GND |
| Max cable length | 1000 m (with 1/5 unit load, signal repeater for longer distances) |
| Max devices on bus | 247 |
| Termination | 120 ohm resistor at both ends of the bus; EM340 has built-in termination via A- to T jumper on last unit |
| Topology | Daisy 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:
| Parameter | Default value | Modbus register |
|---|---|---|
| Baud rate | 9600 | H:2001 (values: 1=9600, 2=19200, 3=38400, 4=57600, 5=115200) |
| Parity | None | H:2002 (1=none, 2=even) |
| Stop bits | 1 | H:2003 (0=1 stop, 1=1 stop default, 2=2 only if parity is even) |
| Slave address | 1 (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 type | Code | Description |
|---|---|---|
| 3-phase with neutral (3Pn) | 0 | 3-phase 4-wire system — all measurements available |
| 3-phase without neutral (3P) | 1 | 3-phase 3-wire system |
| 2-phase with neutral (2P) | 2 | 2-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
- Verify the RS-485 wiring polarity: EM340 A- connects to TapHome B-/D-, EM340 B+ connects to TapHome A+/D+
- Check the bus termination: connect A- to T on the last meter, and ensure 120 ohm termination at the TapHome end
- Confirm serial settings match: 9600 baud, no parity, 1 stop bit (default)
- Verify the slave address — TapHome
SlaveIdmust match the meter’s address (parameter P14 / register H:2000) - Check the Modbus timing: the EM340 has a 500 ms response time — ensure the master allows sufficient timeout
Energy readings show zero
- Check the measurement mode — register H:1103 must be set to B (bidirectional) for separate import/export tracking
- Verify the system type (P6 / H:1002) matches the actual wiring configuration
- 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
- Confirm that actual load or generation is connected and the meter’s display shows non-zero values
Readings appear incorrect or scaled wrong
- 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
- Compare the TapHome reading with the meter’s front panel display to identify the scaling discrepancy
- 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.