TimeRead2

TimeRead2 (FB)

FUNCTION_BLOCK TimeRead2

Short description

Read the current date and the current time. Variant 2: Read time, as in Alarm Manager | Warning - place only one TimeRead block per project. Only one variant!

Representation

Interfaces

Inputs

Name
Data type
Value range
Initial value
Function

xEN

BOOL

Enable / disable reading 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)

Function 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