Delta DVP-ES2 User Manual
Page 500
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g
3 - 3 8 4
API Mnemonic Operands
Function
167
TWR P
Time write
Controllers
ES2/EX2 SS2 SA2
SE
SX2
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S
K H
KnX
KnY KnM KnS T C D E F
S
*
*
*
TWR, TWRP: 5 steps
PULSE 16-bit 32-bit
ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2
Operand:
S: Set value for RTC (occupies 7 consecutive devices)
Explanations:
1.
TWR instruction updates the RTC with the value set in S.
2.
If the time data in S exceeds the valid calendar range, it will result in an “operation error”. PLC
will writes in the smallest valid value automatically, M1067 = ON, M1068 = ON, and error code
0E1A (HEX) is recorded in D1067
3.
For explanations of associated flags and the characteristics of RTCS, please refer to Points to
note of TRD instruction.
Program Example 1:
When X0 = ON, write the new time into RTC
.
X0
TWRP
D20
Normal D
Item
Range
Special D
Item
D20 Year
(A.D.) 00~99
→
D1319 Year
(A.D.)
D21
Day
(Mon.~Sun.)
1~7
→
D1318
Day
(Mon.~Sun.)
D22 Month
1~12
→
D1317 Month
D23 Day
1~31
→
D1316 Day
D24 Hour
0~23
→
D1315 Hour
D25 Minute
0~59
→
D1314 Minute
Set value
D26 Second
0~59
→
D1313 Second
RTC
Program Example 2:
1.
Set the current time in RTC as 2004/12/15, Tuesday, 15:27:30.
2.
The content of D0~D6 is the set value for adjusting RTC.
3.
When X0 = ON, update the time of RTC with the set value.
4.
When X1 = ON, perform ±30 seconds correction. Correction takes place when M1017 goes
from OFF to ON (Second data in 0 ~ 29: reset to 0. Second data in 30 ~ 59: minute data pluses