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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

84 CCD P Check Code<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

<strong>SX2</strong><br />

Type Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F CCD, CCDP: 7 steps<br />

S * * * * * * *<br />

D * * * * *<br />

n * * *<br />

PULSE 16-bit 32-bit<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE SE SE <strong>SX2</strong><br />

Operands:<br />

S: source data D: Destination device for storing check sum n: Number of byte (n = 1~256)<br />

Explanations:<br />

1. This instruction performs a sum check for ensuring the validity of the communication data.<br />

2. 16-bit conversion: If M1161 = OFF, n bytes of data starting from low byte of S will be summed<br />

up, the checksum is stored in D and the parity bits are stored in D+1.<br />

3. 8-bit conversion: If M1161 = ON, n bytes of data starting from low byte of S (only low byte is<br />

valid) will be summed up, the check sum is stored in D and the parity bits are stored in D+1.<br />

Program Example 1:<br />

1. M1161 = OFF, 16-bit conversion.<br />

2. When X0 = ON, 6 bytes from low byte of D0 to high byte of D2 will be summed up, and the<br />

checksum is stored in D100 while the parity bits are stored in D101.<br />

M1000<br />

X0<br />

M1161<br />

CCD D0 D100 K6<br />

(S)<br />

D0 low byte<br />

D0 high byte<br />

D1 low byte<br />

D1 high byte<br />

D2 low byte<br />

D2 high byte<br />

D100<br />

D101<br />

Content of data<br />

K100 = 0 1 1 0 0 1 0 0<br />

K111 = 0 1 1 0 1 1 1 1<br />

K120 = 0 1 1 1 1 0 0 0<br />

K202 = 1 1 0 0 1 0 1 0<br />

K123 = 0 1 1 1 1 0 1 1<br />

K211 = 1 1 0 1 0 0 1 1<br />

K867<br />

Total<br />

0 0 0 1 0 0 0 1 The parity is 1 when there is an odd number of 1.<br />

The parity is 0 when there is an even number of 1.<br />

D100<br />

0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1<br />

D101<br />

0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1<br />

Parity<br />

3-235

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

Saved successfully!

Ooh no, something went wrong!