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.

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

API Mnemonic Operands Function<br />

10 D CMP P Compare<br />

<strong>ES2</strong>/<strong>EX2</strong><br />

Controllers<br />

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

SE <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 CMP, CMPP: 7 steps<br />

S 1 * * * * * * * * * * * DCMP, DCMPP: 13 steps<br />

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

D * * *<br />

PULSE 16-bit 32-bit<br />

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

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

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

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <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<br />

SE<br />

SE<br />

Operands:<br />

S 1 : Comparison Value 1 S 2 : Comparison Value 2 D: Comparison result<br />

Explanations:<br />

1. The contents of S 1 and S 2 are compared and D stores the comparison result.<br />

2. The comparison values are signed binary values. If b15=1 in 16-bit instruction or b31=1 in<br />

32-bit instruction, the comparison will regard the value as a negative binary value.<br />

3. Operand D occupies 3 continuous devices. D, D +1, D +2 hold the comparison results,<br />

D = ON if S 1 > S 2 , D +1 = ON if S 1 = S 2 , D +2 = ON if S 1 < S 2<br />

4. If operand S 1 , S 2 use index register F, only 16-bit instruction is available.<br />

Program example:<br />

1. If D is set as Y0, then Y0, Y1, Y2 will display the comparison results as shown below.<br />

2. When X20 = ON, CMP instruction is executed and one of Y0, Y1, Y2 will be ON. When X20 =<br />

OFF, CMP instruction is not executed and Y0, Y1, Y2 remain in their previous condition.<br />

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

X20<br />

Y0<br />

Y1<br />

Y2<br />

CMP K10 D10 Y0<br />

If K10>D10, Y0 = On<br />

If K10=D10, Y1 = On<br />

If K10

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

Saved successfully!

Ooh no, something went wrong!