Programming

Note
Tc2_DALI

A current Tc2_Dali library is required to ensure the function of the light solution. A minimum version of 3.6.18.0 is required.

 

Description

The Light 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. The number of Dali lines is specified in the library parameter settings.

 

Parameter

Programming 1:

 

    nNumberOfDaliLines        : INT(1..50) :=3;
    sBackupData_Pin           : STRING(10) :='1909';
    sRestoreData_Pin          : STRING(10) :='1909';
    sBackupDefaultData_Pin    : STRING(10) :=' ';
    sRestoreDefaultData_Pin   : STRING(10) :=' ';
    sPath_Data                : STRING(100):='\Hard Disk\ftp\';
    sPath_USB                 : STRING(100):='Hard Disk2\';
    sPath_Energy              : STRING(100):='Hard Disk\ftp\';

nNumberOfDaliLines

Input of the exact number to the KL6821

sBackupData_Pin

PIN for saving the configuration (basic setting).

sRestoreData_Pin

PIN for loading the configuration (basic setting).

sBackupDefaultData_Pin

PIN for saving the configuration (factory setting).

sRestoreDefaultData_Pin

PIN for loading the configuration (factory setting).

sPath_Data

FTP storage location

sPath_USB

USB storage location

sPath_Energy

Energy storage location

 

Global variables

GVL_LS

bManualMode

Broadcast: Manual operation is enabled.

nManualMode_Slider

Broadcast: The manual operation value is described.

nGroup_Value

Group: The group is set to manual mode when the value is changed and assumes the value.

stAlarm

stAlarm.bALarm: Enables the alarm display

stAlarm.sName: Display text of the alarm

 

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

stDaliCommandBuffer

Command buffer of all Dali terminals created, for further use. Note The function of LS can be massively disturbed if used incorrectly!

bGroup_Presence

Group: Summarized presence (current, overrun time 1, overrun time 2)

nGroup_ActValue

Group: Current luminous intensity in Dali

bGroup_Enabled

Group: Enabled/disabled

nGroup_Brightness

Group: Current brightness value of the sensors

nGroup_Setpoint

Group: Current setpoint

sGroup_Name

Group: Name of the group

bDaliLine_Lamp_Error

Lamps: Collective error message lamps per line

bDaliLine_Sensor_Error

Sensors: Collective error message sensors per line

rLamps_Operating_hours

Lamp: Operating hours

nLamps_ActValue

Lamp: Current luminous intensity in Dali

sLamps_Error

Lamp: Error text

sLamps_Name

Lamp: Name of the lamp

nLamps_Groups

Lamp: Specification of associated groups

bSensor_Presence

Sensor: Current presence

nSensor_ActValue

Sensor: Current brightness value of the sensors

sSensor_Error

Sensor: Error text

sSensor_Name

Sensor: Name of the sensor

sSwitch_Name

Push button: Name of the push button

sSwitch_Dali_Error

Dali push button: Error text

sSwitch_Dali_Name

Dali push button: Name of the push button coupler

rEnergy_AverageValue

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

stEnergy_Data

Energy measurement: Output of measured values (see ST_LS_Power)

nTemperature_HCL

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.

stDali_In

Connect inputs to KL6821.

stDali_Out

Connect outputs to KL6821.

bSwitch

Inputs from push buttons, KNX, Modbus, EnOcean, etc. can be linked here.

bSwitch_FB

Push button feedback according to the index from bSwitch.

bIn_Sensor_Presence

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

nIn_Sensor_Brightness

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

bCircuit

Circuit output

nCircuit_Percent

Circuit: Output value in percent

nCircuit_analog

Circuit: Output value in 0-32767

nCircuit_DMX

Circuit: Output value in 0-255

stIn_KL3403

Place input structure on KL3403.

stOut_KL3403

Place output structure on KL3403.

bSoft_Error

Output of collective error message for lamps and sensors.

bHard_Error

Output of hardware errors.

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