FB_BA_Weatherstation_Draft
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).
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
Inputs CONSTANT
Name | Type | Description |
---|---|---|
Dstb | The weather station reports a malfunction. | |
Rain | Rain sensor. | |
WthT | Outside temperature [°C]. | |
DewPtT | Dew point temperature [°C]. | |
PrssAbs | Absolute air pressure [hPa]. | |
PrssRel | Relative air pressure [hPa]. | |
HumAbs | Absolute humidity [g/m3]. | |
HumRel | Relative Absolute Humidity [g/m3]. | |
Brightness_N | Directional light sensor north [Lux]. | |
Brightness_S | Directional light sensor south [Lux]. | |
Brightness_E | Directional light sensor east [Lux]. | |
Brightness_W | Directional light sensor west [Lux]. | |
Dawn | Dawn [Lux]. | |
GlobRadn | Global radiation [W/m²]. | |
WndDir | Wind direction [°]. | |
WndSpd | Wind speed [m/s] | |
Latd | Latitude of the installation site [°]. | |
Lngt | Longitude of the installation site [°]. | |
SunAzm | Current position of the sun [°]. | |
SunElv | Current sun elevation [°]. |
Variables
Name | Type | Description |
---|---|---|
stDateTime_PLACEHOLDER | 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 |