beautypg.com

Delta DVP-ES2 User Manual

Page 612

background image

D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g

{

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

04

Starting Address

00

00

Number of Points

10

CRC CHK Low

3C

CRC CHK High

F6

END

No data input ≥ 10 ms

4 - 1 0

This manual is related to the following products: