TimeRead
TimeRead (FB)
FUNCTION_BLOCK TimeRead
Short description
Reading the current date and the current time. Variant 1: Read as since the beginning | Caution - always place only one TimeRead block per project. Also only one variant!
Representation

Interfaces
Inputs
Name
Data type
Value range
Initial value
Function
xEN
BOOL
Enable / disable reading the time
Outputs
Name
Data type
Value range
Initial value
Function
datDateAndTime
DATE_AND_TIME
Current date and current time
todTime
DATE
Current time
dtDate
DATE
Current date
Setpoints / Parameters
Name
Data type
Value range
Initial value
Function
stTimeZoneInformation
DTU.RTCLK.TIME_ZONE_INfO
DTU.gc_tziTimeZoneCET;
Time zone (default: CET)
Functional description
General
This function block is used to read the current date and current time. The time zone setting is made via the TIME_ZONE_INFO data type.
CODESYS
InOut:
Scope
Name
Type
Output
datDateAndTime
DT
Output
todTime
TOD
Output
dtDate
DATE
Output
xIsLeapYear
BOOL
Last updated

