FB_BA_ThiesWSC11

FB_BA_ThiesWSC11 1:

Function block for cyclic reading and processing of serial data from a Thies WSC11 weather station.

This function block converts the serial data into a defined structure.

Syntax

VAR_INPUT
  bRst                 : BOOL;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
  nUpdateTime          : UDINT;
  nConfigTimeout       : UDINT;
  nMaxCyclesOldData    : UDINT;
  nWndDatAvrgIntVal    : UDINT;
  bWndSpdLEDOn         : BOOL;
  bTwiLgtCalcAvrg      : BOOL;
  nWndDirNorthOffs     : UDINT;
  nStHgtAMSL           : UDINT;
  nRainOffDly          : UDINT;
  nDistMsgDly          : UDINT;
END_VAR
VAR_OUTPUT
  stWSC11Data          : ST_BA_WSC11Data;
  bErr                 : BOOL;
  sErrDescr            : T_MaxString;
END_VAR
VAR_IN_OUT
  TXBuffer             : ComBuffer;
  RXBuffer             : ComBuffer;
END_VAR

FB_BA_ThiesWSC11 2: Inputs

Name

Type

Description

bRst

BOOL

A rising edge at this input triggers a software reset within the weather station.

FB_BA_ThiesWSC11 3: Inputs CONSTANT PERSISTENT

Name

Type

Description

nUpdateTime

UDINT

Data retrieval interval [500…60000 ms].

nConfigTimeout

UDINT

Timeout for the configuration routine [s].

nMaxCyclesOldData

UDINT

Maximum number of read cycles with identical data: beyond this, it is considered an error - possibly caused by wire break.

nWndDatAvrgIntVal

UDINT

Averaging interval of wind direction and wind speed [1…10 min], 0 = off.

bWndSpdLEDOn

BOOL

A TRUE indicates the event "Wind" via the blue LED on the weather station.

bTwiLgtCalcAvrg

BOOL

Selection of the value calculation for twilight:

FALSE: the sum of the 4 light sensors is used.

TRUE: the average value of the 4 light sensors is used.

nWndDirNorthOffs

UDINT

Offset for wind direction [0...360°]. This can be used to correct the north direction.

nStHgtAMSL

UDINT

Station height above sea level [0...3000 m].

nRainOffDly

UDINT

Release delay of rain detection [0…3600 s].

nDistMsgDly

UDINT

Delay of error messages [0...60 s].

FB_BA_ThiesWSC11 4: Outputs

Name

Type

Description

stWSC11Data

ST_BA_WSC11Data

Output of the data

bErr

BOOL

Error

sErrDescr

T_MaxString

Textual error description

FB_BA_ThiesWSC11 5: Inputs/outputs

Name

Type

Description

TXBuffer / RXBuffer

ComBuffer

Serial data exchange with the reading function block SerialLineControl in the fast task.

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.35

TF8040 | TwinCAT Building Automation from V5.0.0.0