Changes

3,170 bytes added ,  19:35, 7 December 2021
added Modbus protocol and default configuration
Line 14: Line 14:     
There is Chinese software to configure the MAC address, IP address, Modbus baud-rate, etc.
 
There is Chinese software to configure the MAC address, IP address, Modbus baud-rate, etc.
 +
 +
== Configuration ==
 +
 +
{| class="wikitable"
 +
! Setting
 +
! Default Value
 +
|-
 +
| Mode
 +
| TCP Service
 +
|-
 +
| Destination Port
 +
| 5000
 +
|-
 +
| Local Port
 +
| 5000
 +
|-
 +
| Implementer Name
 +
| HHC-N8I8OP
 +
|-
 +
| Input Mode
 +
| Ordinary
 +
|-
 +
| Automatic acquisition of IP
 +
| off
 +
|-
 +
| Power-off preservation
 +
| off
 +
|-
 +
| Local IP
 +
| 192.168.0.105
 +
|-
 +
| Subnet Mask
 +
| 255.255.255.0
 +
|-
 +
| Gateway
 +
| 192.168.0.1
 +
|-
 +
| Destination IP
 +
| 192.168.0.101
 +
|-
 +
| MAC Address
 +
| 485300575500
 +
|-
 +
| Domain Name
 +
|
 +
|-
 +
| Serial Baud Rate
 +
| 9600
 +
|-
 +
| Serial Parity
 +
| none
 +
|-
 +
| Serial Data Bits
 +
| 8
 +
|-
 +
| Serial Stop Bits
 +
| 1
 +
|-
 +
| Modbus TCP
 +
| off
 +
|-
 +
| Heartbeat Time Interval
 +
| 0 seconds
 +
|-
 +
| Heartbeat Content
 +
| HHC-N8I8OP
 +
|-
 +
| Heartbeat Detection Time
 +
| 0 seconds
 +
|-
 +
| Boot Firmware Version:
 +
| HHC-N8O8OP-V1.2-V00002
 +
|-
 +
| App Firmware Version:
 +
| 20201231-VS0003
 +
|}
 +
 +
== Modbus ==
 +
 +
=== Modbus TCP ===
 +
 +
By default the device has a simplistic non-Modbus plaintext "console style" protocol for querying the device. If you enable Modbus TCP mode via the configuration software, you can connect (using the same port) with Modbus TCP capable software.
 +
 +
=== Coils ===
 +
 +
The table below applies to the following Modbus function codes:
 +
 +
* Function 01: Read Coils
 +
* Function 05: Write Single Coil
 +
 +
The following appears to be unsupported:
 +
 +
* Function 15: Write Multiple Coils
 +
 +
{| class="wikitable"
 +
! Address (dec)
 +
! Description
 +
|-
 +
| 16
 +
| Relay #1
 +
|-
 +
| 17
 +
| Relay #2
 +
|-
 +
| 18
 +
| Relay #3
 +
|-
 +
| 19
 +
| Relay #4
 +
|-
 +
| 20
 +
| Relay #5
 +
|-
 +
| 21
 +
| Relay #6
 +
|-
 +
| 22
 +
| Relay #7
 +
|-
 +
| 23
 +
| Relay #8
 +
|}
 +
 +
Attempting to read addresses 0-15 or 24-128 will not give a response. Reading addresses 16-23 is known to work, though it's possible there are more valid ranges further out in the address space.
 +
 +
Attempting to write addresses 256-280 will not give a response. Writing addresses 0-255 are known to work, but only the range 16-23 has an understood purpose at the moment.
 +
 +
=== Discrete Inputs ===
 +
 +
* Function 02: Read Discrete Inputs
 +
 +
{| class="wikitable"
 +
! Address (dec)
 +
! Description
 +
|-
 +
| 32
 +
| Input #1
 +
|-
 +
| 33
 +
| Input #2
 +
|-
 +
| 34
 +
| Input #3
 +
|-
 +
| 35
 +
| Input #4
 +
|-
 +
| 36
 +
| Input #5
 +
|-
 +
| 37
 +
| Input #6
 +
|-
 +
| 38
 +
| Input #7
 +
|-
 +
| 39
 +
| Input #8
 +
|}
 +
 +
The value returned is whether or not a logic high (+5V) is present on the input. The "+5V" and "COM" (GND / 0V) pins must be powered externally.
 +
 +
NOTE: A pulse (to +5V) on Input #9 is an override to turn all relays on along with a red LED, until a pulse (to +5V) on Input #10 turns them all off.
 +
 +
Attempting to read addresses 0-31 or 256-999 will not give a response. Reading addresses 32-255 is known to work, though it's possible there are more valid ranges further out in the address space.
 +
 +
=== Holding Registers ===
 +
 +
* Function 03: Read Holding Registers
 +
* Function 06: Write Single Register
 +
* Function 16: Write Multiple Registers
 +
 +
Attempting to read addresses 0-330 doesn't work, but more of the address space will need to be explored.
 +
 +
Attempting to write addresses 0-140 doesn't work, but more of the address space will need to be explored.
 +
 +
=== Input Registers ===
 +
 +
* Function 04: Read Input Registers
 +
 +
Attempting to read addresses 0-140 doesn't work, but more of the address space will need to be explored.
    
== Factory Reset Button ==
 
== Factory Reset Button ==