Adjusting Clock Using A User Program - IDEC FC4A-C10R2 User Manual

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

15: W
P
EEK
ROGRAMMER
Special Internal Relays for Calendar/Clock Data
M8016
Calendar Data Write Flag
M8017
Clock Data Write Flag
Calendar/Clock Data
M8020
Write Flag
Example: Setting Calendar/Clock Data
This example demonstrates how to set calendar/clock data using a ladder program. After storing new calendar/clock data
into data registers D8015 through D8021, special internal relay M8020 (calendar/clock data write flag) must be turned on
to set the new calendar/clock data to the clock cartridge.
MOV(W)
M8120
MOV(W)
MOV(W)
MOV(W)
MOV(W)
MOV(W)
MOV(W)
MOV(W)
SOTU
I0
MOV(W)
SOTU
I1
M0
M1
MOV(W)
M8125

Adjusting Clock Using a User Program

Special 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 will
be set to 0 and minutes remain the same. If seconds are between 30 and 59 for current time, adjustment for seconds will be
set 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 Seconds
SOTU
I2
M8021
15-6
I
NSTRUCTIONS
When M8016 is turned on, data in data registers D8015 through D8018 (calendar
new data) are set to the clock cartridge installed on the CPU module.
When M8017 is turned on, data in data registers D8019 through D8021 (clock
new data) are set to the clock cartridge installed on the CPU module.
When 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.
S1 –
D1 –
REP
0
D0
S1 –
D1 –
REP
10
D1
S1 –
D1 –
REP
10
D2
S1 –
D1 –
REP
2
D3
S1 –
D1 –
REP
9
D4
S1 –
D1 –
REP
30
D5
S1 –
D1 –
REP
0
D6
S1 R
D1 R
REP
D0
D8015
4
M0
S1 R
D1 R
REP
D4
D8019
3
M1
M8020
S1 R
D1 R
REP
D8008
D10
7
When input I2 is turned on, clock data adjust flag special internal relay M8021 is turned on
and the clock is adjusted with respect to seconds.
« FC4A M
ICRO
M8120 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 through
D8018, and internal relay M0 is turned on for 1 scan time.
When input I1 is turned on, new clock data (hour, minute, and
second) are moved to data registers D8019 through D8021, and
internal relay M1 is turned on for 1 scan time.
When either M0 or M1 is turned on, calendar/clock data write flag
special 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.
S
U
'
M
»
MART
SER
S
ANUAL

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents