3. Instruction Set

API

162

Mnemonic

 

Operands

Function

 

 

 

 

 

 

 

TADD

 

P

 

Time addition

 

 

 

 

 

 

Controllers

ES2/EX2 SS2 SA2 SX2

SE

Type

Bit Devices

 

 

 

 

Word devices

 

 

 

 

 

 

 

Program Steps

 

OP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

Y

M

S

K

H

KnX

KnY

KnM

KnS

T

C

 

D

E

 

F

TADD, TADDP: 7 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

*

 

*

 

 

 

 

 

 

 

 

 

S2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

*

 

*

 

 

 

 

 

 

 

 

 

D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

*

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

16-bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

 

SE

SE

SE

Operands:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1: Time augend (occupies 3 consecutive devices)

S2: Time addend (occupies 3 consecutive

 

devices) D: Addition result (occupies 3 consecutive devices)

 

 

 

 

 

 

 

 

 

 

Explanations:

1.TADD instruction adds the time value (Hour, Minute Second) S1 with the time value (Hour, Minute Second) S2 and stores the result in D.

2.If operand S1, S2 exceed the available range, operation error occurs and M1067 = ON, M1068 = ON. D1067 stores the error code 0E1A (HEX).

3.If the addition result is larger than 24 hours, the carry flag M1022 will be ON and the value in D will be the result of “sum minuses 24 hours”.

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

Program Example:

When X0 = ON, TADD instruction executes and the time value in D0~D2 is added with the time value in D10~D12. The addition result is stored in D20~D22.

 

X0

TADD

D0

D10

D20

 

 

 

 

 

 

 

 

 

 

D0

 

08(Hour)

D10

06(Hour)

D20

14(Hour)

 

 

 

D1

 

10(Min)

D11

40(Min)

D21

50(Min)

 

D2

 

20(Sec)

D12

06(Sec)

D22

26(Sec)

08:10:20

06:40:06

14:50:26

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

X0

TADD D0 D10 D20

D0

18(Hour)

D10

11(Hour)

D20

06(Hour)

D1

40(Min)

D11

30(Min)

D21

10(Min)

D2

30(Sec)

D12

08(Sec)

D22

38(Sec)

 

18:40:30

 

11:30:08

06:10:38

3 - 3 7 9

Page 495
Image 495
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Tadd, Time addition