FB_DALI303OccupancySensor

FB_DALI303OccupancySensor 1:

The function block is used for the configuration and operation of an instance of a DALI control device that supports Part 303 (occupancy sensor).

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

Part 303 (occupancy sensors) – Introduction

If necessary, the output value can also be queried immediately via the variable bQueryInputValue, even if the corresponding instance is not enabled.

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.

FB_DALI303OccupancySensor 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_DALI303OccupancySensor 3:

The function block cannot be used when using the KL6811.

FB_DALI303OccupancySensor 4: Inputs

VAR_INPUT
  bInitialize                 : BOOL  := FALSE;
  nShortAddress               : BYTE  := 0;
  nInstanceNumber             : BYTE  := 0;
  bQueryInputValue            : BOOL  := FALSE;
  bGetInputNotifications      : BOOL  := TRUE;
  bCancelHoldTimer            : BOOL  := FALSE;
  nOptions                    : DWORD := 0;
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

BYTE

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

nInstanceNumber

BYTE

Number of the instance (0…31) of the DALI control device to be addressed.

bQueryInputValue

BOOL

The state of the input is queried immediately by a positive edge at this input. A query is possible even if the instance is disabled via the bEnableInstance property.

bGetInputNotifications

BOOL

A TRUE at this input causes the received Input Notification Events to be output at the output.

bCancelHoldTimer

BOOL

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

nOptions

DWORD

Reserved for future extensions.

FB_DALI303OccupancySensor 5: Outputs

VAR_OUTPUT
  bError                  : BOOL;
  ipResultMessage         : I_TcMessage;
  bInitializing           : BOOL;
  bReadingInputValue      : BOOL;
  bOccupied               : BOOL;
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.

bReadingInputValue

BOOL

The output is set as soon as the manual reading of the measured value has been started and remains active until all DALI commands have been processed.

bOccupied

BOOL

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

FB_DALI303OccupancySensor 6: Properties

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

Name

Type

Access

Initial value

Description

bEnableInstance

BOOL

Get, Set

TRUE

The instance can be enabled or disabled on the DALI control device. If this property is FALSE, sending events from this instance is disabled. However, the actual value of the instance can still be queried via the input bQueryInputValue.

nEventFilter

BYTE

Get, Set

2#0000_0111

Setting of the event filter.

eEventPriority

E_DALIEventPriority

Get, Set

Middle

Setting of the event priority.

nDeadtimeTimer

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 an event is sent.

nHoldTimer

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.

nReportTimer

BYTE

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.

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.11

Tc3_DALI from v3.5.0.0