15: WEEK PROGRAMMER INSTRUCTIONS15-6 « FC4A MICRO SMART USER ’S MANUAL »Special Internal Relays for Calendar/Clock DataExample: Setting Calendar/Clock DataThis example demonstrates how to set calendar/clock data using a ladder program. After storing new calendar/clock datainto data registers D8015 through D8021, special internal relay M8020 (calendar/clock data write flag) must be turned onto set the new calendar/clock data to the clock cartridge.Adjusting Clock Using a User ProgramSpecial internal relay M8021 (clock data adjust flag) is provided for adjusting the clock data. When M8021 is turned on,the clock is adjusted with respect to seconds. If seconds are between 0 and 29 for current time, adjustment for seconds willbe set to 0 and minutes remain the same. If seconds are between 30 and 59 for current time, adjustment for seconds will beset to 0 and minutes are incremented one. M8021 is useful for precise timing which starts at zero seconds.Example: Adjusting Calendar/Clock Data to 0 SecondsM8016 Calendar Data Write Flag When M8016 is turned on, data in data registers D8015 through D8018 (calendarnew data) are set to the clock cartridge installed on the CPU module.M8017 Clock Data Write Flag When M8017 is turned on, data in data registers D8019 through D8021 (clocknew data) are set to the clock cartridge installed on the CPU module.M8020 Calendar/Clock DataWrite FlagWhen M8020 is turned on, data in data registers D8015 through D8021 (calen-dar/clock new data) are set to the clock cartridge installed on the CPU module.M8120REP4S1 RD0MOV(W) D1 RD8015I0SOTUM8120 is the initialize pulse special internal relay.When the CPU starts, seven MOV(W) instructions store calendar/clock data to data registers D0 through D6.When input I0 is turned on, new calendar data (year, month, day,and day of week) are moved to data registers D8015 throughD8018, and internal relay M0 is turned on for 1 scan time.When input I1 is turned on, new clock data (hour, minute, andsecond) are moved to data registers D8019 through D8021, andinternal relay M1 is turned on for 1 scan time.When either M0 or M1 is turned on, calendar/clock data write flagspecial internal relay M8020 is turned on to set the new calen-dar/clock data to the clock cartridge.M8125 is the in-operation output special internal relay.While the CPU is running, the MOV(W) moves current calendar/clock data to data registers D10 through D16.REP3S1 RD4MOV(W) D1 RD8019I1SOTUM0M1REP7S1 RD8008MOV(W) D1 RD10M8125M1M8020REPS1 –0MOV(W) D1 –D0REPS1 –10MOV(W) D1 –D1REPS1 –10MOV(W) D1 –D2REPS1 –2MOV(W) D1 –D3REPS1 –9MOV(W) D1 –D4REPS1 –30MOV(W) D1 –D5REPS1 –0MOV(W) D1 –D6M0I2SOTU When input I2 is turned on, clock data adjust flag special internal relay M8021 is turned onand the clock is adjusted with respect to seconds.M8021