You are on page 1of 3

Real-Time Clock

Page 1 of 3

Real-Time Clock
Submit Feedback

Introduction Each BMX P34 xxxxx processor has a real-time clock which manages: The current date and time The date and time of the last application shut-down When power of the processor is turned off, the real-time clock continues counting during four weeks. This duration is guarantied for a temperature below 45C (113F). At a higher temperature this duration is reduced. No maintenance is requested for a real-time clock back up. Current Date and Time The processor updates the current date and time in the system words % SW 49 ...% SW 53 and % SW 70 . This data is in BCD (Binary Coded Decimal). System Word % SW 49 % SW 50 % SW 51 % SW 52 % SW 53 % SW 70 Accessing the Date and Time You can access the date and time as follows: through the processor debug screen. with the program:

Most Significant Byte 00 Seconds (0 - 59) Hours (0 - 23) Month (1 - 12) Century (0 - 99)

Least Significant Byte Days of the week in the range of values 1 7 (1 for Monday and 7 for Sunday) 00 Minutes (0 - 59) Days of the month (1 - 31) Year (0 - 99) Week (1 - 52)

Reading system words: % SW 49 - % SW 53 if the system bit % S50 is at 0, immediate update: writing system words % SW 50 to % SW 53 if the system bit % S50 is at 1, incremental update: writing the system word % SW 59 . With this word the date and time can be set field by field from the current value (if the system bit % S59 is at 1), or an overall increment/decrement can be done.

The following table shows the function performed by each bit in the word % SW 59 . Bit Range 0 1 2 Function Increments the day of the week Increments the seconds Increments the minutes

mk:@MSITStore:C:\Program%20Files%20(x86)\Schneider%20Electric\Unity%20Pro\Pu... 03/02/2014

Real-Time Clock

Page 2 of 3

3 4 5 6 7 8 9 10 11 12 13 14 15

Increments the hours Increments the days Increments the months Increments the years Increments the centuries Decrements the day of the week Decrements the seconds Decrements the minutes Decrements the hours Decrements the days Decrements the months Decrements the years Decrements the centuries

NOTE: The function is performed when the corresponding bit %S59 is at 1. NOTE: The processor does not automatically manage Daylight Savings Time. Date and Time of the Last Application Shutdown The date and time of the last application shutdown are in BCD in the system words % SW 54 - % SW 58 . System Word % SW 54 % SW 55 % SW 56 % SW 57 % SW 58 Most Significant Byte Seconds (0 to 59) Hours (0 to 23) Month (1 to 12) Century (0 to 99) Day of the week (1 to 7) Least Significant Byte 00 Minutes (0 to 59) Days of the month (1 to 31) Year (0 to 99) Reason for the last application shutdown

The reason for the last application shutdown can be accessed by reading the least significant byte of the system word % SW 58 (value in BCD) which can have the following values. Word value % SW 58 1 2 4 5 Meaning Application switched to STOP mode. Application stopped by watchdog. Power loss or memory card lock operation. Stop on hardware fault.

mk:@MSITStore:C:\Program%20Files%20(x86)\Schneider%20Electric\Unity%20Pro\Pu... 03/02/2014

Real-Time Clock

Page 3 of 3

Stop on software fault (HALT instruction, SFC errors, application CRC check fail, undefined system function call, etc). Details on the software fault type are stored in % SW 125 .

2012 Schneider Electric. All rights reserved.

mk:@MSITStore:C:\Program%20Files%20(x86)\Schneider%20Electric\Unity%20Pro\Pu... 03/02/2014