TimeDate
 
 
 Bean TimeDate
 
Time and date

Methods are user callable functions/subroutines that are means of controlling the bean functions.

Methods:

  • Enable - Enables the bean - it starts the time/date timer. Events may be generated ("DisableEvent"/"EnableEvent").

      ANSIC prototype: byte Enable(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • Disable - Disables the bean - it stops the time/date timer. No events will be generated.

      ANSIC prototype: byte Disable(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • SetTime - Sets a new actual time.

      ANSIC prototype: byte SetTime(byte Hour,byte Min,byte Sec,byte Sec100)
    • Hour:byte - Hours (0 - 23)
    • Min:byte - Minutes (0 - 59)
    • Sec:byte - Seconds (0 - 59)
    • Sec100:byte - Hundredths of seconds (0 - 99)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_RANGE - Parameter out of range

  • GetTime - Return current time.

      ANSIC prototype: byte GetTime(TIMEREC *Time)
    • Time: Pointer to TIMEREC - Pointer to the structure TIMEREC. It contains actual number of hours, minutes, seconds and hundreths of seconds.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • SetDate - Sets a new actual date.

      ANSIC prototype: byte SetDate(word Year,byte Month,byte Day)
    • Year:word - Years (16-bit unsigned integer)
    • Month:byte - Months (8-bit unsigned integer)
    • Day:byte - Days (8-bit unsigned integer)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_RANGE - Parameter out of range

  • GetDate - Return current date.

      ANSIC prototype: byte GetDate(DATEREC *Date)
    • Date: Pointer to DATEREC - Pointer to the structure DATEREC. It contains actual year, month, and day description.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • GetDay - Return current day of the week.

      ANSIC prototype: byte GetDay(byte *Day)
    • Day: Pointer to byte - Pointer to returned day - 8-bit unsigned number
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • SetAlarm - Sets a new time of alarm. (only time, not date - alarm event OnAlarm is called every 24 hours). Setting time of alarm out of 24 hour interval disables its function.

      ANSIC prototype: byte SetAlarm(byte Hour,byte Min,byte Sec,byte Sec100)
    • Hour:byte - Hours (0 - 23)
    • Min:byte - Minutes (0 - 59)
    • Sec:byte - Seconds (0 - 59)
    • Sec100:byte - Hundreths of seconds (0 - 99)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_RANGE - Parameter out of range


Note: Some methods can be implemented as macros.



Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.