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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

170 D GRY P BIN → Gray Code<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 * * * * * * * * * * *<br />

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

Operands:<br />

S: Source device D: <strong>Operation</strong> result (Gray code)<br />

GRY, GRYP: 5 steps<br />

DGRY, DGRYP: 9 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 />

Explanations:<br />

1. GRY instruction converts the BIN value in S to Gray Code and stores the converted result in<br />

specified register D.<br />

2. Available range of S:<br />

16-bit instruction: 0~32,767<br />

32-bit instruction: 0~2,147,483,647<br />

3. If operand S exceeds the available range, operation error occurs and M1067 = ON, M1068 =<br />

ON. D1067 stores the error code 0E1A (HEX)<br />

4. If operands S and D use device F, only 16-bit instruction is applicable.<br />

Program Example:<br />

When X0 = ON, GRY instruction executes and converts K6513 to Gray Code. The operation result<br />

is stored in K4Y20, i.e. Y20 ~ Y37.<br />

X0<br />

GRY K6513 K4Y20<br />

K6513=H1971<br />

b15<br />

b0<br />

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

GRAY 6513<br />

Y37<br />

Y20<br />

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

K4Y20<br />

3-389

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

Saved successfully!

Ooh no, something went wrong!