DVP - ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming

{

reg_crc ^= *data++; for (j=0;j<8;j++)

{

If (reg_crc & 0x01) reg_crc=(reg_crc>>1) ^ 0Xa001; /* LSB(b0)=1 */ else reg_crc=reg_crc >>1;

}

 

}

 

return reg_crc;

// the value that sent back to the CRC register finally

}

Exception response:

The PLC is expected to return a normal response after receiving command messages from the master device. The following content depicts the conditions that either no response situation occurs or an error response is replied to the master device.

1.The PLC did not receive a valid message due to a communication error; thus the PLC has no response. In this case, condition of communication timeout has to be set up in the master device

2.The PLC receives a valid message without a communication error, but cannot accommodate it. In this case, an exception response will return to the master device. In the exception response, the most significant bit of the original command code is set to 1, and an exception code explaining the condition that caused the exception is returned.

An example of exception response of command code 01H and exception 02H: Sent message:

Field Name

Example (Hex)

START

No data input 10 ms

 

 

Slave Address

01

 

 

Command code

01

 

 

Starting Address

04

 

00

 

 

 

Number of Points

00

 

10

 

 

 

CRC CHK Low

3C

 

 

CRC CHK High

F6

 

 

END

No data input 10 ms

 

 

4 - 10

Page 612
Image 612
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Exception response