Modbus commands
The modbus command set accepts a subset of the standard Modbus-TCP frames as defined in Modbus protocol Specification and MODBUS Messaging on TCP/IP Implementation Guide V1.0b
Functions 1, 4, & 5 are supported along with error codes 1, 2 & 3 should they occur. Function 01 (0x01) Read Coils This function reads back the 8 relays as coils 1-8 and also the 7 inputs as coils 9-15.
Function 04 (0x04) Read Input Registers This function reads back the 7 analogue inputs as registers 1-7 Register 8 is always zero Registers 9-24 are 16 registers representing 8 counter values. As modbus registers are 16-bits wide and the counters are 32-bit, a counter is stored in 2 16-bit registers, high word first. In the same way, the 16 registers 25-40 hold the 8 capture values.
Still working ou the full picture but you read and control the relays and inputs. Coils in the configuration are starting from 0 and not 1 as mentioned in the docs.