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 />

154 D RAND P Random number<br />

Controllers<br />

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

SE<br />

Type<br />

Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F<br />

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

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

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

RAND, RANDP: 7 steps<br />

DRAND, DRANDP: 13<br />

steps<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 1 : Lower bound of the random number S 2 : Upper bound of the random number D: <strong>Operation</strong><br />

result<br />

Explanations:<br />

1. The range of 16-bit operands S 1 , S 2 : K0≦S 1 , S 2 ≦K32,767; the range of 32-bit operands S 1 ,<br />

S 2 : K0≦S 1 , S 2 ≦K2,147,483,647.<br />

2. Entering S 1 > S 2 will result in operation error. The instruction will not be executed at this time,<br />

M1067, M1068 = ON and D1067 records the error code 0E1A (HEX)<br />

Program Example:<br />

When X10 = ON, RAND will produce the random number between the lower bound D0 and upper<br />

bound D10 and store the result in D20.<br />

X0<br />

RAND D0 D10 D20<br />

3-359

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

Saved successfully!

Ooh no, something went wrong!