14: CLOCK / CALENDAR INSTRUCTIONS
14-2 USER’S MANUAL
72 CALW (Calendar Write)
Note: Only the months of January, March, May, July, August, October, and December can be programmed with a date of
the 31st. The month of February can be programmed with a date of the 29th only for actual leap years. (Leap years are
automatically adjusted for).
Note: If month, day, or day of week is assigned a value which is not within the range specified above or if a date is not
assigned according to the preceding note, then invalid data will result in a user program execution error, internal relay
M304 turns on, and the ERR1 indicator on the MICRO
3
base unit also turns on. The error code is stored in data register
D93 when the control data register is enabled using FUN10. See page 5-8.
Key Operation
Valid Operands (Standard Processing)
In the high-speed processing mode, data registers for this instruction are limited to D0 through D31.
Since the CALW instruction is executed at the rising edge of the input, a pulse input from an SOTU or SOTD instruction is
not required.
Example: CALW
Operand Function I Q M T C R D Constant Repeat
Source to write the calendar data ——————0-99 — —
When input is turned on, the calendar is set using data stored in four data registers starting
with the designated operand.
D = Year (0 to 99)
D+1 = Month (1 to 12)
D+2 = Day (1 to 31)
D+3 = Day of week (0 to 6) assigned as follows:
012 3 456
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
CALW
****
ADV
0 LOD I 0
1 CALW
3 END
4 END
7
END
2
BRD
Enter operand for the first data register to write calendar
data.
To enter the instruction, press the key.
Store calendar data to four consecutive data registers start-
ing with the designated operand.
I1
M301 is the initialize pulse special internal relay.
When MICRO
3
starts operation, the MOV instructions set calendar data to
data registers D40 through D43.
D40 = 94 (Year 1994)
D41 = 4 (April)
D42 = 20 (Day)
D43 = 3 (Wednesday)
When input I1 is turned on, the calendar is set using data from data regis-
ters D40 through D43.
Note: Calendar data can also be set using FUN28. See page 5-12.
CALW
D40
M301
REP
**
MOV
S1
94
D1
D40
REP
**
MOV S1
4
D1
D41
REP
**
MOV S1
20
D1
D42
REP
**
MOV S1
3
D1
D43