beautypg.com

Delta DVP-ES2 User Manual

Page 351

background image

3 . I n s t r u c t i o n S e t

3 - 2 3 5

API Mnemonic

Operands

Function

84

CCD P

Check Code

Controllers

ES2/EX2 SS2 SA2

SE

SX2

Bit Devices

Word devices

Program Steps

Type

OP

X Y

M S K H KnX KnY KnM KnS T C D E F

S

*

*

*

*

*

*

*

D

*

*

*

*

*

n

*

*

*

CCD, CCDP: 7 steps

PULSE 16-bit 32-bit

ES2/EX2 SS2

SA2

SE

SX2 ES2/EX2 SS2

SA2

SE

SX2 ES2/EX2 SS2

SA2

SE

SX2

Operands:

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

Explanations:

1.

This instruction performs a sum check for ensuring the validity of the communication data.

2.

16-bit conversion: If M1161 = OFF, n bytes of data starting from low byte of S will be summed

up, the checksum is stored in D and the parity bits are stored in D+1.

3.

8-bit conversion: If M1161 = ON, n bytes of data starting from low byte of S (only low byte is

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

Program Example 1:

1.

M1161 = OFF, 16-bit conversion.

2.

When X0 = ON, 6 bytes from low byte of D0 to high byte of D2 will be summed up, and the

checksum is stored in D100 while the parity bits are stored in D101.

X0

CCD

D0

D100

K6

M1000

M1161

0

0

0

0

0

1

1

1

1

1

0

0

0

0

1

0

0

0

0

0

0

0

0

0

0

0

0

1

0

0

0

1

D100

D101

Parity

D0 low byte

D0 high byte

D1 low byte

D1 high byte

D2 low byte

D2 high byte

D100

D101

(S)

Content of data

K100 = 0 1 1 0 0 1 0 0

K111 = 0 1 1 0 1 1 1 1

K120 = 0 1 1 1 1 0 0 0

K202 = 1 1 0 0 1 0 1 0

K123 = 0 1 1 1 1 0 1 1

K211 = 1 1 0 1 0 0 1 1

K867

0 0 0 1 0 0 0 1

The parity is 1 when there is an odd number of 1.
The parity is 0 when there is an even number of 1.

Total

This manual is related to the following products: