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