FB_BA_Weatherstation_Draft

FB_BA_Weatherstation_Draft 1:

This template represents a programming template for a weather station for which no prepared template is available. To the objects Dstb ... SunElv the values of the existing weather station are to be linked, if available, as well as the time. There is no object for the time of the type TIMESTRUCT, here the placeholder variable must be replaced. This is only for error-free translation of the base project.

The respective values fPresentValue are combined in a globally declared variable structure stWeatherstation (see Site).

FB_BA_Weatherstation_Draft 2:
FB_BA_Weatherstation_Draft 3:

The initialization of the template takes place within the method FB_Init.

Syntax

FUNCTION_BLOCK FB_BA_WeatherStation_Draft EXTENDS FB_BA_View
VAR_INPUT CONSTANT
  Dstb                      : FB_BA_BI;
  Rain                      : FB_BA_BI;
  WthT                      : FB_BA_AI;
  DewPtT                    : FB_BA_AI;
  PrssAbs                   : FB_BA_AI;
  PrssRel                   : FB_BA_AI;
  HumAbs                    : FB_BA_AI;
  HumRel                    : FB_BA_AI;
  Brightness                : FB_BA_AI;
  Dawn                      : FB_BA_AI;
  GlobRadn                  : FB_BA_AI;
  WndDir                    : FB_BA_AI;
  WndSpd                    : FB_BA_AI;
  Latd                      : FB_BA_AI;
  Lngt                      : FB_BA_AI;
  SunAzm                    : FB_BA_AI;
  SunElv                    : FB_BA_AI;
END_VAR

VAR
  stDateTime_PLACEHOLDER    : TIMESTRUCT;
END_VAR

FB_BA_Weatherstation_Draft 4: Inputs CONSTANT

Name

Type

Description

Dstb

FB_BA_BI

The weather station reports a malfunction.

Rain

FB_BA_BI

Rain sensor.

WthT

FB_BA_AI

Outside temperature [°C].

DewPtT

FB_BA_AI

Dew point temperature [°C].

PrssAbs

FB_BA_AI

Absolute air pressure [hPa].

PrssRel

FB_BA_AI

Relative air pressure [hPa].

HumAbs

FB_BA_AI

Absolute humidity [g/m3].

HumRel

FB_BA_AI

Relative Absolute Humidity [g/m3].

Brightness_N

FB_BA_AI

Directional light sensor north [Lux].

Brightness_S

FB_BA_AI

Directional light sensor south [Lux].

Brightness_E

FB_BA_AI

Directional light sensor east [Lux].

Brightness_W

FB_BA_AI

Directional light sensor west [Lux].

Dawn

FB_BA_AI

Dawn [Lux].

GlobRadn

FB_BA_AI

Global radiation [W/m²].

WndDir

FB_BA_AI

Wind direction [°].

WndSpd

FB_BA_AI

Wind speed [m/s]

Latd

FB_BA_AI

Latitude of the installation site [°].

Lngt

FB_BA_AI

Longitude of the installation site [°].

SunAzm

FB_BA_AI

Current position of the sun [°].

SunElv

FB_BA_AI

Current sun elevation [°].

Variables

Name

Type

Description

stDateTime_PLACEHOLDER

TIMESTRUCT

Placeholder variable: instead of this variable, a suitable time structure can be linked, which provides the current time via the weather station.

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.35

TF8040 | TwinCAT Building Automation from V5.0.0.0