FB_DALI102ReadMemoryBank

FB_DALI102ReadMemoryBank 1:

The specified memory bank of the DALI control gear is read (see Memory banks). The memory bank is specified by the parameter nMemoryBank. The range to be read can be limited with the help of the parameters nSubRangeStart and nSubRangeEnd.

FB_DALI102ReadMemoryBank 2:

The function block changes the DTR0 and the DTR1 of all connected DALI control gears.

FB_DALI102ReadMemoryBank 3:

While the function block is active (bBusy = TRUE), all function blocks that also have write access to the DTRs of the connected DALI control gears on the same DALI line are blocked.

FB_DALI102ReadMemoryBank 4: Inputs

VAR_INPUT
  bStart            : BOOL;
  nAddress          : BYTE;
  eAddressType      : E_DALIAddressType := E_DALIAddressType.Short;
  eCommandPriority  : E_DALICommandPriority := E_DALICommandPriority.MiddleLow;
  nOptions          : DWORD;
  bCancel           : BOOL;
  nMemoryBank       : BYTE;
  nSubRangeStart    : BYTE(0..254) := 2;
  nSubRangeEnd      : BYTE := 255;
END_VAR

Name

Type

Description

bStart

BOOL

Execution of the DALI commands is triggered via a positive edge at this input.

nAddress

BYTE

Address of a DALI control gear or a DALI group.

eAddressType

E_DALIAddressType

Defines whether the input nAddress contains a short address (0…63) or a group address (0…15). The input nAddress has no meaning if a broadcast or a broadcast to unaddressed devices (BroadcastUnaddr) has been selected.

eCommandPriority

E_DALICommandPriority

Priority (low, middle low, middle, middle high, high) with which the DALI commands are sent.

FB_DALI102ReadMemoryBank 5:

eCommandPriority has no function with the KL6811. The DALI command priorities are supported by the KL6821 from the firmware version BD.

Name

Type

Description

nOptions

DWORD

Reserved for future extensions.

bCancel

BOOL

A rising edge at this input disables the function block and aborts the reading of the variables.

nMemoryBank

BYTE

Specifies the memory bank for the read access.

nSubRangeStart

BYTE

Offset inside the memory bank from which reading is to take place.

nSubRangeEnd

BYTE

Offset inside the memory bank up to which reading is to take place.

nSubRangeEnd

Description

255

Offset 0 of the memory bank determines the offset up to which reading is to take place.

254

Offset 0 is not read at the beginning. Reading always takes place up to Offset 254.

<= 253

nSubRangeEnd may not be greater than the value in Offset 0. The partial areas of the memory bank are read with this setting.

FB_DALI102ReadMemoryBank 6: Outputs

VAR_OUTPUT
  bError                  : BOOL;
  ipResultMessage         : I_TcMessage;
  bBusy                   : BOOL;
  nCurrentOffset          : BYTE;
  nLastOffset             : BYTE;
  aValues                 : ARRAY [0..254] OF BYTE;
  aErrors                 : ARRAY [0..254] OF BOOL;
END_VAR

Name

Type

Description

bError

BOOL

This output is switched to TRUE if an error occurs during the execution. Further information about the error can be queried via the variable ipResultMessage. The output is set to FALSE again as soon as bBusy switches to TRUE.

ipResultMessage

I_TcMessage

Interface pointer (see error evaluation) that can be used to obtain detailed information about the processing of the function block (see runtime messages). The interface pointer is valid after bBusy has changed from TRUE to FALSE.

bBusy

BOOL

The output is set as soon as execution of the DALI commands has commenced. It remains active until all DALI commands have been processed.

nCurrentOffset

BYTE

The offset that is currently being read is output at this output.

nLastOffset

BYTE

Last valid offset of the memory bank that was read.

aValues

BYTE

Array containing the read parameters of the memory bank.

aErrors

BOOL

Array containing errors of the parameters of the memory bank that occurred during reading.

FB_DALI102ReadMemoryBank 7: Properties

Name

Type

Access

Initial value

Description

ipDALICommunication

I_DALICommunication

Get,Set

0

Interface Pointer to the communication block (see Transfer of the reference to the communication block).

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.10

Tc3_DALI from v3.4.0.0