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>EX2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

API Mnemonic Operands Function<br />

45 D MEAN P Mean<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <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 MEAN, MEANP: 7 steps<br />

S * * * * * * * DMEAN, DMEANP: 13<br />

D * * * * * * * *<br />

n * * * * * * * * * * * steps<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: Source device D: Destination for storing result n: Number of consecutive device from S<br />

Explanations:<br />

1. The instruction obtains the mean value from n consecutive registers from S and stores the<br />

value in D.<br />

2. Remainders in the operation will be ignored.<br />

3. If S is not within the valid range, only those addresses within the valid range will be<br />

processed.<br />

4. If n is out of the valid range (1~64), PLC will determine it as an “instruction operation error”.<br />

5. If operand D uses index F, only a 16-bit instruction is available.<br />

6. Valid range of operand n : n = 1~64<br />

Program Example:<br />

When X10 = ON, the contents in 3 (n = 3) registers starting from D0 will be summed and then<br />

divided by 3 to obtain the mean value. The result will be stored in D10 and the remainder will be<br />

left out<br />

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

X10<br />

MEAN D0 D10 K3<br />

(D0+D1+D2)/3<br />

D10<br />

D0<br />

K100<br />

D1<br />

K113<br />

D10<br />

K112<br />

D2<br />

K125<br />

Remainder = 3, left out<br />

3-110

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

Saved successfully!

Ooh no, something went wrong!