FB_DALI_Esylux_PD_C_360_BMS

FB_DALI_Esylux_PD_C_360_BMS 1:

The function block FB_DALI_Esylux_PD_C_360_BMS represents the DALI sensors PD-C 360/8 BMS DALI-2, PD-C 360/24 BMS DALI-2 and PD-C 360/32 BMS DALI-2 from Esylux.

This outputs two push button signals (instances 0 to 1), an occupancy signal (instance 2) and a measured brightness value (instance 3).

Further information on the supported instance types can be found here:

Part 301 (push buttons) – Introduction

Part 303 (occupancy sensors) – Introduction

Part 304 (light sensors) – Introduction

The existing parameters can be overwritten by changing the properties listed below. All parameters are written to the DALI control device by a positive edge at bInitialize and stored there.

The outputs with the output values of the DALI device only contain valid values if the function block was executed without errors (bError = FALSE). If the output bError = TRUE, the outputs with the output values must not be evaluated.

The reading can be triggered immediately via the input variables bQueryPushButtonN, bQueryOccupancy and bQueryBrightness, even if the corresponding instance is not enabled.

FB_DALI_Esylux_PD_C_360_BMS 2:

Set the times so that as few events as possible are sent. If too many events are sent, this can have a negative effect on the behavior of the application.

FB_DALI_Esylux_PD_C_360_BMS 3:

The function block cannot be used when using the KL6811.

ALS correction factor

During commissioning, it may be necessary to calibrate the brightness measurement. The ALS (ambient light sensor) parameters required for this can be changed via the properties. The function block transmits the individual ALS parameters (0.1...5.0) to the light sensor integrated in the DALI control device, where they are also stored. The correction factor of a light sensor is determined at 100 and 500 lux on the floor. For details on calibration, please refer to the vendor's documentation.

FB_DALI_Esylux_PD_C_360_BMS 4: Inputs

VAR_INPUT
  bInitialize                : BOOL  := FALSE;
  nShortAddress              : USINT := 0;
  nOptions                   : DWORD := 0;
  bQueryPushButton1          : BOOL  := FALSE;
  bQueryPushButton2          : BOOL  := FALSE;
  bQueryOccupancy            : BOOL  := FALSE;
  bQueryBrightness           : BOOL  := FALSE;
  bCancelHoldTimerOccupancy  : BOOL  := FALSE;
END_VAR

Name

Type

Description

bInitialize

BOOL

The configuration of the DALI control device is started by a positive edge at this input. During this time no DALI commands are processed.

nShortAddress

USINT

Short address (0…63) of the DALI control device.

nOptions

DWORD

Reserved for future extensions.

bQueryPushButtonN

BOOL

The state of the push button is queried immediately by a positive edge at this input.

bQueryOccupancy

BOOL

The occupancy is queried immediately by a positive edge at this input.

bQueryBrightness

BOOL

The brightness is queried immediately by a positive edge at this input.

bCancelHoldTimerOccupancy

BOOL

A positive edge at this input prematurely ends the Hold Timer and resets the output bOccupied.

FB_DALI_Esylux_PD_C_360_BMS 5: Outputs

VAR_OUTPUT
  bError                     : BOOL;
  ipResultMessage            : I_TcMessage;
  bInitializing              : BOOL;
  bReadingPushButton1        : BOOL;
  bReadingPushButton2        : BOOL;
  bReadingOccupancy          : BOOL;
  bReadingBrightness         : BOOL;
  nPushButton1Event          : WORD
  nPushButton2Event          : WORD
  bOccupied                  : BOOL;
  nBrightnessLevel           : UINT;
END_VAR

Name

Type

Description

bError

BOOL

This output is switched to TRUE if an error occurs during the execution. Further information about the error can be queried via the variable ipResultMessage. The output is set to FALSE again as soon as bBusy switches to TRUE.

ipResultMessage

I_TcMessage

Interface pointer (see error evaluation) that can be used to obtain detailed information about the processing of the function block (see runtime messages). The interface pointer is valid after bBusy has changed from TRUE to FALSE.

bInitializing

BOOL

The output is set as soon as the initialization of the DALI control device has been started, and remains active until all DALI commands have been executed.

bReadingPushButtonN

BOOL

The output is TRUE as long as values of the instance of the push button are being read by the DALI control device.

bReadingOccupancy

BOOL

The output is TRUE as long as values of the instance of the motion sensor are being read by the DALI control device.

bReadingBrightness

BOOL

The output is TRUE as long as values of the instance of the light sensor are being read by the DALI control device.

nPushButtonNEvent

WORD

The output outputs the events for the corresponding push button via one bit for one cycle.

Bit

Description

0

Push button released.

1

Push button pressed.

2

Short keystroke.

3

Double keystroke.

4

Start long keystroke.

5

Repeat long keystroke.

6

Stop long keystroke.

7

Push button free again; was previously blocked.

8

Push button blocked.

The function block FB_DALI_ToPushButtonState can be used to convert the state of a push button into a BOOL variable.

Name

Type

Description

bOccupied

BOOL

If the output is TRUE, then occupancy has been detected in the detection range of the occupancy sensor.

nBrightnessLevel

UINT

Measured brightness value of the light sensor.

FB_DALI_Esylux_PD_C_360_BMS 6:

This measured value must be compared with the measured reference values at the place of operation of the DALI control device.

FB_DALI_Esylux_PD_C_360_BMS 7: Properties

All parameters that are written to the DALI control device via bInitialize are available as properties.

The properties of instances of the same type are listed only once in the table and marked with N at the end.

Name

Type

Access

Initial value

Description

bEnableBrightness

BOOL

Get, Set

TRUE

TRUE at this property enables the instance for brightness measurement. FALSE on this property causes sending of events from this instance to be disabled. However, the actual value of the instance can still be queried via the input bQueryBrightness.

bEnableOccupancy

BOOL

Get, Set

TRUE

TRUE at this property enables the instance for motion detection. FALSE on this property causes sending of events from this instance to be disabled. However, the actual value of the instance can still be queried via the input bQueryOccupancy.

bEnablePushButtonN

BOOL

Get, Set

FALSE

Push button input 1 or 2, which can be enabled or disabled on the DALI control device. FALSE on this property causes sending of events from this instance to be disabled. However, the actual value of the instance can still be queried via the input bQueryPushButtonN.

eEventPriorityBrightness

E_DALIEventPriority

Get, Set

MiddleLow

Setting of the event priority.

fALS0CorrectionFactor100

LREAL

Get, Set

1.0

Correction factor (0.1…5.0) of light sensor 0 at a measured value of 100 lux on the surface to be measured.

fALS0CorrectionFactor500

LREAL

Get, Set

1.0

Correction factor (0.1…5.0) of light sensor 0 at a measured value of 500 lux on the surface to be measured.

fALS1CorrectionFactor100

LREAL

Get, Set

1.0

Correction factor (0.1…5.0) of light sensor 1 at a measured value of 100 lux on the surface to be measured.

fALS1CorrectionFactor500

LREAL

Get, Set

1.0

Correction factor (0.1…5.0) of light sensor 1 at a measured value of 500 lux on the surface to be measured.

nReportTimerBrightness

USINT

Get, Set

30 s

Time (0…255 s) after which the pending event of the light sensor is repeated if no other event has occurred in the meantime.

nDeadtimeTimerBrightness

UINT

Get, Set

1500 ms

Dead time (0...12750 ms) to ensure that not too many events are sent in succession. An event is only sent after expiry of the dead time timer. The dead time timer is restarted each time after an event has been sent.

nHysteresisBrightness

USINT

Get, Set

5 %

Value (0…25 %) for calculating a hysteresis value in order to prevent frequent and disturbing changes when measuring the brightness.

nHysteresisMinBrightness

USINT

Get, Set

40

As the percentage hysteresis can also lead to large fluctuations at low brightness, a minimum hysteresis can be specified via this property. The minimum hysteresis is an absolute value with a range from 0 to 255.

eEventPriorityOccupancy

E_DALIEventPriority

Get, Set

Middle

Setting of the event priority.

nDeadtimeTimerOccupancy

UINT

Get, Set

100 ms

Dead time (0...12750 ms) to ensure that not too many events are sent in succession. An event is only sent after expiry of the dead time timer. The dead time timer is restarted each time after an event has been sent.

nHoldTimerOccupancy

UINT

Get, Set

900 s

Hold time (1...2538 s) during which the occupancy is still active after no further motion was detected by the sensor.

nReportTimerOccupancy

USINT

Get, Set

60 s

Time (0…255 s) after which the pending event of the occupancy sensor is repeated if no other event has occurred in the meantime.

nSensitivityOccupancy

USINT

Get, Set

95

Adjustment of the sensitivity of the occupancy sensor instance from 0 (low sensitivity) to 100 (high sensitivity).

nEventFilterPushButtonN

BYTE

Get, Set

2#1000_0011

Setting of the event filter.

eEventPriorityPushButtonN

E_DALIEventPriority

Get, Set

Middle

Setting of the event priority.

nDoubleTimerPushButtonN

UINT

Get, Set

0 ms

Time (0, tDoubleMin…2000 ms) to distinguish between a single and a double button press.

nRepeatTimerPushButtonN

UINT

Get, Set

160 ms

Interval (100…2000 ms) of repetitive events in the case of a long button press.

nShortTimerPushButtonN

UINT

Get, Set

500 ms

Time (tShortMin...5100 ms) to distinguish between a long and a short button press. tShortMin is a manufacturer-specific value.

nStuckTimerPushButtonN

USINT

Get, Set

20 s

Time (5…255 s) after whose expiry the push button no longer represents a long button press. The push button is stuck.

bModeLED

BOOL

Get, Set

TRUE

LED mode:
FALSE: LED disabled
TRUE: LED enabled

nBrightnessLED

USINT

Get, Set

50

LED brightness (5...100 %).

ipDALICommunication

I_DALICommunication

Get, Set

0

Interface pointer to the communication block (see Transfer of the reference to the communication block).

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.50

Tc3_DALI from v3.17.1.0