Select Modbus Framing Type(RTU or TCP)
The library supports two modes of Modbus communication,
Modbus RTU and Modbus TCP. This can be set at compile time by setting
the value of the MODBUS_MODE macro.
a) Open file
b) Locate the definition
of macro MODBUS_MODE
c) To configure the
library to run in Modbus TCP mode, change the above macro's value to MODBUS_TCP.
To set it to Modbus RTU mode, change the macro's value to MODBUS_RTU.
The modified line should look like this:
MODBUS_MODE MODBUS_TCP /* for TCP communications */
MODBUS_MODE MODBUS_RTU /* for RTU communications */
d) Rebuild your project
Since this is a compile time setting, the mode cannot be changed
dynamically at run time.
Only one Modbus mode can be enabled at a time.
Back to Index