17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>DVP</strong>-<strong>ES2</strong>/<strong>EX2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

{<br />

reg_crc ^= *data++;<br />

for (j=0;j>1) ^ 0Xa001; /* LSB(b0)=1 */<br />

else reg_crc=reg_crc >>1;<br />

}<br />

}<br />

return reg_crc;<br />

// the value that sent back to the CRC register finally<br />

}<br />

Exception response:<br />

The PLC is expected to return a normal response after receiving command messages from the master<br />

device. The following content depicts the conditions that either no response situation occurs or an error<br />

response is replied to the master device.<br />

1. The PLC did not receive a valid message due to a communication error; thus the PLC has no<br />

response. In this case, condition of communication timeout has to be set up in the master device<br />

2. The PLC receives a valid message without a communication error, but cannot accommodate it. In<br />

this case, an exception response will return to the master device. In the exception response, the<br />

most significant bit of the original command code is set to 1, and an exception code explaining<br />

the condition that caused the exception is returned.<br />

An example of exception response of command code 01H and exception 02H:<br />

Sent message:<br />

Field Name<br />

Example (Hex)<br />

START<br />

No data input ≥ 10 ms<br />

Slave Address 01<br />

Command code 01<br />

Starting Address<br />

04<br />

00<br />

Number of Points<br />

00<br />

10<br />

CRC CHK Low<br />

3C<br />

CRC CHK High<br />

F6<br />

END<br />

No data input ≥ 10 ms<br />

4-10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!