TapHome

Domat R312/R313

Modbus RTU
Submitted by
Last updated: 03. 2026
Domat R312/R313

The Domat R312 (24 V AC) and R313 (230 V AC) are 8-channel triac PWM output modules designed for HVAC applications such as floor heating distribution points and thermal actuator control. The modules communicate via Modbus RTU over an optically isolated RS-485 bus. The TapHome template exposes all 8 channels as independent dimmers with 0-100% duty cycle control (0.1% resolution).

The product was previously sold as M312/M313. The current R312/R313 models have an identical register map and are fully compatible with this template.

Hardware connection

Terminal assignments
Domat R312/R313 terminal assignments and PCB layout
TerminalFunction
RS485 K+COM1 — serial link RS-485, terminal K+ (connect to A+/D+ on TapHome gateway)
RS485 K-COM1 — serial link RS-485, terminal K- (connect to B-/D- on TapHome gateway)
GPower supply 24 V AC/DC
G0Power supply 24 V AC/DC
TEOptional connection for shielding, technical ground
GD (L)Power supply for outputs
GDO (N)Power supply for outputs, common
DO1Output 1
GDO (N)Power supply for outputs, common
DO2Output 2
DO3Output 3
GDO (N)Power supply for outputs, common
DO4Output 4
DO5Output 5
GDO (N)Power supply for outputs, common
DO6Output 6
DO7Output 7
GDO (N)Power supply for outputs, common
DO8Output 8

LED indication:

LEDFunction
TxD (red)RS-485 transmitting data at COM1 (flashing: transmitting; OFF: no data traffic)
PWR (green)Power (ON: power OK; OFF: no power applied, weak or damaged power supply)

DIP switches (micro DIP switches next to RS-485 terminals):

SwitchFunction
BUS ENDBoth ON = 120 Ω bus termination; enable on the first and last device on the bus
INITIf ON at power-up, configuration parameters are reset to factory defaults
USRUser-defined in customer configuration
Wiring diagram
Domat R312 and R313 connection diagrams

The R312 requires 24 V AC for both module power (G, G0) and output power (GD, GDO). The R313 uses 24 V AC for module power and 230 V AC for output power (L, N connected to GD, GDO).

If the module is the first or last device on the RS-485 bus, enable the 120 ohm termination resistor by short-circuiting the BUS END jumper (micro DIP switches next to the RS-485 terminals).

Configuration

Setting the Modbus address

The default Modbus slave address is 1 with communication parameters 9600 baud, 8N1. To change the address or baud rate, use the ModComTool configuration software (free download from domat.cz).

Address and baud rate changes are stored in EEPROM and require a module restart to take effect.

ParameterRegisterDefaultNotes
Slave addressH:4 LSB1Range 1–247, EEPROM, restart required
Baud rateH:4 MSB13 (9600)10=1200, 11=2400, 12=4800, 13=9600, 14=19200
INIT mode (factory reset)

If the module address or baud rate is unknown, the INIT DIP switch provides a recovery method:

  1. Set the INIT DIP switch to ON
  2. Power-cycle the module
  3. The address resets to 1 and baud rate to 9600, 8N1
  4. Set the INIT DIP switch back to OFF after configuration
PWM period configuration

The PWM period is common for all 8 channels. The TapHome template sets it during import via the PWM time (ms) parameter (default: 1000 ms). The module stores the period in 100 ms units.

Typical PWM periods for floor heating applications range from 10 to 120 seconds. The default 60-second period works well for most thermal actuators.

Communication failure protection

The module supports per-channel safe state configuration in case of Modbus communication loss:

RegisterFunction
H:6 LSBEnable comm failure behavior per channel (bitmask)
H:6 MSBTarget output state on comm failure (on/off per channel)
H:7 LSBComm failure timeout in seconds (0 = disabled)

When enabled, if no Modbus communication is received within the timeout period, the module automatically sets each output to its configured safe state.

Device capabilities

PWM dimmer channels

The template provides 8 independent PWM Dimmer devices (channels 1–8), each mapped to a holding register. Each dimmer:

  • Reads and writes the duty cycle as a value 0–1000 (corresponding to 0.0%–100.0%)
  • TapHome scales the value automatically (divides by 1000 for display, multiplies by 1000 for writes)
  • The initialization script enables the channel by setting the corresponding bit in the PWM enable bitmask and configures the common PWM period

All 8 channels share the same PWM period but have independent duty cycle control, making the module suitable for multi-zone floor heating distribution.

Additional capabilities

The R312/R313 modules also expose registers for direct binary on/off output control (bypassing PWM), force-override bitmask, output status readback, error status flags, internal module temperature monitoring, and firmware version readback. These can be added in a future template update.

Troubleshooting

No Modbus communication
  1. Verify RS-485 wiring: K+ to A+/D+ and K- to B-/D- on the Modbus gateway
  2. Check that the module is powered (green PWR LED should be ON)
  3. Confirm the slave address matches the TapHome configuration — use ModComTool to verify
  4. If the address is unknown, use the INIT DIP switch to reset to address 1 / 9600 baud
  5. Check bus termination: enable BUS END on the first and last device on the bus
TxD LED not flashing

The red TxD LED flashes when the module transmits data on RS-485. If it never flashes:

  1. The module is not receiving valid Modbus requests — check the slave address
  2. Verify the baud rate matches (default 9600)
  3. Try swapping K+ and K- if polarity is reversed
Outputs not responding
  1. Verify the channel is enabled for PWM mode — the initialization script sets this automatically on first connection
  2. Check that the output power supply (GD/GDO terminals) is connected and correct voltage (24 V AC for R312, 230 V AC for R313)
  3. Check the fuse — accessible from the front of the module (F3.15A for R312, F1A for R313)
  4. Verify the minimum load current (5 mA for R312) is met — some LED loads may be below this threshold

Available devices

Domat R312/R313 Module
PWM Dimmer 1 Dimmer

Triac output channel 1 — duty cycle 0-100% with 0.1% resolution, controls thermal actuators or heating valves via PWM

Register: H:9 Int16 Unit: % numeric

PWM Dimmer 1

Initialize
MODBUSWNE(H, 8, Int16, $[PWMtimems]);MODBUSW(H, 7, Int16, MODBUSR(H, 7, Int16) | (((MODBUSR(H, 7, Int16) >> 8) | 1) << 8));
Read level
MODBUSR(H, 9, Int16)/1000
Write level
MODBUSWNE(H, 9, Int16, Le*1000)
PWM Dimmer 2 Dimmer
Register: H:10 Int16 Unit: % numeric

PWM Dimmer 2

Initialize
MODBUSWNE(H, 8, Int16, $[PWMtimems]);MODBUSW(H, 7, Int16, MODBUSR(H, 7, Int16) | (((MODBUSR(H, 7, Int16) >> 8) | 2) << 8));
Read level
MODBUSR(H, 10, Int16)/1000
Write level
MODBUSWNE(H, 10, Int16, Le*1000)
PWM Dimmer 3 Dimmer
Register: H:11 Int16 Unit: % numeric

PWM Dimmer 3

Initialize
MODBUSWNE(H, 8, Int16, $[PWMtimems]);MODBUSW(H, 7, Int16, MODBUSR(H, 7, Int16) | (((MODBUSR(H, 7, Int16) >> 8) | 4) << 8));
Read level
MODBUSR(H, 11, Int16)/1000
Write level
MODBUSWNE(H, 11, Int16, Le*1000)
PWM Dimmer 4 Dimmer
Register: H:12 Int16 Unit: % numeric

PWM Dimmer 4

Initialize
MODBUSWNE(H, 8, Int16, $[PWMtimems]);MODBUSW(H, 7, Int16, MODBUSR(H, 7, Int16) | (((MODBUSR(H, 7, Int16) >> 8) | 8) << 8));
Read level
MODBUSR(H, 12, Int16)/1000
Write level
MODBUSWNE(H, 12, Int16, Le*1000)
PWM Dimmer 5 Dimmer
Register: H:13 Int16 Unit: % numeric

PWM Dimmer 5

Initialize
MODBUSWNE(H, 8, Int16, $[PWMtimems]);MODBUSW(H, 7, Int16, MODBUSR(H, 7, Int16) | (((MODBUSR(H, 7, Int16) >> 8) | 16) << 8));
Read level
MODBUSR(H, 13, Int16)/1000
Write level
MODBUSWNE(H, 13, Int16, Le*1000)
PWM Dimmer 6 Dimmer
Register: H:14 Int16 Unit: % numeric

PWM Dimmer 6

Initialize
MODBUSWNE(H, 8, Int16, $[PWMtimems]);MODBUSW(H, 7, Int16, MODBUSR(H, 7, Int16) | (((MODBUSR(H, 7, Int16) >> 8) | 32) << 8));
Read level
MODBUSR(H, 14, Int16)/1000
Write level
MODBUSWNE(H, 14, Int16, Le*1000)
PWM Dimmer 7 Dimmer
Register: H:15 Int16 Unit: % numeric

PWM Dimmer 7

Initialize
MODBUSWNE(H, 8, Int16, $[PWMtimems]);MODBUSW(H, 7, Int16, MODBUSR(H, 7, Int16) | (((MODBUSR(H, 7, Int16) >> 8) | 64) << 8));
Read level
MODBUSR(H, 15, Int16)/1000
Write level
MODBUSWNE(H, 15, Int16, Le*1000)
PWM Dimmer 8 Dimmer
Register: H:16 Int16 Unit: % numeric

PWM Dimmer 8

Initialize
MODBUSWNE(H, 8, Int16, $[PWMtimems]);MODBUSW(H, 7, Int16, MODBUSR(H, 7, Int16) | (((MODBUSR(H, 7, Int16) >> 8) | 128) << 8));
Read level
MODBUSR(H, 16, Int16)/1000
Write level
MODBUSWNE(H, 16, Int16, Le*1000)
Connection: Modbus RTU • 9600 baud• 8N1 • Slave ID: $[SlaveId]
Possible improvements (6)
  • H:1 Digital Outputs Bitmask — Direct on/off control of outputs via bitmask (lower byte), bypassing PWM dimming
  • H:2 Digital Outputs Force Bitmask — Force output state override bitmask — forces outputs regardless of other control
  • H:3 Output Status Readback — Read actual output states as bitmask — useful for verifying output is active
  • H:4 Error Status — Module error flags — overtemperature, communication loss, etc.
  • H:5 Module Temperature — Internal module temperature for thermal monitoring
  • H:6 Firmware Version — Read-only firmware version identifier

Sources