DAM-16DI communication protocol
This product is a 16-channel digital input module supporting standard Modbus RTU commands. For detailed command construction and parsing, use the register tables in this document together with the Modbus specification.
Modbus register reference
Device (slave) address
Default slave address is 0x01; configurable range 0x01–0xF7. Supported ranges:
| Address range | Status | Description |
|---|---|---|
| 0x00 | ❌ Disabled | Non-response broadcast: master only; slaves must not use this address and do not reply. |
| 0x01~0xF7 | ✅ Available | Standard slave address; assignable to any device. |
| 0xFE | ❌ Disabled | Response broadcast: master only; slaves must not use this address. |
When using broadcast address 0xFE, connect only one device on the bus; multiple devices responding will collide.
Function codes
This module is discrete-input oriented; the following function codes are supported.
| FC | Function | Notes |
|---|---|---|
| 02 | Read discrete inputs | Read digital input state |
| 03 | Read holding registers | Read device parameters |
| 06 | Write single register | Write device parameters |
| 10 | Write multiple registers | Write multiple device parameters |
Register map
| Address (HEX) | Content | Description | Type | Modbus FC |
|---|---|---|---|---|
| 1x0000~1x000F | CH1–CH16 digital inputs | State of digital inputs CH1–CH16 | R | 0x02 |
| 4x8000 | SUK | Model number | R/S | 0x03 |
| 4x8001 | Firmware version | Decimal value with implied decimal → version (e.g. 0x0064 = 100 → V1.00) | R/W/S | 0x03,0x06 |
| 4x8002 | Slave address | Stores Modbus address; default 0x0001 | R/W/S | 0x03,0x06 |
| 4x8003 | UART parameters | Upper byte: stop/parity; lower byte: baud rate | R/W/S | 0x03,0x06 |
| 4x8004 | Watchdog | If no valid Modbus within timeout, device resets | R/W/S | 0x03,0x06 |
| 4x8005 | Auto-report DI | Digital input change auto-upload | R/W/S | 0x03,0x06 |
| 4x9000~4x900F | User string area | String format | R/W/S | 0x03,0x06,0x10 |
Registers marked S retain values across power cycles.
Modbus RTU command reference
Read digital input states
Request: 01 02 00 00 00 10 79 C6
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 02 | FC 0x02 | Read discrete inputs |
| 00 00 | Start address | First digital input address |
| 00 10 | Quantity | Input count; must not exceed max channels |
| 79 C6 | CRC16 | CRC16 over preceding bytes |
Response: 01 02 02 00 00 B9 B8
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 02 | FC 0x02 | Read discrete inputs |
| 02 | Byte count | Total data bytes returned. |
| 00 00 | Input states | Packed bits: Bit0 = first input, Bit1 = next, …; unused high bits are zero. |
| B9 B8 | CRC16 | CRC16 over preceding bytes |
Examples (slave 0x01)
TX : 01 02 00 00 00 10 79 C6
RX : 01 02 02 00 00 B9 B8 //All inputs inactive
TX : 01 02 00 00 00 10 79 C6
RX : 01 02 02 01 00 B8 28 //CH1 active; others inactive
TX : 01 02 00 00 00 10 79 C6
RX : 01 02 02 41 00 89 E8 //CH1 and CH7 active; others inactive
TX : 01 02 00 01 00 03 69 CB //Query inputs 2–4
TX : 01 02 00 03 00 05 48 09 //Query inputs 4–8
Read firmware version
Request: 01 03 80 01 00 01 FC 0A
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 03 | FC 0x03 | Read firmware version (FC 03) |
| 80 01 | Firmware register | Fixed 4x8001 |
| 00 01 | Word count | Fixed 0x0001 |
| FC 0A | CRC16 | CRC16 over preceding bytes |
Response: 01 03 02 00 64 B9 AF
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 03 | FC 0x03 | Read firmware version (FC 03) |
| 02 | Byte count | Returned byte count |
| 00 64 | Version | Decimal ÷100 → version string (0x0064 = 100 → V1.00) |
| B9 AF | CRC16 | CRC16 over preceding bytes |
Examples (slave 0x01)
TX:01 03 80 01 00 01 FC 0A
RX:01 03 02 01 2C B8 09 //0x012C = 300 =V3.00
Read slave address
Request: FE 03 80 02 00 01 18 05
| Field | Meaning | Notes |
|---|---|---|
| FE | Slave address | 0xFE: responding broadcast; applies to all slaves |
| 03 | FC 0x03 | Read holding registers (FC 03) |
| 80 02 | Address register | Fixed 4x8002 |
| 00 01 | Word count | Fixed 0x0001 |
| 18 05 | CRC16 | CRC16 over preceding bytes |
Response: FE 03 02 00 01 6D 90
| Field | Meaning | Notes |
|---|---|---|
| FE | Slave address | 0xFE: responding broadcast; applies to all slaves |
| 03 | FC 0x03 | Read holding registers (FC 03) |
| 02 | Byte count | Returned byte count |
| 00 01 | Slave addr | Current 0x0001–0x00F7 |
| 6D 90 | CRC16 | CRC16 over preceding bytes |
With 0xFE broadcast read, connect only one device to avoid bus collisions.
Examples (slave 0x01)
TX : FE 03 80 02 00 01 18 05
RX : FE 03 02 00 02 2D 91 //address:0x02
Set slave address
Request: FE 06 80 02 00 01 D4 05
| Field | Meaning | Notes |
|---|---|---|
| FE | Slave address | 0xFE: responding broadcast; applies to all slaves |
| 06 | FC 0x06 | Write single holding register (FC 06) |
| 80 02 | Address register | Fixed 4x8002 |
| 00 01 | New address | Slave address to set, range 0x0001–0x00F7 |
| D4 05 | CRC16 | CRC16 over preceding bytes |
Response: FE 06 80 02 00 01 D4 05
| Field | Meaning | Notes |
|---|---|---|
| FE | Slave address | 0xFE: responding broadcast; applies to all slaves |
| 06 | FC 0x06 | Write single holding register (FC 06) |
| 80 02 | Address register | Fixed 4x8002 |
| 00 01 | New address | Slave address to set, range 0x0001–0x00F7 |
| D4 05 | CRC16 | CRC16 over preceding bytes |
With 0xFE broadcast write, connect only one device or all devices will receive the same address.
Examples (slave 0x01)
Set address 0x01 :FE 06 80 02 00 01 D4 05
Set address 0x02 :FE 06 80 02 00 02 94 04
Set address 0x03 :FE 06 80 02 00 03 55 C4
Set UART parameters
Request: 01 06 80 03 00 05 90 09
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 06 | FC 0x06 | Write single holding register (FC 06) |
| 80 03 | UART register | Fixed 4x8003 |
| 00 05 | UART | Bits 0–7: baud rate 0 : 4800 1 : 9600 2 : 19200 3 : 38400 4 : 57600 5 : 115200 6 : 128000 7 : 256000 Bits 8–12: parity 0 : None, 1: Even parity, 2: Odd parity Bits 13–16: stop bits 0 : 1 stop bit, 1: 1.5 stop bits, 2: 2 stop bits |
| 90 09 | CRC16 | CRC16 over preceding bytes |
Response: 01 06 80 03 00 05 90 09
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 06 | FC 0x06 | Write single holding register (FC 06) |
| 80 03 | UART register | Fixed 4x8003 |
| 00 05 | UART | UART value |
| 90 09 | CRC16 | CRC16 over preceding bytes |
Examples (slave 0x01)
9600 baud, none, 1 stop :01 06 80 03 00 01 91 CA
9600 baud, even, 2 stop :01 06 80 03 00 D1 90 56
115200 baud, none, 1 stop :01 06 80 03 00 05 90 09
Set watchdog
Request: 01 06 80 04 00 0A 61 CC
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 06 | FC 0x06 | Write single holding register (FC 06) |
| 80 04 | Watchdog register | Fixed 4x8004 |
| 00 0A | Timeout / interval | 0 disables watchdog. Non-zero enables: each valid Modbus frame feeds the dog; if the interval expires without a valid frame, the firmware resets. Timeout = value × 100 ms (e.g. 0x000A → 1 s). |
| 61 CC | CRC16 | CRC16 over preceding bytes |
Response: 01 06 80 04 00 0A 61 CC
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 06 | FC 0x06 | Write single holding register (FC 06) |
| 80 04 | Watchdog register | Fixed 4x8004 |
| 00 0A | Timeout / interval | Watchdog timeout value |
| 61 CC | CRC16 | CRC16 over preceding bytes |
Examples (slave 0x01)
Watchdog 10 s :01 06 80 04 00 64 E0 20
Disable watchdog :01 06 80 04 00 00 E1 CB
Set DI auto-upload
Request: 01 06 80 05 FF 00 61 CC
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 06 | FC 0x06 | Write single holding register (FC 06) |
| 80 05 | Auto-upload register | Fixed 4x8005 |
| FF 00 | On/off | Digital inputs can auto-report on change. 0 disables; any non-zero value enables reporting when DI state changes. |
| 61 CC | CRC16 | CRC16 over preceding bytes |
Response: 01 06 80 05 FF 00 61 CC
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 06 | FC 0x06 | Write single holding register (FC 06) |
| 80 05 | Auto-upload register | Fixed 4x8005 |
| FF 00 | On/off | Digital inputs can auto-report on change. 0 disables; any non-zero value enables reporting when DI state changes. |
| 61 CC | CRC16 | CRC16 over preceding bytes |
Examples (slave 0x01)
Enable auto-upload :01 06 80 05 FF 00 61 CC
Disable auto-upload :01 06 80 05 00 00 B0 0B
Exception codes
On protocol or device errors, the slave returns an exception response:
Response: 01 85 03 02 91
| Field | Meaning | Notes |
|---|---|---|
| 01 | Slave address | 0x00: broadcast; 0x01–0xF7: slave address |
| 85 | Exception FC | Exception FC = request FC + 0x80 |
| 03 | Ex. code | Exception code |
| 02 91 | CRC16 | CRC16 over preceding bytes |
Exception codes (single byte) indicate error type. Common Modbus exceptions:
| Code | Name | Description |
|---|---|---|
| 0x01 | Illegal function | Requested function not supported. |
| 0x02 | Illegal data address | Requested data address invalid. |
| 0x03 | Illegal data value | Data value or operation not allowed. |
| 0x04 | Server device failure | Server device failure. |
| 0x05 | Acknowledge | Request accepted and being processed. |
| 0x06 | Device busy | Device busy; cannot execute now. |