FB_DALIV2GetSettingsSingleDevice

FB_DALIV2GetSettingsSingleDevice 1:

This block reads the variables (MIN LEVEL, MAX LEVEL, FADE TIME, ...) of a single DALI-device and saves them in a structure of the type ST_DALIV2DeviceSettings.

With a positive edge at the input bStart the function-block begins its operation, reads all values one after another out of the addressed device and stores them into ST_DALIV2DeviceSettings. If an error occurs, the specific bit of the variable nErrors in the structure will be set. The following table gives an overview of all possible errors:

Bit

Error

0

An error occurred whilst attempting to seek the ballast.

1

Error whilst reading the variable ACTUAL DIM LEVEL

2

Error whilst reading the variable POWER ON LEVEL

3

Error whilst reading the variable SYSTEM FAILURE LEVEL

4

Error whilst reading the variable MIN LEVEL

5

Error whilst reading the variable MAX LEVEL

6

Error whilst reading the variable FADE RATE

7

Error whilst reading the variable FADE TIME

8

Error whilst reading the variable RANDOM ADDRESS

9

Error whilst reading the variables GROUP 0-7 and GROUP 8-15

10

Error whilst reading the variables SCENE 0 to SCENE 15

11

Error whilst reading the variable STATUS INFORMATION

12

Error whilst reading the variable VERSION NUMBER

13

Error whilst reading the variable DEVICE TYPE

14

Error whilst reading the variable PHYSICAL MIN LEVEL

When the function block has been processed, the bBusy output changes from TRUE to FALSE.

VAR_INPUT

bStart            : BOOL;
bCancel           : BOOL;
eCommandPriority  : E_DALIV2CommandPriority := eDALIV2CommandPriorityMiddle;
nOptions          : DWORD;

bStart: The block is activated by a rising edge at this input.

bCancel: A rising edge at this input will deactivate the block and hence abort the reading of the variable.

nAddr: The address of the device, which values shall be read.

eCommandPriority: The priority (high, middle, low) this command has when executed by the library.

nOptions: Options for reading the variables (see table). The individual constants must be linked with OR operators.

Constants

Description

DALIV2_OPTION_ACTUAL_DIM_LEVEL

The variable ACTUAL DIM LEVEL

DALIV2_OPTION_POWER_ON_LEVEL

The variable POWER ON LEVEL

DALIV2_OPTION_SYSTEM_FAILURE_LEVEL

The variable SYSTEM FAILURE LEVEL

DALIV2_OPTION_MIN_LEVEL

The variable MIN LEVEL

DALIV2_OPTION_MAX_LEVEL

The variable MAX LEVEL

DALIV2_OPTION_FADE_RATE_FADE_TIME

The variables FADE RATE and FADE TIME

DALIV2_OPTION_RANDOM_ADDRESS

The variable RANDOM ADDRESS

DALIV2_OPTION_GROUPS

The variables GROUP 0-7 and GROUP 8-15

DALIV2_OPTION_SCENE_LEVELS

The variables SCENE 0 to SCENE 15

DALIV2_OPTION_STATUS_INFORMATION

The variable STATUS INFORMATIO

DALIV2_OPTION_VERSION_NUMBER

The variable VERSION NUMBER

DALIV2_OPTION_DEVICE_TYPE

The variable DEVICE TYPE

DALIV2_OPTION_PHYSICAL_MIN_LEVEL

The variable PHYSICAL MIN LEVEL

DALIV2_OPTION_DONT_CLEAR_DEVICE_SETTINGS

Before reading doesn't delete the variable stDALIDeviceSettings.

DALIV2_OPTION_ALL

All variables are read.

VAR_OUTPUT

bBusy          : BOOL;
bError         : BOOL;
nErrorId       : UDINT;

bBusy: When the block is activated the output is set, and it remains active until execution of the command has been completed.

bError: This output is switched to TRUE if 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 an instruction at the inputs.

nErrorId: Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of an instruction at the inputs. See Error codes.

VAR_IN_OUT

stCommandBuffer      : ST_DALIV2CommandBuffer;
stDALIDeviceSettings : ST_DALIV2DeviceSettings;

stCommandBuffer: A reference to the structure for communication with the FB_DALIV2Communication() (KL6811) or FB_KL6821Communication() (KL6821) block.

stDALIDeviceSettings: A reference to the structure of type ST_DALIV2DeviceSettings. The settings of the DALI ballast are stored in these variable.