beautypg.com

ProSoft Technology MVI94-MCM-MHI User Manual

Page 92

background image

Reference

MVI94-MCM ♦ Flex I/O Platform

User Manual

Serial Communications Modbus Communication Module

Page 92 of 109

ProSoft Technology, Inc.

March 29, 2011

5.4.10 Modbus Exception Responses

When a Modbus Master sends a request to a Slave device, it expects a normal

response. One of four possible events can occur from the Master's query:
If the server device receives the request without a communication error, and

can handle the query normally, it returns a normal response.

If the server does not receive the request due to a communication error, no

response is returned. The Master program will eventually process a timeout

condition for the request.

If the server receives the request, but detects a communication error (parity,

LRC, CRC, ...), no response is returned. The Master program will eventually

process a timeout condition for the request.

If the server receives the request without a communication error, but cannot

handle it (for example, if the request is to read a non-existent output or

register), the server will return an exception response informing the Master of

the nature of the error.

The exception response message has two fields that differentiate it from a

normal response:
Function Code Field: In a normal response, the server echoes the function

code of the original request in the function code field of the response. All function

codes have a most-significant bit (MSB) of 0 (their values are all below 80

hexadecimal). In an exception response, the server sets the MSB of the function

code to 1. This makes the function code value in an exception response exactly

80 hexadecimal higher than the value would be for a normal response.
With the function code's MSB set, the Master's application program can

recognize the exception response and can examine the data field for the

exception code.

This manual is related to the following products: