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

162 TADD P Time addition<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 />

TADD, TADDP: 7 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 : Time augend (occupies 3 consecutive devices) S 2 : Time addend (occupies 3 consecutive<br />

devices) D: Addition result (occupies 3 consecutive devices)<br />

Explanations:<br />

1. TADD instruction adds the time value (Hour, Minute Second) S 1 with the time value (Hour,<br />

Minute Second) S 2 and stores the result in D.<br />

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

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

3. If the addition result is larger than 24 hours, the carry flag M1022 will be ON and the value in D<br />

will be the result of “sum minuses 24 hours”.<br />

4. If the sum equals 0 (00:00:00), Zero flag M1020 will be ON.<br />

Program Example:<br />

When X0 = ON, TADD instruction executes and the time value in D0~D2 is added with the time<br />

value in D10~D12. The addition result is stored in D20~D22.<br />

X0<br />

TADD D0 D10 D20<br />

D0 08(Hour)<br />

D1 10(Min)<br />

D2 20(Sec)<br />

D10 06(Hour)<br />

D11 40(Min)<br />

D12 06(Sec)<br />

D20 14(Hour)<br />

D21 50(Min)<br />

D22 26(Sec)<br />

08:10:20 06:40:06 14:50:26<br />

If the addition result is greater than 24 hours, the Carry flag M1022 = ON.<br />

X0<br />

TADD D0 D10 D20<br />

D0 18(Hour)<br />

D1 40(Min)<br />

D2 30(Sec)<br />

D10 11(Hour)<br />

D11 30(Min)<br />

D12 08(Sec)<br />

D20 06(Hour)<br />

D21 10(Min)<br />

D22 38(Sec)<br />

18:40:30 11:30:08 06:10:38<br />

3-379

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

Saved successfully!

Ooh no, something went wrong!