Modbus Protocol Specification


 The Query-Response Cycle Figure 2 Master-Slave Query-Response Cycle



tải về 0.61 Mb.
Chế độ xem pdf
trang3/35
Chuyển đổi dữ liệu14.05.2023
Kích0.61 Mb.
#54683
1   2   3   4   5   6   7   8   9   ...   35
modbus protocol

1.1.3 The Query-Response Cycle
Figure 2 Master-Slave Query-Response Cycle
The Query
The function code in the query tells the addressed slave device what kind of action to perform.
The data bytes contain any additional information that the slave will need to perform the
function. For example, function code 03 will query the slave to read holding registers and
respond with their contents. The data field must contain the information telling the slave which
Modbus Protocol
http://www.modicon.com/techpubs/intr7.html (3 of 5) [1/11/2000 10:36:08 PM]


register to start at and how many registers to read. The error check field provides a method for
the slave to validate the integrity of the message contents.
The Response
If the slave makes a normal response, the function code in the response is an echo of the
function code in the query. The data bytes contain the data collected by the slave, such as
register values or status. If an error occurs, the function code is modified to indicate that the
response is an error response, and the data bytes contain a code that describes the error. The
error check field allows the master to confirm that the message contents are valid.
1.2 Two Serial Transmission Modes
Controllers can be setup to communicate on standard Modbus networks using either of two
transmission modes: ASCII or RTU. Users select the desired mode, along with the serial port
communication parameters (baud rate, parity mode, etc), during configuration of each
controller. The mode and serial parameters must be the same for all devices on a Modbus
network.
The selection of ASCII or RTU mode pertains only to standard Modbus networks. It defines the
bit contents of message fields transmitted serially on those networks. It determines how
information will be packed into the message fields and decoded.
On other networks like MAP and Modbus Plus, Modbus messages are placed into frames that
are not related to serial tranasmission. For example, a request to read holding registers can be
handled between two controllers on Modbus Plus without regard to the current setup of either
controller's serial Modbus port.
1.2.1 ASCII Mode
When controllers are setup to communicate on a Modbus network using ASCII (American
Standard Code for Information Interchange) mode, each eight-bit byte in a message is sent as
two ASCII characters. The main advantage of this mode is that it allows time intervals of up to
one second to occur between characters without causing an error.
Coding System
V Hexadecimal, ASCII characters 0 ... 9, A ... F
V One hexadecimal character contained in each ASCII character of the message
Bits per Byte
V 1 start bit
V 7 data bits, least significant bit sent first
V 1 bit for even / odd parity-no bit for no parity
V 1 stop bit if parity is used-2 bits if no parity

tải về 0.61 Mb.

Chia sẻ với bạn bè của bạn:
1   2   3   4   5   6   7   8   9   ...   35




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương