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.

<strong>DVP</strong>-<strong>ES2</strong>/<strong>EX2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

API Mnemonic Operands Function<br />

167 TWR P Time write<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

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

Operand:<br />

S: Set value for RTC (occupies 7 consecutive devices)<br />

TWR, TWRP: 5 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. TWR instruction updates the RTC with the value set in S.<br />

2. If the time data in S exceeds the valid calendar range, it will result in an “operation error”. PLC<br />

will writes in the smallest valid value automatically, M1067 = ON, M1068 = ON, and error code<br />

0E1A (HEX) is recorded in D1067<br />

3. For explanations of associated flags and the characteristics of RTCS, please refer to Points to<br />

note of TRD instruction.<br />

Program Example 1:<br />

When X0 = ON, write the new time into RTC.<br />

X0<br />

TWRP D20<br />

Normal D Item Range Special D Item<br />

Set value<br />

D20 Year (A.D.) 00~99 → D1319 Year (A.D.)<br />

D21<br />

Day<br />

(Mon.~Sun.)<br />

1~7 → D1318<br />

Day<br />

(Mon.~Sun.)<br />

D22 Month 1~12 → D1317 Month<br />

D23 Day 1~31 → D1316 Day<br />

D24 Hour 0~23 → D1315 Hour<br />

D25 Minute 0~59 → D1314 Minute<br />

D26 Second 0~59 → D1313 Second<br />

RTC<br />

Program Example 2:<br />

1. Set the current time in RTC as 2004/12/15, Tuesday, 15:27:30.<br />

2. The content of D0~D6 is the set value for adjusting RTC.<br />

3. When X0 = ON, update the time of RTC with the set value.<br />

4. When X1 = ON, perform ±30 seconds correction. Correction takes place when M1017 goes<br />

from OFF to ON (Second data in 0 ~ 29: reset to 0. Second data in 30 ~ 59: minute data pluses<br />

3-384

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

Saved successfully!

Ooh no, something went wrong!