Modbus Protocol Specification



tải về 0.61 Mb.
Chế độ xem pdf
trang6/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

Query
Response
http://www.modicon.com/techpubs/dcon7.html (2 of 36) [1/11/2000 10:41:03 PM]


The master query is a Read Holding Registers request to slave device address 06. The message
requests data from three holding registers, 40108 ... 40110.
Note: The message specifies the starting register address as 0107 (006B hex).
The slave response echoes the function code, indicating this is a normal response. The Byte
Count field specifies how many eight-bit data items are being returned. It shows the count of
eight-bit bytes to follow in the data, for either ASCII or RTU. With ASCII, this value is half the
actual count of ASCII characters in the data. In ASCII, each four-bit hexadecimal value requires
one ASCII character, therefore two ASCII characters must follow in the message to contain
each eight-bit data item.
For example, the value 63 hex is sent as one eight-bit byte in RTU mode (01100011). The same
value sent in ASCII mode requires two bytes, for ASCII 6 (0110110) and 3 (0110011). The
Byte Count field counts this data as one eight-bit item, regardless of the character framing
method (ASCII or RTU).
How to Use the Byte Count Field
When you construct responses in buffers, use a Byte Count value that equals the count of
eight-bit bytes in your message data. The value is exclusive of all other field contents, including
the Byte Count field.
2.1.3 Field Contents on Modbus Plus
Modbus messages sent on Modbus Plus networks are imbedded into the Logical Link Control
(LLC) level frame. Modbus message fields consist of eight-bit bytes, similar to those used with
RTU framing.
http://www.modicon.com/techpubs/dcon7.html (3 of 36) [1/11/2000 10:41:04 PM]


The Slave Address field is converted to a Modbus Plus routing path by the sending device. The
CRC field is not sent in the Modbus message, because it would be redundant to the CRC check
performed at the High-level Data Link Control (HDLC) level.
The rest of the message remains as in the standard serial format. The application software (e.g.,
MSTR blocks in controllers, or Modcom III in hosts) handles the framing of the message into a
network packet.
Figure 7 shows how a Read Holding Registers query would be imbedded into a frame for
Modbus Plus transmission.

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