# WT 4.1 FW 2.0.0 Modbus TCP Communication Interface

# Introduction

Refer to the Reference section for details of the Modbus protocol.

This document describes public Modbus TCP implementation for Enapter Water Tank 4.1 and assume understanding of TCP/IP and Modbus protocols.

# Physical Interface Connection

Connect Ethernet cable to the Ethernet Port of Enapter Water Tank 4.1.

# TCP/IP Connection Settings

By default DHCP client is enabled therefore IP address will be assigned automatically by DHCP server available in the connected network.

It is recommended to set DHCP reservation based on MAC address of the water tank.

Configuration of the Static IP is possible using Enapter Cloud and Enapter Mobile Application for iOS and Android.

# Modbus TCP/IP Connection Settings

Option Value Comment
Modbus Port 502
Modbus Slave Address x Any Modbus address can be set, does not affect communication

# References

http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf (opens new window)

# Data Formats Used

Primary tables Object Type Permission Comment
Input Registers 16 bit word Read Only
Holding Registers 16 bit word Read / Write

# Data Bits/Registers Dimension

Data Type Size in Bits Registers Used Comment
Boolean 16 bits 1 register 0 value means 'false', all other cases - 'true'
Uint16 16 bits 1 register
Uint32 32 bits 2 registers
Uint64 64 bits 4 registers
Uint128 128 bits 8 registers
Float32 32 bits 2 registers IEEE 754 Single-precision floating-point
Int32 32 bits 2 registers

# Data Encoding

Big-endian, high word first data encoding used.

This means that when more than single byte (8 bits) is transmitted, network byte order is used - the most significant byte placed at lower address (sent first).

# Implemented Modbus Functions

Function Code Comment
Read Holding Registers 03
Read Input Registers 04
Write Single Holding Register 06
Write Multiple Holding Registers 16

# Set/Read Modbus IP

To set Modbus IP:

  1. Open the Cloud and navigate to your site
  2. Select WT 4.1 you want to set Modbus IP
  3. Click the Configuration menu item
  4. Click Set Ethernet IP/Mask/Gateway
  5. Enter the IP address and then click Run. (Setting the IP address to 0.0.0.0 (or 0) enables DHCP mode)
  6. Wait until command will be accepted

To read Modbus IP:

  1. Open the Cloud and navigate to your site
  2. Select WT 4.1 you want to read Modbus IP
  3. Click the Configuration menu item
  4. Click Read Ethernet IP/Mask/Gateway
  5. You can see Modbus IP in Execution Payload section

# Modbus Table

# Holding Registers (Read / Write)

Register Data Type Name Comment
0 Uint32 Set Ethernet IP Address e.g. 0xC0A80201 (192.168.2.1); 0 = DHCP enabled
2 Uint32 Set Ethernet IP Netmask Ex: 255.255.255.0
4 Uint32 Set Ethernet Gateway IP Address Ex: 192.168.2.1
6 Boolean Modbus Swap Bytes 0 = false (default); 1 = true
Check Modbus Swap Table below
Reset is required to accept changes.
7 Boolean Modbus Swap Words 0 = false (default); 1 = true
Check Modbus Swap Table below
Reset is required to accept changes.
8 Uint16 Set Ethernet IP Address 0 octet Ex: 192
9 Uint16 Set Ethernet IP Address 1 octet Ex: 168
10 Uint16 Set Ethernet IP Address 2 octet Ex: 2
11 Uint16 Set Ethernet IP Address 3 octet Ex: 1
12 Uint16 Set Ethernet Netmask 0 octet Ex: 255
13 Uint16 Set Ethernet Netmask 1 octet Ex: 255
14 Uint16 Set Ethernet Netmask 2 octet Ex: 255
15 Uint16 Set Ethernet Netmask 3 octet Ex: 0
16 Uint16 Set Ethernet Gateway IP Address 0 octet Ex: 192
17 Uint16 Set Ethernet Gateway IP Address 1 octet Ex: 168
18 Uint16 Set Ethernet Gateway IP Address 2 octet Ex: 2
19 Uint16 Set Ethernet Gateway IP Address 3 octet Ex: 1
20 Uint16 Set WT mode Write:
1 = Start;
2 = Stop;
3 = Manual ON;
4 = Manual OFF.
22 Uint16 Commands Write:
1 = Apply IP settings (entered in octet format);
2 = Enable DHCP mode;
3 = Store IP settings (entered in octet format);
4 = Reboot.

# Input Registers (Read Only)

Register Data Type Name Comment
0 Uint16 Device Model Ex: 12 => WT41
1 Uint16 Firmware MAJOR Version Ex: 2
2 Uint16 Firmware MINOR Version Ex: 0
3 Uint16 Firmware PATCH Version Ex: 1
4 Uint32 Firmware Build Number Ex: 123456
6 Uint32 Uptime Seconds
10 Uint16 WT State Read:
0 = Wait;
1 = Refilling;
2 = Water out;
3 = Refilling and water out.
11 Uint16 WT Mode Read:
0 = Initial;
1 = Maintenance;
2 = Manual;
3 = Normal;
3 = Alarm;
3 = Stop.
13 Uint16 WT Water quality Read:
0 = Not checked;
1 = Not acceptable;
2 = Acceptable;
3 = Good.
14 Uint32 WT Alerts (bit form) 32-bit value where each bit representing one type of status.
Bit number:
0 = N/A;
1 = Stop;
2 = Maintenance;
4 = Manual mode;
5 = Bad quality water input;
6 = Waiting for water;
7 = High water inlet temperature;
8 = Low water inlet temperature;
9 = Very low water level;
10 = Low water level;
11 = Very high water level (warning);
13 = Low water tank temperature;
15 = Very high water level (fatal error);
16 = Tank refilling issue;
17 = Tank temperature sensor broken;
18 = Inlet temperature sensor broken;
19 = Water level sensor broken;
21 = Current sensor broken;
22 = Water leak;
24 = Pump broken;
25 = High electronic temperature;
26 = Virtual settings reset failed;
27 = Internal error.
16 Uint32 Drain valve ON Uptime Seconds
18 Uint32 Refilling valve ON Uptime Seconds
20 Float Water level litre
22 Float Inlet water temperature Celsius
24 Float Tank water temperature Celsius
26 Float Water conductivity uS, compensated
28 Float Pump current consumption Ampere
30 Boolean Very High Water Level Switch 0 = Water level below sensor;
Any value = Water level above sensor.
31 Boolean Very Low Water Level Switch 0 = Water level below sensor;
Any value = Water level above sensor.
32 Boolean Water presence sensor 0 = Water presence sensor dry;
Any value = Water presence sensor wet.
33 Boolean Drain valve 0 = Drain valve OFF;
Any value = Drain valve ON.
34 Boolean Refilling valve 0 = Refilling valve OFF;
Any value = Refilling valve ON.
35 Boolean Pump 0 = Pump OFF;
Any value = Pump ON.
36 Boolean Start/Stop button 0 = Button released;
Any value = Button pressed.
37 Boolean Spare DI0 0 = Disabled;
Any value = Enabled.
38 Boolean Spare DI1 0 = Disabled;
Any value = Enabled.
40 Float Water level, RAW Volts
42 Float Inlet water temperature, RAW Volts
44 Float Tank water temperature, RAW Volts
46 Float Water conductivity, RAW Volts
48 Float Pump current consumption, RAW Volts
50 Float Board temperature Celsius
52 Float Internal 2.5V Reference Volts
54 Float Internal 5V Volts
56 Float Board power supply 12-24V Volts
58 Float Pump last inrush current Ampere

# Modbus Swap Table

Swap Words (Holding reg 7) Swap Bytes (Holding reg 6)
Big Endian (default) False False
Little Endian True True
Big Endian (Byte Swap) False True
Little Endian (Byte Swap) True False

Was this page useful?