FB_DALI_Theben_TA_4_S

FB_DALI_Theben_TA_4_S 1:

This function block represents the DALI push button interface TA 4 S DALI-2 from Theben.

Up to four push buttons (instances 2 to 5) and two sliders/temperature sensors (instances 0 and 1) can be connected via the device.

The push button inputs are configured as NO contacts in the delivery state. You can change the contact type to break contact (NC) via the properties.

You can set the parameters of the two absolute inputs in the properties. 100 kOhm variable resistances can be directly connected in the delivery state.

For further information on configuration, please refer to the vendor's device documentation.

Further information on the supported instance types can be found here:

Part 301 (push buttons) – Introduction

Part 302 (absolute input devices) - Introduction

The existing parameters can be overwritten by changing the properties listed below. All parameters are written to the DALI control device by a positive edge at bInitialize and stored there.

The outputs with the output values of the DALI device only contain valid values if the function block was executed without errors (bError = FALSE). If the output bError = TRUE, the outputs with the output values must not be evaluated.

All inputs can be queried immediately via a positive edge at bQueryInputValueN and bQueryAbsoluteInputN, even if the corresponding instance is not enabled.

FB_DALI_Theben_TA_4_S 2:

Set the times so that as few events as possible are sent. If too many events are sent, this can have a negative effect on the behavior of the application.

FB_DALI_Theben_TA_4_S 3:

The function block cannot be used when using the KL6811.

FB_DALI_Theben_TA_4_S 4: Inputs

VAR_INPUT
  bInitialize                  : BOOL  := FALSE;
  nShortAddress                : BYTE  := 0;
  nOptions                     : DWORD := 0;
  bQueryInputValue1            : BOOL  := FALSE;
  bQueryInputValue2            : BOOL  := FALSE;
  bQueryInputValue3            : BOOL  := FALSE;
  bQueryInputValue4            : BOOL  := FALSE;
  bQueryAbsoluteInput1         : BOOL  := FALSE;
  bQueryAbsoluteInput2         : BOOL  := FALSE;
END_VAR

Name

Type

Description

bInitialize

BOOL

The configuration of the DALI control device is started by a positive edge at this input. During this time no DALI commands are processed.

nShortAddress

BYTE

Short address (0…63) of the DALI control device.

nOptions

DWORD

Reserved for future extensions.

bQueryInputValueN

BOOL

Immediate query of the values at the push button inputs 1 to 4.

bQueryAbsoluteInputN

BOOL

Immediate query of the values at the absolute value inputs 1 to 2.

FB_DALI_Theben_TA_4_S 5: Outputs

VAR_OUTPUT
  bError                        : BOOL;
  ipResultMessage               : I_TcMessage;
  bInitializing                 : BOOL;
  bReadingInputValue1           : BOOL;
  bReadingInputValue2           : BOOL;
  bReadingInputValue3           : BOOL;
  bReadingInputValue4           : BOOL;
  bReadingAbsoluteInputValue1   : BOOL;
  bReadingAbsoluteInputValue2   : BOOL;
  nPushButton1Event             : WORD;
  nPushButton2Event             : WORD;
  nPushButton3Event             : WORD;
  nPushButton4Event             : WORD;
  nAbsoluteInput1               : BYTE;
  nAbsoluteInput2               : BYTE;
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.

bInitializing

BOOL

The output is set as soon as the initialization of the DALI control device has been started, and remains active until all DALI commands have been executed.

bReadingValueN

BOOL

The output is TRUE as long as values of the instance of the movement sensor are being read by the DALI control device.

nPushButtonNEvent

WORD

The outputs output the events for the corresponding push button via one bit for one cycle.

Bit

Description

0

Push button released.

1

Push button pressed.

2

Short keystroke.

3

Double keystroke.

4

Start long keystroke.

5

Repeat long keystroke.

6

Stop long keystroke.

7

Push button free again; was previously blocked.

8

Push button blocked.

The function block FB_DALI_ToPushButtonState can be used to convert the state of a push button into a BOOL variable.

Name

Type

Description

nAbsoluteInputN

BYTE

Outputs that contain the measured values, [°C] or [Ω], of the connected variable resistances. Please refer to the manufacturer's documentation for the TA 4 S DALI-2 for the appropriate scaling of the output value.

FB_DALI_Theben_TA_4_S 6: Properties

All parameters that are written to the DALI control device via bInitialize are available as properties.

The properties of instances of the same type are listed only once in the table and marked with N at the end.

Name

Type

Access

Initial value

Description

bEnablePushButtonN

BOOL

Get, Set

TRUE

Push button input 1 to 4, which can be enabled or disabled on the DALI control device. FALSE on this property causes sending of events from this instance to be disabled. However, the actual value of the instance can still be queried via the input bQueryPushButtonN.

nEventFilterPushButtonN

BYTE

Get, Set

2#1000_0011

Setting of the event filter.

eEventPriorityInputN

E_DALIEventPriority

Get, Set

Middle

Setting of the event priority.

nDeadtimeTimerAbsoluteInputN

UINT

Get, Set

100 ms

Dead time (0...12750 ms) to ensure that not too many events are sent in succession. An event is only sent after expiry of the dead time timer. The dead time timer is restarted each time after an event has been sent.

nReportTimerAbsoluteInputN

BYTE

Get, Set

0 s

Time [s] after which the pending event of the absolute encoder is repeated if no other event has occurred in the meantime.

nDoubleTimerPushButtonN

UINT

Get, Set

0 ms

Time (0, tDoubleMin…2000 ms) to distinguish between a single and a double button press.

nRepeatTimerPushButtonN

UINT

Get, Set

160 ms

Interval (100…2000 ms) of repetitive events in the case of a long button press.

nShortTimerPushButtonN

UINT

Get, Set

500 ms

Time (tShortMin...5100 ms) to distinguish between a long and a short button press. tShortMin is a manufacturer-specific value.

nStuckTimerPushButtonN

BYTE

Get, Set

20 s

Time (5…255 s) after whose expiry the push button no longer represents a long button press. The push button is stuck.

nContactTypePushButtonN

BYTE

Get, Set

16#00

Push button contact type:

16#00: NO contact (delivery state)

16#FF: NC contact

bEnableAbsoluteInputN

BOOL

Get, Set

FALSE

Absolute value input 1 or 2, which can each be enabled or disabled on the DALI control device. FALSE on this property causes sending of events from this instance to be disabled. However, the actual value of the instance can still be queried via the input bQueryAbsoluteInputN.

eEventPriorityAbsoluteInputN

E_DALIEventPriority

Get, Set

Middle

Setting of the event priority.

nDeadtimeTimerAbsoluteInputN

UINT

Get, Set

100 ms

Dead time (0...12750 ms) to ensure that not too many events are sent in succession. An event is only sent after expiry of the dead time timer. The dead time timer is restarted each time after an event has been sent.

nReportTimerAbsoluteInputN

BYTE

Get, Set

0 s

Time [s] after which the pending event of the absolute encoder is repeated if no other event has occurred in the meantime.

nSensorTypeAbsoluteInputN

BYTE

Get, Set

16#03

Sensor type:
16#00: Theben sensors (9070321, 9070459, 9070489, 9070496).
16#01: Theben sensor (9070191).
16#02: any 100 kΩ NTC with known B or Beta [K] (see also value range parameter Beta Low / Beta High below).
16#03: 100 kΩ variable resistance (delivery state).

nBetaHighAbsoluteInputN

BYTE

Get, Set

16#11

If the sensor type 16#02 was selected, the associated B or Beta [K] should be set here. The B or Beta is a four-digit number in [K], which can be found on the data sheet for the NTC sensor. For storage in the memory bank, the four-digit number must first be converted to hex format and then stored in the Beta Low and Beta High bytes.
Example:
B or Beta = 4580, this corresponds to 16#11E4
• Beta Low = 16#E4, delivery state
• Beta High = 16#11, delivery state
• The adjustment range is 16#00…16#FF.

nBetaLowAbsoluteInputN

BYTE

Get, Set

16#E4

See nBetaHighAbsoluteInputN

nFilterAbsoluteInputN

BYTE

Get, Set

16#00

A filter can be set for noise suppression. The adjustment range is 16#00…16#0B.

16#00: each measured value is transmitted unchanged (delivery state)
16#01: average of 2 measured values (21).
16#02: average of 4 measured values (22).
16#03: average of 8 measured values (23).

16#09: average of 512 measured values (29).
16#0A: average of 1024 measured values (210).
16#0B: average of 2048 measured values (211).

Attention: The filter delays the measurement!

nHysteresisAbsoluteInputN

BYTE

Get, Set

16#00

Hysteresis value for the avoidance of frequent events. The adjustment range is 16#00...16#FF. This corresponds to a value range of 0.1 °C...25.5 °C for sensor types 16#00...16#02 or a value range of 100 Ω...25.5 kΩ for sensor type 16#03. The hysteresis step size is equivalent to 0.1 °C or 100 Ω.

nOffsetAbsoluteInputN

BYTE

Get, Set

16#80

The adjustment range of the offset is 16#01...16#FF. This corresponds to a value range of -12.7 °C...+12.7 °C for sensor types 16#00...16#02 or a value range of -12.7 kΩ...+12.7 kΩ for sensor type 16#03. The offset step size is equivalent to 0.1 °C or 100 Ω.

The 16#80s in the delivery state correspond to 0 °C or 0 Ω respectively.

nRangeAbsoluteInputN

BYTE

Get, Set

16#00

Setting the parameter range:

16#00: Temperature sensors with a positive temperature range (delivery state).

16#01: Temperature sensors with a negative temperature range.

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.20

Tc3_DALI from v3.8.0.0