
IE-SNC-T43(4)11-02
13
Exception Responses
After sending query to the transducer, master device waits for normal response. After master device
query one of the following events can occur:
1.
If transducer receives a query without communication error and query is possible to process,
master device receives response.
2.
If transducer does not receive all queries due to communication error, no response is sent. Main
program is able to process condition of exceeding of time for query.
3.
If transducer receives a query, but detects communication error (CRC), no response is sent.
Main program is able to process condition of exceeding of time for query.
4.
If transducer receives a query without communication error, but cannot process it, master device
receives exception response, which informs master device on error nature.
Exception Response
- it has two fields to distinguish it from normal response:
1.
Function code field
2.
Data field.
ad1 Function code field
In normal response of slave device, function code of original query corresponds to function’s code
of response. All function codes have most significant bit (MSB) equal to 0. In exception response
slave device sets most significant bit of function code to 1. Main station recognizes exception
response by means of this bit and can check data field for exception code.
ad2 Data field
Into exception response, transducer returns exception code in data field. Event causing exception is
determined this way.
Exception codes
0x01
Invalid function - Function code in query is not allowed action for transducer.
0x02
Invalid data address - Data address received in query is not allowed address for transducer.
Modbus CRC
Check sum of entire Modbus message are mostly automatically inserted to the end of request by
communication programs themselves. If you need generate the Modbus CRC into your program, the
way of calculation is as follows:
A procedure for generating a CRC is:
1.
Load a 16–bit register with FFFF hex (all 1’s). Call this the CRC register.
2.
Exclusive OR the first 8–bit byte of the message with the low–order byte of the 16–bit CRC
register, putting the result in the CRC register.
3.
Shift the CRC register one bit to the right (toward the LSB), zero–filling the MSB. Extract
and examine the LSB.
4.
(If the LSB was 0): Repeat Step 3 (another shift).
(If the LSB was 1): Exclusive OR the CRC register with the polynomial value 0xA001
(1010 0000 0000 0001).
5.
Repeat Steps 3 and 4 until 8 shifts have been performed. When this is done, a complete 8–
bit byte will have been processed.
6.
Repeat Steps 2 through 5 for the next 8–bit byte of the message. Continue doing this until all
bytes have been processed.
7.
The final content of the CRC register is the CRC value.
8.
During connection of check sum to the message lower Byte of CRC register is sent as first,
then upper Byte of CRC register.