FB_DALIV2xBEGLuxomat

FB_DALIV2xBEGLuxomat 1:
FB_DALIV2xBEGLuxomat 2:

The function block FB_DALIV2xBEGLuxomat serves as an example and is 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.

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

The DALI control device occupies a short address and contains two instances. Instance 0 is the motion 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 cyclically. Each instance can be disabled individually as required.

Download the TwinCAT 3 PLCopenXML file: FB_DALIV2xBEGLuxomat.zip

FB_DALIV2xBEGLuxomat 3: Inputs

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;
END_VAR

Name

Type

Description

bInitialize

BOOL

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

nAddr

BYTE

The address of a device or of a group

bPIREnable

BOOL

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

nPIRHold

BYTE

Parameter: Sets the value for the Hold Timer. 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

BYTE

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. A value of 0 deactivates the Report Timer. This means that times of up to 4 min 15 s (value 255) are possible.

bLSEnable

BOOL

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

tLSCycleTime

TIME

Cycle time in which the current actual value of the light sensor is read.

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

FB_DALIV2xBEGLuxomat 4: 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_KL6821Communication (KL6821).

FB_DALIV2xBEGLuxomat 5: Outputs

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

Name

Type

Description

bInitializing

BOOL

This output is TRUE during initialization.

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.

nErrorId

UDINT

Contains the command-specific error code of the most recently executed command (see error codes).

 

nInputDeviceError

BYTE

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

bPIROccupied

BOOL

This output indicates the status of the motion sensor.

nActualLightLevel

UINT

This output indicates the status of the light sensor.

Requirements

Development Environment

PLC library to include

TwinCAT from v3.1.4022.4

Tc2_DALI from v3.6.2.0