Real-Time Clock

Setting and Displaying the Real-Time Clock \ with the PLC Browser

The PLC browser/PLC shell commands date and time are used to set the real-time clock.

The commands date <ENTER> or time <ENTER> display the current date and time of the real-time clock.

The command: date yyyy-mm-dd<ENTER> (year-month-day) sets the date.

The command: time hh-mm-ss<ENTER> (hours-minutes-seconds) sets the time.

Example:

The real-time clock should be set to 22 February 2005, 16:50.

  1. Enter the date:

    date 2005-02-22<ENTER>

    Display: date 2005-02-22   Clock set to 2005-02-22 08:01:07

    The time remains unchanged.

  2. Enter the time:

    time 16:50<ENTER>

    Display:time 16:50    Clock set to 2005-02-22 16:50:00

Setting and Displaying the Real-Time Clock \ with the User Program

The following Function Blocks located in the folder “Realtime clock” of the system library SysExt_AC500_Vxx.lib can be used to set and display the real-time clock (RTC) with help of the user program:

Function Block Function
CLOCK: CLOCK

Sets and displays the real-time clock with values for year, month, day, hours, minutes and seconds.

Also the day of week is indicated (Mo=1, Tue=2, Wed=3, Thu=4, Fr=5, Sa=6, Su=0).

Note: The week of day cannot be set. It is given by the real-time clock. The input DAY_SET is ignored.

   
CLOCK_DT: CLOCK_DT Sets and displays the real-time clock in DT format, for example DT#2005-02-17-17:15:00.
   

The Function Blocks CLOCK and CLOCK_DT are described in the documentation for the system library SysExt_AC500_Vxx.lib.