This is working for me with a GS10 VFD:
/*
The format of the channel descriptors is:
{TYPE, FUNC, ADDR, COUNT, pin_name}
TYPE is one of HAL_BIT, HAL_FLOAT, HAL_S32, HAL_U32
FUNC = 1, 2, 3, 4, 5, 6, 15, 16 - Modbus commands
COUNT = number of coils/registers to read
*/
#define MAX_MSG_LEN 16 // may be increased if necessary to max 251
static const hm2_modbus_chan_descriptor_t channels = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
{HAL_U32, 3, 0x0611, 1, "error_code"},
{HAL_U32, 3, 0x2101, 1, "status"},
{HAL_FLOAT, 3, 0x2104, 1, "output-current"},
{HAL_FLOAT, 3, 0x2105, 1, "bus-voltage"},
{HAL_FLOAT, 3, 0x210C, 1, "motor-speed"},
{HAL_FLOAT, 6, 0x2001, 1, "frequency-command"},
{HAL_U32, 6, 0x2000, 1, "operation"},
};
/* Optionally #define DEBUG to aid with troubleshooting.
Use 3 to see a lot of information about the modbus
internal workings. 1 is default (errors only)
Error 11 (com timeout) might be wiring. parity, or VFD setup