FB_BA_AreaLighting

FB_BA_AreaLighting 1:

Selection of lighting operation for an area based on a schedule (Sched) and manual operation (OpModMan).

The manual operation has the following modes:

Value

Meaning

1

Automatic mode.

2

Manual selection Night watchman tour.

3

Manual selection Building cleaning.

4

Manual selection Maintenance.

5

Manual selection User-defined 1.

6

Manual selection User-defined 2.

If Automatic mode is selected, the function block DeMuxManMod sets the output bQ01. Since this output is not connected to the PrioSwi, the manual mode on the PrioSwi is disabled and the schedule Sched is active. This can assume the following values:

Value

Meaning

1

Default.

2

Night watchman tour.

3

Building cleaning.

4

User-defined 1.

5

User-defined 2.

The currently selected lighting mode eAreaMode, which is of the same type as the building mode, is then displayed via the OpModPr function block.

One of the Event function blocks is enabled based on the currently valid lighting mode. All possible light telegrams are routed to the priority function block PrioSwi in addition to the floor telegram stFloor on the input side. The resulting telegram is available to the room templates at the stArea output.

FB_BA_AreaLighting 2:

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

Block diagram

FB_BA_AreaLighting 3:

Syntax

FUNCTION_BLOCK FB_BA_AreaLighting EXTENDS FB_BA_View
VAR_INPUT
  stFloor               : ST_BA_Lighting;
END_VAR
VAR_OUTPUT
  stArea                : ST_BA_Lighting;
END_VAR
VAR_INPUT CONSTANT
  OpModMan              : FB_BA_MV_Op;
  OpModPr               : FB_BA_MV_Op;
  Sched                 : FB_BA_SchedM;

  LgtValNightWatch      : FB_BA_AV_Op;
  LgtTNightWatch        : FB_BA_AV_Op;
  NightWatch            : FB_BA_LightingEvt := ( ePrio := E_BA_LightingPrio.eNightWatch);

  LgtValCleaning        : FB_BA_AV_Op;
  LgtTCleaning          : FB_BA_AV_Op;
  Cleaning              : FB_BA_LightingEvt := ( ePrio := E_BA_LightingPrio.eCleaning);

  LgtValMaintenance     : FB_BA_AV_Op;
  LgtTMaintenance       : FB_BA_AV_Op;
  Maintenance           : FB_BA_LightingEvt := ( ePrio := E_BA_LightingPrio.eMaintenance);

  LgtValUserDefined1    : FB_BA_AV_Op;
  LgtTUserDefined1      : FB_BA_AV_Op;
  UserDefined1          : FB_BA_LightingEvt := ( ePrio := 10);

  LgtValUserDefined2    : FB_BA_AV_Op;
  LgtTUserDefined2      : FB_BA_AV_Op;
  UserDefined2          : FB_BA_LightingEvt := ( ePrio := 10);
END_VAR
VAR
  DeMuxManMod           : FB_BA_DMUX_B08;
  DeMuxSched            : FB_BA_DMUX_B08;
  AreaMode              : FB_BA_PrioSwi_UDI16;
  eAreaMode             : E_BA_BuildingMode;
  PrioSwi               : FB_BA_LightingTgmSel8;
END_VAR

FB_BA_AreaLighting 4: Inputs

Name

Type

Description

stFloor

ST_BA_Lighting

Light control telegram from the higher level "Floor".

FB_BA_AreaLighting 5: Outputs

Name

Type

Description

stArea

ST_BA_Lighting

Resulting light control telegram from this template, which represents the "Area" level.

FB_BA_AreaLighting 6: Inputs CONSTANT

Name

Type

Description

OpModMan

FB_BA_MV_Op

Manual input object for the building mode.

OpModPr

FB_BA_MV_Op

Resulting mode

Sched

FB_BA_SchedM

Schedule object (automatic) for the building mode.

LgtValNightWatch

FB_BA_AV_Op

Input object for the night watchman tour light value.

LgtTNightWatch

FB_BA_AV_Op

Input object for the light temperature night watchman tour.

NightWatch

FB_BA_LightingEvt

Event function block Night watchman tour.

LgtValCleaning

FB_BA_AV_Op

Input object for the building cleaning light value.

LgtTCleaning

FB_BA_AV_Op

Input object for the building cleaning light temperature.

Cleaning

FB_BA_LightingEvt

Event function block Building cleaning.

LgtValMaintenance

FB_BA_AV_Op

Input object for the maintenance light value.

LgtTMaintenance

FB_BA_AV_Op

Input object for the maintenance light temperature.

Maintenance

FB_BA_LightingEvt

Event gunction block Maintenance.

LgtValUserDefined1

FB_BA_AV_Op

Input object for the "User-defined1" light value.

LgtTUserDefined1

FB_BA_AV_Op

Input object for the "User-defined1" light temperature.

UserDefined1

FB_BA_LightingEvt

Event function block "User-defined1".

LgtValUserDefined2

FB_BA_AV_Op

Input object for the "User-defined2" light value.

LgtTUserDefined2

FB_BA_AV_Op

Input object for the "User-defined2" light temperature.

UserDefined2

FB_BA_LightingEvt

Event function block "User-defined2".

VAR

Name

Type

Description

DeMuxManMod

FB_BA_DMUX_B08

Conversion of the multistate value of the manual selection to a binary output.

DeMuxSched

FB_BA_DMUX_B08

Conversion of the multistate value of the schedule to a binary output.

AreaMode

FB_BA_PrioSwi_UDI16

Prioritizing reconversion of the states to a resulting multistate or enumeration value for lighting operation in the building area.

eAreaMode

E_BA_BuildingMode

Currently valid lighting operation in building area.

PrioSwi

FB_BA_LightingTgmSel8

Telegram selection block for the light telegrams.

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.35

TF8040 | TwinCAT Building Automation from V5.0.0.0