还有在mbconfig.h下面配置为TCP方式
/*! \brief If Modbus ASCII support is enabled. */
#define MB_ASCII_ENABLED ( 0 )
/*! \brief If Modbus RTU support is enabled. */
#define MB_RTU_ENABLED ( 0 )
/*! \brief If Modbus TCP support is enabled. */
#define MB_TCP_ENABLED ( 1 )