FB_BA_LightActrDALI_TC

FB_BA_LightActrDALI_TC 1:

This function block is used to control a DALI light actuator, a DALI group or DALI devices with a broadcast, whereby color temperature control is supported.

Function

Four routines are executed in the function block:

The "current value" is always initially assumed to be the value that was sent without errors. The cyclic query of the respective read function will correct the value if a telegram is nevertheless "lost" or the control gear has been controlled in another way.

This procedure ensures that, on the one hand, the DALI bus is not overloaded, but on the other hand, the actual light value is always read.

The function block is controlled via values from the light telegram stLightingCmd. The control values of the light and the color temperature are limited to the limits that were previously transferred to the control gear or the devices by an initialization routine with other configuration parameters, see VAR_INPUT CONSTANT PERSISTENT. Initialization takes place via the input bInitialize. Fixed values are also transferred here, see VAR CONSTANT.

A color temperature setpoint of "0" is explicitly ignored. This allows telegrams to be generated that only influence the brightness, but not the color temperature previously set elsewhere.

The light value is set internally exclusively via the DALI command FB_DALI102DirectArcPowerControl. This means that the FadeTime is the time taken to dim to the new light value.

This dimming time is pre-set to 0 s so that dimming ramps can only be implemented in the PLC.

If group or broadcast control is selected, the control and initialization commands are directed to all devices. Read commands, on the other hand, are only sent to the reference device.

Syntax

FUNCTION_BLOCK FB_BA_LightDALI_TC
VAR_INPUT
  bEn                          : BOOL;
  bInitialize                  : BOOL;
  stLightingCmd                : ST_BA_Lighting;
  eAdrType                     : Tc3_DALI.E_DALIAddressType := Tc3_DALI.E_DALIAddressType.Short;
  nAdr                         : BYTE;
  nAdrRefDev                   : BYTE;
  ipDALICommunication          : Tc3_DALI.I_DALICommunication;
END_VAR
VAR_OUTPUT
  byActlLgtVal                 : BYTE;
  fActlLgtVal                  : REAL;
  fActlLgtT                    : REAL;
  bInitializing                : BOOL;
  bErr                         : BOOL;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
  nHysLgtVal                   : BYTE;
  fHysLgtT                     : REAL;
  nPrdQueryLgtVal              : UDINT;
  nPrdQueryLgtT                : UDINT;

  nMinLevel                    : BYTE := 126;
  nMaxLevel                    : BYTE := 254;
  nPowerOnLevel                : BYTE := 254;
  nSystemFailureLevel          : BYTE := 254;
  eFadeTime                    : Tc3_DALI.E_DALIFadeTime := Tc3_DALI.E_DALIFadeTime.Disabled;
  eFadeRate                    : Tc3_DALI.E_DALIFadeRate := Tc3_DALI.E_DALIFadeRate.N358StepsPerSec;
  fTemperatureLimitWarmest     : LREAL := 2700;
  fTemperatureLimitCoolest     : LREAL := 6500;
  fPowerOnTemperature          : LREAL := 3000;
  fSystemFailureTemperature    : LREAL := 3000;
END_VAR
VAR CONSTANT
  eExtendedFadeTimeBase        : Tc3_DALI.E_DALIExtendedFadeTimeBase := Tc3_DALI.E_DALIExtendedFadeTimeBase.Base01;
  eExtendedFadeTimeMultiplier  : Tc3_DALI.E_DALIExtendedFadeTimeMultiplier := Tc3_DALI.E_DALIExtendedFadeTimeMultiplier.Disabled;
END_VAR

FB_BA_LightActrDALI_TC 2: VAR_INPUT

Name

Type

Description

bEn

BOOL

Enabling the function block: a TRUE signal at this input enables the function.

bInitialize

BOOL

A positive edge at this input starts the DALI initialization routine, which transfers the set parameters to the DALI device, see FB_BA_Swi4DALI.

stLightingCmd

ST_BA_Lighting

Light control telegram

eAdrType

Tc3_DALI.E_DALIAddressType

Defines whether the input nAdr contains a short address (0...63) or a group address (0...31). The input nAdr has no meaning if a broadcast is sent

nAdr

BYTE

DALI short address of the sensor.

nAdrRefDev

BYTE

DALI address of a reference device if group or broadcast control is selected. This reference device then represents all other controlled devices.

ipDALICommunication

Tc3_DALI.I_DALICommunication

Interface pointer to the DALI communication block.

FB_BA_LightActrDALI_TC 3: VAR_OUTPUT

Name

Type

Description

byActlLgtVal

BYTE

Current light value in DALI format (0...254).

fActlLgtVal

REAL

Current light value in percent.

fActlLgtT

REAL

Current color temperature in Kelvin.

bInitializing

BOOL

The sensor is in the DALI initialization phase, i.e. the entered parameters are transferred to the DALI device.

bErr

BOOL

Error output. A plain text is output in TwinCAT in the error list in the output window.

FB_BA_LightActrDALI_TC 4: VAR_INPUT CONSTANT PERSISTENT

Name

Type

Description

nHysLgtVal

BYTE

Hysteresis range around the light control value. A new set command is started if the setpoint nHysLgtVal/2 is above or below the actual value.

fHysLgtT

REAL

Hysteresis range around the color temperature default value. A new set command is started if the setpoint nHysLgtVal/2 is above or below the actual value.

nPrdQueryLgtVal

UDINT

Query interval of the light value [s].

nPrdQueryLgtT

UDINT

Query interval of the color temperature [s].

FB_BA_LightActrDALI_TC 5:

The following parameters are transferred to the DALI control gear or the DALI devices by the initialization routine.

Name

Type

Description

nMinLevel

BYTE

Minimum light control value in DALI output format (0...254). Pre-set to 126.

nMaxLevel

BYTE

Maximum light control value in DALI output format (0...254). Pre-set to 254.

nPowerOnLevel

BYTE

Light control value when the supply voltage is applied to the control gear. Pre-set to 254.

nSystemFailureLevel

BYTE

Light control value in the event of an error on the DALI bus. Pre-set to 254.

eFadeTime

Tc3_DALI.E_DALIFadeTime

The FadeTime defines the time the current output value takes to reach the required value. The FadeTime is pre-set to "disabled", which together with the deactivated "Extended FadeTime" (VAR CONSTANT) corresponds to a fade time of 0 s.

eFadeRate

Tc3_DALI.E_DALIFadeRate

The Fade Rate determines the rate of change (in steps per second) of the output value. It is not decisive for the behavior of this function block. It is pre-set to 358 steps/s.

fTemperatureLimitWarmest

LREAL

Lower limit of the color temperature range in Kelvin. Pre-set to 2700 K.

fTemperatureLimitCoolest

LREAL

Upper limit of the color temperature range in Kelvin. Pre-set to 6500 K.

fPowerOnTemperature

LREAL

Color temperature value when the supply voltage is applied to the control gear. Pre-set to 3000 K.

fSystemFailureTemperature

LREAL

Color temperature value in the event of an error on the DALI bus. Pre-set to 3000 K.

VAR CONSTANT

FB_BA_LightActrDALI_TC 6:

The following parameters cannot be changed and are transferred to the DALI device by the initialization routine.

Name

Type

Description

eExtendedFadeTimeBase

Tc3_DALI.E_DALIExtendedFadeTimeBase

The Extended Fade Time is intended for very long dimming ramps of up to 16 minutes. It is disabled for this use case.

eExtendedFadeTimeBase designates the time base and is pre-set to the smallest value "Base01".

eExtendedFadeTimeMultiplier

Tc3_DALI.E_DALIExtendedFadeTimeMultiplier

eExtendedFadeTimeMultiplier is the multiplier for the time base and is set to the value "Disabled".

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.35

TF8040 | TwinCAT Building Automation from V5.0.0.0