3. Instruction Set

API

 

Mnemonic

Operands

Function

 

 

 

 

 

 

160

 

TCMP

P

 

Time compare

 

 

 

 

 

 

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

 

TCMP, TCMPP: 11 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

 

 

 

 

*

*

*

 

*

 

*

 

*

 

*

*

*

*

*

 

 

 

 

 

 

S2

 

 

 

 

*

*

*

 

*

 

*

 

*

 

*

*

*

*

*

 

 

 

 

 

 

S3

 

 

 

 

*

*

*

 

*

 

*

 

*

 

*

*

*

*

*

 

 

 

 

 

 

S

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

*

*

 

 

 

 

 

 

 

 

 

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: “Hour” for comparison (K0~K23)

 

S2: “Minute” for comparison (K0~K59)

S3: “Second” for

comparison (K0~K59)

S: Current time of RTC (occupies 3 consecutive devices) D:

 

Comparison result (occupies 3 consecutive devices)

Explanations:

1.TCMP instruction compares the time set in S1, S2, S3 with RTC current value in S and stores the comparison result in D.

2.S: “Hour” of current time of RTC. Content: K0~K23. S +1: “Minute” of current time of RTC.

Content: K0~K59. S +2: “Second” of current time of RTC. Content: K0~K59.

3.Usually the time of RTC in S is read by TRD instruction first then compared by TCMP instruction. If operand S exceeds the available range, operation error occurs and M1067 = ON, M1068 = ON. D1067 stores the error code 0E1A (HEX).

Program Example:

1.When X0 = ON, the instruction executes and the RTC current time in D20~D22 is compared with the set value 12:20:45. Comparison result is indicated by M10~M12. When X0 goes from ONOFF, the instruction is disabled however the ON/OFF status of M10~M12 remains.

2.Connect M10 ~ M12 in series or in parallel to obtain the results of , , and .

X0

 

 

TCMP

K12

K20

K45

D20

M10

 

 

M10

ON when 12:20:45

>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M11

ON when 12:20:45

=

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M12

ON when 12:20:45

<

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3 - 3 7 7

Page 493
Image 493
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Mnemonic Operands Function 160, Tcmp, Time compare