
Chapter 4
Document Version V3.1.0 (2020-08-18) 47
Example:
ret = modbus_write_register(ctx, 0, 0x1234);
if (ret 0)
{fprintf(stderr, “%s\n”, modbus_strerror(errno)); }
4.4 Dynamic library configuration
QD1 module will consume CPU resources for its long-time idle connection. In order
to reduce CPU load, QD1 module adopts an automatic power-saving mechanism. When
the master station does not interact with QD1 module within 60S, QD1 will automatically
disconnect from Modbus-TCP and enter the low-power mode.
After QD1 enters the low-power mode, if interaction needs to be continued,
re-establish a Modbus-TCP connection for the master station; if connection needs to be
kept, add "Heartbeat Package" function to ensure the continuity of connection. If
developed program includes read and write operations of this function, there is no need
to add "heartbeat package" function.
Heartbeat Package: A self-defined command word that periodically
informs the other party of its own status between client and server, which
is sent at a certain time interval (the time interval required by QD1 is within
60S), similar to heartbeat, so it's called heartbeat package.