Real-time clock
(Original Document)
At a Glance
Each processor (Premium or Atrium) has a savable real-time clock which manages:
The date and time are managed even when the processor is switched off, on condition that:
Current date and time
the processor keeps the current date and time up to date in the system words %SW49 to %SW53. This data is coded in BCD.
System words
Most significant byte
Least significant byte
%SW49
00
Days of the week from 1 to 7
(1 for Monday and 7 for Sunday)
%SW50
Seconds (0 to 59)
00
%SW51
Hours (0 to 23)
Minutes (0 to 59)
%SW52
Month (1 to 12)
Days of the month (1 to 31)
%SW53
Century (0 to 99)
Year (0 to 99)
%SW70
Week (1 to 52)
NOTE: %SW49 is read-only.
Accessing the date and time
The date and time can be accessed:
Bit value table:
bit0 = 1, increments the date and time globally (1)
bit8 = 1, decrements the date and time globally (1)
bit1 =1, increments the seconds
bit9 =1, decrements the seconds
bit2 =1, increments the minutes
bit10 =1, decrements the minutes
bit3 =1, increments the hours
bit11 =1, decrements the hours
bit4 =1, increments the days
bit12 =1, decrements the days
bit5 =1, increments the months
bit13 =1, decrements the months
bit6 =1, increments the years
bit14 =1, decrements the years
bit7 =1, increments the centuries
bit15 =1, decrements the centuries
(1) all fields are updated.
NOTE: The processor does not automatically manage the change between winter and summer time.
The date and time of when the application last stopped
The date and time of when the application last stopped are stored in BCD in the system words %SW54 to %SW58.
System words
Most significant byte
Least significant byte
%SW54
Seconds (0 to 59)
00
%SW55
Hours (0 to 23)
Minutes (0 to 59)
%SW56
Month (1 to 12)
Days of the month (1 to 31)
%SW57
Century (0 to 99)
Year (0 to 99)
%SW58
Day of the week (from 1 to 7)
Reason for the last application stop
Table of %SW58 system words:
%SW58 = 1
application switched to STOP mode,
%SW58 = 2
application stopped due to a software error,
%SW58 = 4
power outage or power supply RESET button has been pressed
%SW58 = 5
stop due to hardware fault
%SW58 = 6
application stopped due to HALT instruction