文档来源 doc/en/Modules/DAQ.ModBus.pdf
1. General description of the ModBus protocol
Protocol ModBus/RTU requires one lead(requesting) device in the line(master), which can send
commands to one or more driven devices(slave), referring to them by a unique in the line address. Syntax
of the commands of the protocol allows to address 247 devices on the one connection line of standard RS-
485(less RS-422 or RS-232). In the case of TCP addressing mode is excluded from the protocol, as it is
implemented in the TCP/IP stack.
Initiative of exchange always comes from the leading device. Slave devices listen the line. Master
request (package, the sequence of bytes) in the line and turns into a listening line. Slave device responds to
the request, which came to him.
The end of sending the response is determined by the mode. In RTU mode, the end of massage is
determined by time interval between end of receive the previous byte and start receiving following, the
time symbol. If this interval exceeds the time required to receiving one and a half bytes on a given rate of
transmission then receiving a frame response is considered complete. In ASCII mode, the criterion of end
of the message is the character '
', and in the mode of TCP — the expected size of the message,
information about which present in the packet header.
2. 6 standards commands of the ModBus protocol supported by OpenSCADA
• 0x01 — reading of the group of bits;
• 0x03 — reading of the group of registers;
• 0x05 — settig of the single bit;
• 0x06 — settig of the single register;
• 0x0F — settig of the group of bits;
• 0x10 — settig of the group of registers.
3. Combining fragments of registers(多个寄存器或线圈相邻时,通过一次读多个来节省资源和时间)
Standard functions 01-04 let to request at once multiple
adjacent registers or bits. This strategy often allows to optimize the traffic and time. However, the
required registers are not always located adjacent to each other, this option allows you to collect
them in blocks of up to 100 registers, or 1600 bits. The installing of this parameter must be
approached with caution, since not all devices support access to registers between fragments.