FB_BA_SunBldTgmSel4

FB_BA_SunBldTgmSel4 1:

The function block FB_BA_SunBldTgmSel4 is used for priority control for up to 4 positioning telegrams (stSunBld_Prio1 ... stSunBld_Prio4) of type ST_BA_SunBld from different control function blocks.

The active telegram with the highest priority is output at stSunBld. Active means that the variable bActv is set within the structure of the positioning telegram. The priority is stored within the telegram structure as ePrio. The smaller the value of ePrio, the higher the priority.

For telegrams with the same priority, the last changed one (last writer wins) is valid, determined by the variable nEvtIncSunBld in the global variable list BA_Globals.

This function block is to be programmed in such a way that one of the applied telegrams is always active. If a telegram is not active, an empty telegram is output at the output:

fPos    = 0,
fAngl   = 0,
bManUp  = FALSE,
bManDwn = FALSE,
bManMod = FALSE,
bActv   = FALSE;

Since the blind function block FB_BA_SunBldActr or the roller blind function block FB_BA_RolBldActr does not take account of the flag bActv, this telegram would be interpreted as movement command to position "0", i.e. fully open. The absence of an active telegram therefore does not represent a safety risk for the blind.

FB_BA_SunBldTgmSel4 2: Inputs

VAR_INPUT
  stSunBldTgm_1  : ST_BA_SunBld;
  stSunBldTgm_2  : ST_BA_SunBld;
  stSunBldTgm_3  : ST_BA_SunBld;
  stSunBldTgm_4  : ST_BA_SunBld;
END_VAR

Name

Type

Description

stSunBldTgm_1…stSunBldTgm_4

ST_BA_SunBld

Telegram inputs

FB_BA_SunBldTgmSel4 3: Outputs

VAR_OUTPUT
  stSunBld      : ST_BA_SunBld;
  nNumActvTgm   : UINT;
  ePrioActvTgm  : E_BA_SunBldPrio;
END_VAR

Name

Type

Description

stSunBld

ST_BA_SunBld

Output telegram, for the position and angle of the lamella.

nNumActvTgm

UINT

Indicates which input is valid, e.g. if stSunBldTgm_3 is passed, nNumActvTgm = 3.

If nNumActvTgm = 0, no telegram is active.

ePrioActvTgm

E_BA_SunBldPrio

This output indicates the priority of the active telegram.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0