FB_DALIV2SmartSPOT

FB_DALIV2SmartSPOT 1:

The function block FB_DALIV2SmartSPOT cyclically reads the status of a smartSPOT sensor or MSensor 02 and scales the measured brightness and the detected occupancy from the received value.

Two different cycle times can be specified. One cycle time that is used if no occupancy is detected and one that is used in case of occupancy. In this way access to the DALI bus can be minimized. If occupancy is detected a slower cycle time (e.g. 20 s) can usually be selected, because light control and switching off the lighting is not time-critical. If there is no occupancy, then a shorter cycle time (e.g. 2 s) should be selected. As a result, the lighting is switched on with the shortest possible reaction time when the room is entered.

The measured brightness of the sensor depends on the reflection of the furniture in the room. The measured value is only 20 % to 40 % of the actual brightness of the respective surface. Example: 500 lux on the table with a reflectivity of 30 % results in a brightness value of 150 lux. The measuring range of the sensor is designed so that the usual brightness at the workplace can be controlled from 200 lux to 1000 lux.

If the function block with MSensor 02 is to be used, it must be in slave mode.

Further information and a description of the electrical and physical properties can be found in the product description of the smartSPOT sensor or the MSensor 02.

FB_DALIV2SmartSPOT 2: Inputs

VAR_INPUT
  bReadDirectly           : BOOL := FALSE;
  tCycleTimeIfOccupancy   : TIME := t#20s;
  tCycleTimeIfNoOccupancy : TIME := t#2s;
  nAddr                   : BYTE := 0;
  eAddrType               : E_DALIV2AddrType := eDALIV2AddrTypeShort;
  eCommandPriority        : E_DALIV2CommandPriority := eDALIV2CommandPriorityMiddle;
END_VAR

Name

Type

Description

bReadDirectly

BOOL

The function block is enabled by a positive edge at this input.

tCycleTimeIfOccupancy

TIME

Cycle time if occupancy

tCycleTimeIfNoOccupancy

TIME

Cycle time if no occupancy

nAddr

BYTE

The address of a device or of a group

eAddrType

E_DALIV2AddrType

Short address, group address or broadcast

eCommandPriority

E_DALIV2CommandPriority

Priority (high, medium or low) with which the command is processed by the library.

FB_DALIV2SmartSPOT 3: Inputs/outputs

VAR_IN_OUT
  stCommandBuffer : ST_DALIV2CommandBuffer;
END_VAR

Name

Type

Description

stCommandBuffer

ST_DALIV2CommandBuffer

Reference to the internal structure for communication with FB_KL6811Communication (KL6811) or FB_KL6821Communication (KL6821).

FB_DALIV2SmartSPOT 4: Outputs

VAR_OUTPUT
  bOccupancy  : BOOL;
  nBrightness : INT;
  nRawValue   : BYTE;
  bBusy       : BOOL;
  bError      : BOOL;
  nErrorId    : UDINT;
END_VAR

Name

Type

Description

bOccupancy

BOOL

The output is set if the sensor detects occupancy.

nBrightness

INT

Measured brightness in lux

nRawValue

BYTE

The value of the sensor read before the conversion

bBusy

BOOL

When the function block is activated the output is set, and it remains active until execution of the command has been completed.

bError

BOOL

This output is switched to TRUE as soon as an error occurs during the execution of a command. The command-specific error code is contained in nErrorId. Is reset to FALSE by the execution of a command at the inputs.

nErrorId

UDINT

Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of a command at the inputs (see error codes).

Requirements

Development Environment

PLC library to include

TwinCAT from v3.1.4020.14

Tc2_DALI from v3.4.3.0