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

160 TCMP P Time compare<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 />

S 3 * * * * * * * * * * *<br />

S * * *<br />

D * * *<br />

TCMP, TCMPP: 11 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 : “Hour” for comparison (K0~K23) S 2 : “Minute” for comparison (K0~K59) S 3 : “Second” for<br />

comparison (K0~K59) S: Current time of RTC (occupies 3 consecutive devices) D:<br />

Comparison result (occupies 3 consecutive devices)<br />

Explanations:<br />

1. TCMP instruction compares the time set in S 1 , S 2 , S 3 with RTC current value in S and stores<br />

the comparison result in D.<br />

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

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

3. Usually the time of RTC in S is read by TRD instruction first then compared by TCMP<br />

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

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

Program Example:<br />

1. When X0 = ON, the instruction executes and the RTC current time in D20~D22 is compared<br />

with the set value 12:20:45. Comparison result is indicated by M10~M12. When X0 goes from<br />

ON→OFF, the instruction is disabled however the ON/OFF status of M10~M12 remains.<br />

2. Connect M10 ~ M12 in series or in parallel to obtain the results of ≧, ≦, and ≠.<br />

X0<br />

TCMP K12 K20 K45 D20 M10<br />

M10<br />

ON when 12:20:45<br />

><br />

M11<br />

ON when 12:20:45<br />

=<br />

M12<br />

ON when 12:20:45<br />

<<br />

3-377

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

Saved successfully!

Ooh no, something went wrong!