275
4
4 Instructions 4.8.5 Timing
Item
Data Source
D
System Variable
Year (2000–2099) D0 → D8018
Month (1–12) D1 → D8017
Date (1–31) D2 → D8016
Hours (0–23) D3 → D8015
Minutes (0–59) D4 → D8014
Seconds (0–59) D5 → D8013
Day (0–6: Sun–Sat) D6 →
D8019
All the seven data entries year, month, date, hours, minutes, seconds, and day are used to set a new current value of
the real-time clock. All the corresponding variables must be preset. If the day is not set, the default value 0 (Sunday) is
applied. If the month is not set, then the corresponding variable is 0 and the PLC considers it to be incorrect, resulting in
invalid clock change.
The clock is calibrated by ±30s each time M8017 is set to ON. When the number of seconds of the clock is within the
range 1 to 29, the seconds are cleared while the minutes remain unchanged; when the number of seconds is within the
range 30 to 59, the seconds are cleared while the number of minute is incremented by 1.
The clock stops when M8015 is set to ON.
The clock calibration method is described as follows.
Example 2:
ǒMOV K9 D0Ǔ
X7
ǒMOV K9 D1Ǔ
ǒMOV K10 D2Ǔ
ǒMOV K8 D3Ǔ
ǒMOV K30 D4Ǔ
ǒMOV K0 D5Ǔ
ǒMOV K4 D6Ǔ
Year
Month
Date
Hours
Minutes
Seconds
Day
ǒTWR D0Ǔ
X6
(M8017)
Corrected by ± 30s
The time is written to D0 to D6 in advance. When the time is reached,
X7 is connected and the correct time is written to the PLC.
The time can be corrected by ± 30s at the moment when M8017 is
set to ON.
The current time and date of the PLC is adjusted to 08:30:00,
Thursday, September 10, 2009.
The preset time is written to
a permanent calendar.
Note: When you need to modify the clock, use the TWR instruction to write clock data to D8013–D8019.
M8015 must be set when the MOV instruction is used to assign values to D8013–D8019.
4.8.5 Timing
HOUR: Hour meter
◆
Overview
When driving conditions are met, the HOUR instruction records time cumulatively. When the cumulative
time reaches the preset value, a designated output becomes active.