FB_KL6811ConfigNew

The function block FB_KL6811ConfigNew is used to configure the KL6811. The configuration is executed when the PLC program starts, or it can be triggered by a positive edge at the input bConfigurate. The parameters are stored in the respective registers of the KL6811 in a fail-safe manner. In addition, some general information, such as the firmware version, is read from the KL6811.
![]()  | This function block replaces FB_KL6811Config from library version 3.6.2.0  | 
Example:
The function block is called in the same task as the function block FB_KL6811Communication.

The function block FB_KL6811ConfigNew is linked to the process image of the KL6811. Once the configuration is complete, the function block FB_KL6811CommunicationNew receives the process values of the KL6811. DALI commands cannot be sent during configuration.
Sample: DALI_Sample_KL6811Config.zip
 Inputs
VAR_INPUT
  bConfigurate                       : BOOL := FALSE;
  eOperationMode                     : E_DALIV2OperationMode := eD  ALIV2OperationModeDALI;
  bDisableInternalPowerSupply        : BOOL := FALSE;
  bEnableCountingDevicesAfterStartup : BOOL := FALSE;
  nOptions                           : DWORD := 0;
END_VARName  | Type  | Description  | 
|---|---|---|
bConfigurate  | BOOL  | Configuration of the bus terminal is started by a positive edge at this input.  | 
eOperationMode  | Defines the operation mode of the terminal (DALI or DSI). Corresponds to register 32, bits 12 to 15 of the bus terminal.  | |
bDisableInternalPowerSupply  | BOOL  | If this input is TRUE, the internal DALI power supply of the terminal is disabled by the configuration. Corresponds to register 32, bit 3 of the bus terminal.  | 
bEnableCountingDevicesAfterStartup  | DWORD  | If this input is TRUE, the number of DALI devices is counted when the terminal starts. Corresponds to register 32, bit 4 of the bus terminal.  | 
nOptions  | DWORD  | Reserved for future developments.  | 
 Inputs/outputs
VAR_IN_OUT
  stInDataTerminal  : ST_KL6811InData;
  stOutDataTerminal : ST_KL6811OutData;
  stInData          : ST_KL6811InData;
  stOutData         : ST_KL6811OutData;
END_VARName  | Type  | Description  | 
|---|---|---|
stInDataTerminal  | Reference to the structure for communication with the KL6811.  | |
stOutDataTerminal  | Reference to the structure for communication with the KL6811.  | |
stInData  | Reference to the structure for communication with the function block FB_KL6811Communication.  | |
stOutData  | Reference to the structure for communication with the function block FB_KL6811Communication.  | 
 Outputs
VAR_OUTPUT
  bBusy                : BOOL;
  bError               : BOOL;
  nErrorId             : UDINT;
  nTerminalDescription : WORD;
  nFirmwareVersion     : WORD;
  sDescription         : STRING;
END_VARName  | Type  | Description  | 
|---|---|---|
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).  | 
nTerminalDescription  | WORD  | Contains the terminal name (e.g. 6811). Corresponds to register 8 of the bus terminal.  | 
nFirmwareVersion  | WORD  | Contains the firmware version. Corresponds to register 9 of the bus terminal.  | 
sDescription  | STRING  | Terminal name and firmware version as string (e.g. "Terminal KL6811 / Firmware 2H").  | 
Requirements
Development Environment  | PLC library to include  | 
|---|---|
TwinCAT from v3.1.4022.4  | Tc2_DALI from v3.6.2.0  | 
