FB_DALIV2xBEGLuxomat

FB_DALIV2xBEGLuxomat 1:

FB_DALIV2xBEGLuxomat 2:

This function block is used as an example and is therefore not included in the library. The function block can be downloaded as an export file and imported into the desired project. Adjustments can be made as required.

This function block evaluates the measured brightness and presence of the B.E.G. Luxomat DALI control device. This function block can also be used to initialize the DALI control units.

The DALI control unit occupies a short address and contains two instances. Instance 0 is the movement sensor and complies with the IEC 62386-303 standard. The light sensor is stored in Instance 1 and complies with the IEC 62386-304 standard.

A detected movement is sent as an event while the brightness is read out cyclically. Each instance can be decoded individually as required.

Download the TwinCAT 2 PLC Control export file: FB_DALIV2xBEGLuxomat.zip

VAR_INPUT

bInitialize       : BOOL := FALSE;
nAddr             : BYTE;
(* Occupancy Sensor Parameters *)
bPIREnable        : BOOL := TRUE;
nPIRHold          : BYTE := 1;   (* 10 s *)
nPIRReport        : BYTE := 30;  (* 30 s *)
(* Light Sensor Parameters *)
bLSEnable         : BOOL := TRUE;
tLSCycleTime      : TIME := t#1m;

bInitialize: The DALI controller is initialized by a positive edge at this input. The parameters are written to the DALI control unit, which must be accessible via the short address nAddr. The output bInitializing is TRUE during initialization.

nAddr: Short address of the DALI control unit.

bPIREnable: Parameter: If this input is TRUE, the motion sensor (instance 0) is enabled. The occupancy sensor is disabled by FALSE.

nPIRHold: Parameter: Sets the Hold Timer value. If no movement is detected, the status of the motion sensor is only changed after the Hold Timer has expired. The unit is 10 s. This means that times of up to 42 min 20 s (value 254) are possible. The value 0 corresponds to 1 s while the value 255 is ignored.

nPIRReport: Parameter: Sets the value for the Report Timer. The motion sensor status is retransmitted after the Report Timer has expired, even if the status has not changed. The unit is 1 s. The value 0 disables the Report Timer. This means that times of up to 4 min 15 s (value 255) are possible.

bLSEnable: Parameter: If this input is TRUE, the brightness sensor (instance 1) is enabled. The brightness sensor is disabled by FALSE.

tLSCycleTime: Cycle time in which the current actual value of the brightness sensor is read out.

Further details on the parameters can be found in the IEC 62386 standard and the manufacturer's documentation.

VAR_OUTPUT

bInitializing         : BOOL;
bError                : BOOL;
nErrorId              : UDINT;
nInputDeviceError     : BYTE;
(* Occupancy Sensor *)
bPIROccupied          : BOOL;
(* Light Sensor *)
nActualLightLevel     : UINT;

bInitializing: This output is TRUE during initialization.

bError: 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.

nErrorId: Contains the command-specific error code of the most recently executed command. See Error codes.

nInputDeviceError: The status of the DALI control unit (INPUT DEVICE ERROR) is queried before the initialization. 0 means no error. The individual error numbers are manufacturer-specific.

bPIROccupied: This output indicates the status of the motion sensor.

nActualLightLevel: This output indicates the status of the brightness sensor.

VAR_IN_OUT

stCommandBuffer   : ST_DALIV2CommandBuffer;

stCommandBuffer: Reference to the internal structure for communication with the function block FB_KL6821Communication() (KL6821).

Requirements

Development environment

Target system

Required libraries

TwinCAT 2.11 R3/x64 from build 2260

PC/CX, BX or BC

TcDALIV2 library from V2.12.0