Modbus Protocol Specification

Figure 7 Field Contents on Modbus Plus

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

Figure 7 Field Contents on Modbus Plus
2.2 Function Codes
The listing below shows the function codes supported by Modicon controllers. Codes are listed
in decimal; Y indicates that the function is supported, and N indicates that it is not supported. (4 of 36) [1/11/2000 10:41:04 PM]

2.2.1 01 Read Coil Status
Reads the ON / OFF status of discrete outputs (0x references, coils) in the slave. Broadcast is
not supported. The maximum parameters supported by various controller models are listed on
page .
The query message specifies the starting coil and quantity of coils to be read. Coils are
addressed starting at zero-coils 1 ... 16 are addressed as 0 ... 15.
Here is an example of a query to read coils 20 ... 56 from slave device 17: (5 of 36) [1/11/2000 10:41:04 PM]

The coil status in the response message is packed as one coil per bit of the data field. Status is
indicated as: 1 = ON; 0 = OFF. The LSB of the first data byte contains the coil addressed in the
query. The other coils follow toward the high order end of this byte, and from low order to high
order in subsequent bytes.
If the returned coil quantity is not a multiple of eight, the remaining bits in the final data byte
will be padded with zeros (toward the high order end of the byte). The Byte Count field
specifies the quantity of complete bytes of data.
Here is an example of a response to the query:
The status of coils 27 ... 20 is shown as the byte value CD hex, or binary 1100 1101. Coil 27 is
the MSB of this byte, and coil 20 is the LSB. Left to right, the status of coils 27 ... 20 is
By convention, bits within a byte are shown with the MSB to the left, and the LSB to the right.
Thus the coils in the first byte are 27 ... 20, from left to right. The next byte has coils 35 ... 28,
left to right. As the bits are transmitted serially, they flow from LSB to MSB: 20 . . . 27, 28 . . .
35, and so on.
In the last data byte, the status of coils 56 ... 52 is shown as the byte value 1B hex, or binary
0001 1011. Coil 56 is in the fourth bit position from the left, and coil 52 is the LSB of this byte. (6 of 36) [1/11/2000 10:41:04 PM]

The status of coils 56 ... 52 is: ON-ON-OFF-ON-ON.

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   10   ...   35

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

    Quê hương