Modbus Protocol Specification



tải về 0.61 Mb.
Chế độ xem pdf
trang11/35
Chuyển đổi dữ liệu14.05.2023
Kích0.61 Mb.
#54683
1   ...   7   8   9   10   11   12   13   14   ...   35
modbus protocol

2.2.7 07 Read Exception Status
Reads the contents of eight Exception Status coils within the slave controller. Certain coils have
predefined assignments in the various controllers. Other coils can be programmed by the user to
hold information about the contoller's status-e.g., machine ON/OFF, heads retracted, safeties
satisfied, error conditions exist, or other user-defined flags. Broadcast is not supported.
The function provides a simple method for accessing this information, because the Exception
Coil references are known (no coil reference is needed in the function). The predefined
Exception Coil assignments are:
Query
Here is an example of a request to read the exception status in slave device 17:
http://www.modicon.com/techpubs/dcon7.html (12 of 36) [1/11/2000 10:41:04 PM]


Response
The normal response contains the status of the eight Exception Status coils. The coils are
packed into one data byte, with one bit per coil. The status of the lowest coil reference is
contained in the least significant bit of the byte.
Here is an example of a response to the query:
In this example, the coil data is 6D hex (0110 1101 binary). Left to right, the coils are
OFF-ON-ON-OFF-ON-ON-OFF-ON. The status is shown from the highest to the lowest
addressed coil.
If the controller is a 984, these bits are the status of coils 8 ... 1. If the controller is a 484, these
bits are the status of coils 264 ... 257. In this example, coil 257 is ON, indicating that the
controller's batteries are OK.
2.2.8 11 (0B Hex) Fetch Comm Event Counter
Returns a status word and an event count from the slave's communications event counter. By
fetching the current count before and after a series of messages, a master can determine whether
the messages were handled normally by the slave. Broadcast is not supported.
The controller's event counter is incremented once for each successful message completion. It is
not incremented for exception responses, poll commands, or fetch event counter commands.
The event counter can be reset by means of the Diagnostics function (code 08), with a
subfunction of Restart Communications Option (code 00 01) or Clear Counters and Diagnostic
Register (code 00 0A).
Query
Here is an example of a request to fetch the communications event counter in slave device 17:
http://www.modicon.com/techpubs/dcon7.html (13 of 36) [1/11/2000 10:41:04 PM]


Response
The normal response contains a two-byte status word, and a two-byte event count. The status
word will be all ones (FF FF hex) if a previously issued program command is still being
processed by the slave (a busy condition exists). Otherwise, the status word will be all zeros.
Here is an example of a response to the query:
In this example, the status word is FF FF hex, indicating that a program function is still in
progress in the slave. The event count shows that 264 (01 08 hex) events have been counted by
the controller.

tải về 0.61 Mb.

Chia sẻ với bạn bè của bạn:
1   ...   7   8   9   10   11   12   13   14   ...   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