Programming

Notice

Tc3_DALI

A current Tc3_Dali library is required to ensure the function of the light solution. A minimum version of 3.21.2.0 is required.

The Lighting Solution application consists of 2 PLC programs. The program BA_LS in a slower task and the DALI communication program BA_LS_Dali_Communication in a faster task. Key hardware data is specified in the parameter settings of the library. This includes the number of bus couplers, the number of DALI lines and their distribution to the bus couplers.

Programming 1:
Programming 2:

Syntax

nNumberOfDaliLines        : INT(1..50)    := 10;
nNumberOfCoupler : INT(0..10) := 1;
sCX_DaliLines : T_MaxString := '';
sCoupler_1_DaliLines : T_MaxString := '1,2';
sCoupler_2_DaliLines : T_MaxString := '';
sCoupler_3_DaliLines : T_MaxString := '';
sCoupler_4_DaliLines : T_MaxString := '';
sCoupler_5_DaliLines : T_MaxString := '';
sCoupler_6_DaliLines : T_MaxString := '';
sCoupler_7_DaliLines : T_MaxString := '';
sCoupler_8_DaliLines : T_MaxString := '';
sCoupler_9_DaliLines : T_MaxString := '';
sCoupler_10_DaliLines : T_MaxString := '';
sBackupData_Pin : STRING(10) := '1909';
sRestoreData_Pin : STRING(10) := '1909';
sBackupDefaultData_Pin : STRING(10) := '7007';
sRestoreDefaultData_Pin : STRING(10) := '7007';
sPath_Data : STRING(100) := '\Hard Disk\ftp\';
sPath_USB : STRING(100) := 'Hard Disk2\';
sPath_Energy : STRING(100) := '\Hard Disk\ftp\';

Parameter

Name

Type

Description

nNumberOfDaliLines

INT

Enter the exact number of KL6821/EL6821.

nNumberOfCoupler

INT

Enter the number of bus couplers.

sCX_DaliLines

T_MaxString

Indication of all DALI lines connected to the CX.

sCoupler_1_DaliLines

T_MaxString

Specification of all DALI lines connected to the 1st bus coupler.

sCoupler_2_DaliLines

T_MaxString

Specification of all DALI lines connected to the 2nd bus coupler.

sBackupData_Pin

STRING

PIN for saving the configuration (basic setting).

sRestoreData_Pin

STRING

PIN for loading the configuration (basic setting).

sBackupDefaultData_Pin

STRING

PIN for saving the configuration (backup).

sRestoreDefaultData_Pin

STRING

PIN for loading the configuration (backup).

sPath_Data

STRING

FTP storage location

sPath_USB

STRING

USB storage location

sPath_Energy

STRING

Energy storage location

Param_Interfaces

Name

Type

Description

nNumberOfKNX_Terminals

INT

Enter the exact number of KL6301.

nNumberOfEnOcean_Terminals

INT

Enter the exact number of KL6581.

Global variables

GVL_LS

Name

Type

Description

bManualMode

BOOL

Broadcast: Manual Mode is activated across all lines.

nManualMode_Slider

BYTE

Broadcast: The Manual Mode value is described for all lines.

nGroup_Value

ARRAY OF BYTE

Group: The group is set to Manual Mode when the value is changed and adopts the value.

bGroup_ManMod_Reset

ARRAY OF BOOL

Resets the Manual Mode of the group.

nGroup_ExternalValue

ARRAY OF BYTE

Can be written with a DALI value. The group assumes the highest value of internal and external requirements.

bArea_Enable

ARRAY OF BOOL

Enables the corresponding area (1-10).

stAlarm

ARRAY OF ST_Alarm

stAlarm.bALarm: Activates the display of the alarm.

stAlarm.sName: Display text of the alarm.

The following data points are exclusively read-only. The data points are intended only for information purposes.

Name

Type

Description

bGroup_Presence

ARRAY OF BOOL

Group: Summarized presence (current, delay time 1, delay time 2).

nGroup_ActValue

ARRAY OF BYTE

Group: Current luminous intensity in DALI.

bGroup_Enabled

ARRAY OF BOOL

Group: Enabled/Disabled.

nGroup_Brightness

ARRAY OF INT

Group: Current brightness value of the sensors.

nGroup_Setpoint

ARRAY OF INT

Group: Current setpoint.

sGroup_Name

ARRAY OF STRING

Group: Name of the group.

bArea_Enabled

ARRAY OF BOOL

Feedback of the active areas.

bDaliLine_Lamp_Error

ARRAY OF BOOL

Lamps: Collective error message for lamps per line.

bDaliLine_Sensor_Error

ARRAY OF BOOL

Sensors: Collective error message sensors per line.

rLamps_Operating_hours

ARRAY OF REAL

Lamps: operating hours

nLamps_ActValue

ARRAY OF BYTE

Lamp: Current luminous intensity in DALI

sLamps_Error

ARRAY OF STRING

Lamp: Error text

sLamps_Name

ARRAY OF STRING

Lamp: Name of the lamp

nLamps_Groups

ARRAY OF INT

Lamp: Specification of associated groups.

bSensor_Presence

ARRAY OF BOOL

Sensor: Current presence

bSensor_Button

ARRAY OF BOOL

Sensor: State of the button inputs (1-8) of a sensor.

nSensor_ActValue

ARRAY OF INT

Sensor: Current brightness value of the sensors.

sSensor_Error

ARRAY OF STRING

Sensor: Error text

sSensor_Name

ARRAY OF STRING

Sensor: Name of the sensor

sSwitch_Name

ARRAY OF STRING

Switch: Name of the switch

sSwitch_Dali_Error

ARRAY OF STRING

DALI switch: Error text

sSwitch_Dali_Name

ARRAY OF STRING

DALI switch: Name of the push button coupler.

rEnergy_AverageValue

ARRAY OF REAL

Energy measurement: Quarter-hourly values over the last 24 hrs.

stEnergy_Data

ARRAY OF ST_LS_Power

Energy measurement: Output of measured values (see ST_LS_Power).

nTemperature_HCL

INT

HCL color temperature

Structure for the further use of the measured energy values:

TYPE INTERNAL ST_LS_Power :
STRUCT
fIL1, fIL2, fIL3          :.LREAL;
fIg                       : LREAL;
fUL1, fUL2, fUL3          : LREAL;
fPL1, fPL2, fPL3          : LREAL;
fPg                       : LREAL;
fCosPhiL1, fCosPhiL2, fCosPhiL3: LREAL;
fCosPhi                   : LREAL;
fWL1, fWL2, fWL3          : LREAL;
fWg                       : LREAL;
fImaxL1, fImaxL2, fImaxL3 : LREAL;
fUmaxL1, fUmaxL2, fUmaxL3 : LREAL;
fPmaxL1, fPmaxL2, fPmaxL3 : LREAL;
fSg                       : LREAL;
fQg                       : LREAL;
fFrequencyL1, fFrequencyL2, fFrequencyL3 : LREAL;
END_STRUCT
END_TYPE

GVL_LS_IO

The following data points must be linked accordingly with the hardware.

Name

Type

Description

stDali_KL6821In

ARRAY OF ST_KL6821InData

Connect inputs to KL6821.

stDali_KL6821Out

ARRAY OF ST_KL6821OutData

Connect outputs to KL6821.

stDali_EL6821In

ARRAY OF ST_EL6821InData

Connect inputs to EL6821.

stDali_EL6821Out

ARRAY OF ST_EL6821OutData

Connect outputs to EL6821.

stKNX_Terminal

ARRAY OF ST_KNX_Terminal

Connect inputs and outputs to KL6301.

stEnOcean_Terminal

ARRAY OF ST_EnOcean_Terminal

Connect inputs and outputs to KL6581.

wIn_CX_State

WORD

Link input with CX.

wOut_CX_Ctrl

WORD

Link output with CX.

wIn_BK_CouplerState

ARRAY OF WORD

Link input with coupler "x".

wIn_BK_BoxState

ARRAY OF WORD

Link input with coupler "x".

wIn_BK_MissedCnt

ARRAY OF WORD

Link input with coupler "x".

wOut_BK_BoxCtrl

ARRAY OF WORD

Link output with coupler "x".

bSwitch

ARRAY OF BOOL

Inputs of switches, KNX, Modbus, EnOcean®, etc. can be linked here.

bSwitch_FB

ARRAY OF BOOL

Switch feedback according to the index from bSwitch.

bIn_Sensor_Presence

ARRAY OF BOOL

Input for "External Input" mode with the sensors to switch presence. Conventional detectors or self-defined logics can be linked here.

nIn_Sensor_Brightness

ARRAY OF INT

Input for "External Input" mode with the sensors to transfer the brightness. Conventional detectors or self-defined logics can be linked here.

bCircuit

ARRAY OF BOOL

Switching output

nCircuit_Percent

ARRAY OF INT

Switching: Output value in percent

nCircuit_analog

ARRAY OF INT

Circuit: Output value in 0-32767

nCircuit_DMX

ARRAY OF BYTE

Circuit: Output value in 0-255

stIn_KL3403

ARRAY OF ST_KL3403_IN

Connect input structure to KL3403.

stOut_KL3403

ARRAY OF ST_KL3403_OUT

Connect output structure to KL3403.

bSoft_Error

BOOL

Output of collective error message for lamps and sensors.

bHard_Error

BOOL

Output of hardware errors.
Output is constantly on; the output automatically switches off if the components fail.

bEmergencyLights_Error

BOOL

Output is on if the last function test of the emergency lights was faulty.