DailyMeanTemperature (FB)

FUNCTION_BLOCK DailyMeanTemperature

“warp clock”-enabled daily mean temperature.

Computes the daily mean temperature based on outdoor temperature sampled at full hour. In case more than two samples are missing for some reason (outdoor temperature not valid, sampling time window missed), daily mean temperature is computed from main date samples (0:00, 6:00, 12:00 and 18:00).

When does the daily mean temperature gets valid?

The daily mean temperature can be computed after last full hour is sampled - means 23:00. So there is no valid daily mean temperature for the day before that.

“Warp clock”-enabled

Certain application domains base their functionality / algorithms on real world wall clock date/time. To develop such functionality it is helpful to have control over the application timeline to speedup testing or doesnt loose control on the timeline sitting on breakpoints. WarpClock and “warp clock”-enabled function blocks provides such a control if needed. For more details about “warp” time see WarpClock.

To use “warp” time connect an accordingly configured WarpClock to itfDateTimeProvider.

InOut:

Scope

Name

Type

Initial

Comment

Input

rOdaTemp

REAL

10.0

Outdoor air temperature

xOdaTempValid

BOOL

TRUE

Outdoor air temperature is valid

xReset

BOOL

FALSE

Reset the daily mean temperatur

itfDateTimeProvider

Util.IDateTimeProvider

Globals.g_dtpDateTimeProvider

Source for the current date and time information in milliseconds since 1.1.1970 00:00:00.000

Output

rOut

REAL

daily mean temperature

xValid

BOOL

daily mean temperature is valid

xError

BOOL

Error indication

eErrorID

Error

Error ID