TimeRead (FB)¶
FUNCTION_BLOCK TimeRead
Short description¶
Read the current date and time
Portrayal¶
Interfaces¶
Inputs¶
Name Datatype
Range
Init-Value
Function
xEN BOOL Activate/deactivate read time
Outputs¶
Name Datatype
Range
Init-Value
Function
datDateAndTime DATE_AND_TIME Current date and time
todTime DATE Current time
dtDate DATE Current date
Setpoints / Parameters¶
Name Datatype
Range
Init-Value
Function
stTimeZoneInformation DTU.RTCLK.TIME_ZONE_INfO DTU.gc_tziTimeZoneCET; Zeitzone (Default: CET)
Functional description¶
General¶
This function block is used to read the current date and time.
The time zone is set using the data type TIME_ZONE_INFO.
Visualization¶
Information¶
Element Authors
Date
Version Note
Programming
Adam Bartod 09.2016 1.0 Initial version
Test Jochen Reu 10.2016 1.0 Initial version
Documentation
Kevin Rohn 11.2017 1.0 Initial version
Codesys¶
- InOut:
Scope Name Type Initial Comment Input xEn BOOL TRUE Activate/deactivate read time
stTimeZoneInformation DTU.RTCLK.TIME_ZONE_INFO DTU.gc_tziTimeZoneCET Zeitzone (Default: CET) Output datDateAndTime DT Current date and time
todTime TOD Current time
dtDate DATE Current date