SetTimeZoneInformation (FB) ¶ FUNCTION_BLOCK SetTimeZoneInformation With this function block the specific information of the time zone can be modified. The time zone setting will be kept even after a Reset-Origin of the controller and can only be modified by being overwritten again. If no automatic switch is desired, all elements of tziInfo.stStandardDate and tziInfo.stDaylightDate must be set to 0. (for further information see library CAA_RealTimeClock ) 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. tziInfo RTCLK.TIME_ZONE_INFO Information on the time zone 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
Time and Date ¶ Reading and setting of the realtime clock is already supported by modules of the library CAA_RealTimeClock.lib . 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 this library. The switch between summer and standard time is not done until one of the function blocks GetDateAndTime or SetDateAndTime is called. For this reason it is recommended to read the system time cyclically via function block GetDateAndTime . 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 ePeriode 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 ePeriode RTCLK.PERIODE Current local time
SetDateAndTime (FB) ¶ FUNCTION_BLOCK SetDateAndTime This function block sets the realtime clock. The current local time is passed in the parameter dtDateAndTime . Note 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 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 ¶ Utility Functions DTConcat (Function) DTSplit (Function) DateConcat (Function) DateSplit (Function) GetDayOfWeek (Function) TODConcat (Function) TODSplit (Function)
Utility Functions ¶ DTConcat (Function) DTSplit (Function) DateConcat (Function) DateSplit (Function) GetDayOfWeek (Function) TODConcat (Function) TODSplit (Function)
DTConcat (FUN) ¶ FUNCTION DTConcat : DATE_AND_TIME The function converts year, month, hour, minute and second to the IEC 6-1131-3 format DATE_AND_TIME . In case of invalid inputs DT#1970-01-01-00:00 will be returned. InOut: Scope Name Type Comment Return DTConcat DT Input uiYear UINT 1970 .. 2099 uiMonth UINT 1 .. 12 uiDay UINT 1 .. 31 uiHour UINT 0 .. 23 uiMinute UINT 0 .. 59 uiSecond UINT 0 .. 59 peError POINTER TO ERROR
CAADiagTreeBase (FB) ¶ FUNCTION_BLOCK CAADiagTreeBase IMPLEMENTS INode Default implementation of INode interface for CAADiagDeviceDefault function block Properties: ChildNodeCount Enable FirstChildNode IsRootNode NextSiblingNode ParentNode SiblingNodeCount Structure: INode ChildNodeCount (Property) Enable (Property) FirstChildNode (Property) IsRootNode (Property) NextSiblingNode (Property) ParentNode (Property) SiblingNodeCount (Property)
CAAReconfigureBase (FB) ¶ FUNCTION_BLOCK CAAReconfigureBase IMPLEMENTS IReconfigureProvider This function block provides a base implementation for IReconfigureProvider . It is important to call CAAReconfigureBase.Initialize_Diag once before using this function block. I/O driver nodes just delegate all IReconfigureProvider methods and properties to this function block. There is no additional code necessary. For other nodes a specific implementation is necessary. For this CAAReconfigureBase.BeginReconfigure , CAAReconfigureBase.ReconfigureChildrenAsync and CAAReconfigureBase.EndReconfigure can be used. Properties: ReconfigureActive SiblingIRP Methods: BeginReconfigure EndReconfigure Initialize_Diag ReconfigureAsync ReconfigureChildrenAsync ReconfigureIoDriverAsync RegisterIRPChild Structure: BeginReconfigure (Method) EndReconfigure (Method) IReconfigureProvider ReconfigureActive (Property) ReconfigureAsync (Method) RegisterIRPChild (Method) SiblingIRP (Property) Initialize_Diag (Method) Reconfigure-Implementations ReconfigureChildrenAsync (Method) ReconfigureIoDriverAsync (Method)
Structs ¶ BUS_INFO (Struct) DEVICE_INFO (Struct) ERROR_INFO (Struct) LOG_ENTRY (Struct) QOS_INFO (Struct)