Time and Date ¶ Modules of this library support reading and setting of the realtime clock. These modules, however, might not take into account the time zone and a possible switch between summer and standard time. If an automatic switch is desired all the same, the function blocks of the CAA_DTUtility library can be used for reading and setting the realtime clock. In this case the time switch is done via the CAA_DTUtility library . If the runtime system supports the automatic switch between summer and standard time, the calls of the library will be forwarded directly to the corresponding functions of library CAA_RealTimeClock and the clock switch will be done by the runtime system. GetDateAndTime (FunctionBlock) SetDateAndTime (FunctionBlock)
GetDateAndTime (FB) ¶ FUNCTION_BLOCK GetDateAndTime This function block reads the realtime clock. It returns the time of the local time zone (i.e. a possible switch to summer/standard time will be regarded). The current time zone switch can be defined by SetTimeZoneInformation . If a switch to summer/standard time has become necessary since the last polling of the time, this is done automatically. At the start of the module the outputs dtDateAndTime and eTimezone are reset. ( DT#1970-01-01-00:00 and RTCLK_UNKNOWN ). After successful operation they will contain the current local time. InOut: Scope Name Type Comment Input xExecute BOOL Rising edge: Action start Falling edge: Resets outputs. If a falling edge occurs before the function block has completed its Action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone, xError, iError) are present at the outputs for exactly one cycle. Output xDone BOOL Action successfully completed xBusy BOOL Function block active xError BOOL TRUE : error occurred, function block aborts action FALSE : no error eError ERROR Error description for diagnosis dtDateAndTime DT Current local time eTimezone PERIODE Current time zone
SetDateAndTime (FB) ¶ FUNCTION_BLOCK SetDateAndTime This function block sets the realtime clock. The current local time is passed in the parameter dtDateAndTime . Speciality: If the time is within the not-unique interval shortly after the switch to standard (winter) time, standard time will be assumed. This case occurs for example in the Central European countries, if on the last Sunday of October the time is set at 2:30 a.m.. Here it is not clear, whether 2:30 a.m. is still summer time or already standard (winter) time. In this case the module assumes standard (winter) time. InOut: Scope Name Type Comment Input xExecute BOOL Rising edge: Action start Falling edge: Resets outputs. If a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone, xError, iError) are present at the outputs for exactly one cycle. dtDateAndTime DT Current time Output xDone BOOL Action successfully completed xBusy BOOL Function block active xError BOOL TRUE : error occurred, function block aborts action FALSE : no error eError ERROR Error description for diagnosis
Functions ¶ GetProperty (Function)
GetProperty (FUN) ¶ FUNCTION GetProperty : __XWORD InOut: Scope Name Type Comment Return GetProperty __XWORD Input wProperty WORD property number
GlobalConstants ¶ PropertyConstants (GVL)
PropertyConstants (GVL) ¶ InOut: Scope Name Type Initial Comment Constant gc_wTIMEZONESUPPORT WORD 1 Time zone support
Structs ¶ PERIODE_INFO (Alias) RTCLK_GETDATEANDTIME_PARAMS (Struct) RTCLK_GETTIMEZONEINFORMATION_PARAMS (Struct) RTCLK_PERIODE_INFO (Struct) RTCLK_SETDATEANDTIME_PARAMS (Struct) RTCLK_SETTIMEZONEINFORMATION_PARAMS (Struct) RTCLK_SYSTEMTIME (Struct) RTCLK_TIME_ZONE_INFO (Struct) SYSTEMTIME (Alias) TIME_ZONE_INFO (Alias)
PERIODE_INFO (ALIAS) ¶ TYPE PERIODE_INFO : RTCLK_PERIODE_INFO
RTCLK_GETDATEANDTIME_PARAMS (STRUCT) ¶ TYPE RTCLK_GETDATEANDTIME_PARAMS : STRUCT InOut: Name Type dtDateAndTime DT eTimezone PERIODE