FB_DALI306GeneralPurposeSensor

FB_DALI306GeneralPurposeSensor 1:

The function block is used for the configuration and operation of an instance of a DALI control device that supports Part 306 (general purpose sensor).

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

Part 306 (General purpose sensors) - Introduction

If necessary, the output value can also be queried immediately via the variable bQueryInputSignal, even if the corresponding instance is not enabled.

The output variable fInputSignal is written depending on the specified resolution nResolution (application and vendor-specific).

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.

FB_DALI306GeneralPurposeSensor 2:

The function block cannot be used when using the KL6811.

FB_DALI306GeneralPurposeSensor 3: Inputs

VAR_INPUT
  bInitialize                 : BOOL := FALSE;
  nShortAddress               : BYTE := 0;
  nInstanceNumber             : BYTE := 0;
  nResolution                 : BYTE := 10;
  nMagnitude                  : BYTE := 0;
  bInputSignalSigned          : BOOL := FALSE;
  bQueryInputSignal           : BOOL := FALSE;
  bGetInputNotifications      : BOOL := TRUE;
  bGetAlarmNotifications      : BOOL := TRUE;
  nOptions                    : DWORD := 0;
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.

nInstanceNumber

BYTE

Number of the instance (0…31) of the DALI control device to be addressed.

nResolution

BYTE

Vendor-specific resolution (1...64) of the input value. The value specifies the number of bits with which the input value is scaled.

nMagnitude

BYTE

Magnitude (magnitudePhMin...magnitudePhMax).

bInputSignalSigned

BOOL

Signed input signal.

bQueryInputSignal

BOOL

Immediate query of the measured value. A query is possible even if the instance is disabled via the bEnableInstance property.

bGetInputNotifications

BOOL

A TRUE at this input causes the received Input Notification Events to be output at the output.

bGetAlarmNotifications

BOOL

A TRUE at this input causes the received Alarm Notification Events to be output at the output.

nOptions

DWORD

Reserved for future extensions.

FB_DALI306GeneralPurposeSensor 4: Outputs

VAR_OUTPUT
  bError                     : BOOL;
  ipResultMessage            : I_TcMessage;
  bInitializing              : BOOL;
  bReadingInputSignal        : BOOL;
  fInputSignal               : LREAL;
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.

bReadingInputSignal

BOOL

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

fInputSignal

LREAL

Measured and scaled value of the sensor.

FB_DALI306GeneralPurposeSensor 5:

This measured value must be compared with the measured reference values at the place of operation of the DALI control device.

FB_DALI306GeneralPurposeSensor 6: Properties

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

Name

Type

Access

Initial value

Description

bEnableInstance

BOOL

Get, Set

TRUE

The instance can be enabled or disabled on the DALI control device. If this property is FALSE, sending events from this instance is disabled. However, the actual value of the instance can still be queried via the input bQueryInputValue.

eAlarm0Type...eAlarm3Type

E_DALIAlarmType

Get, Set

E_DALIAlarmType.HighLimit

The value defines whether the alarm is activated when the value exceeds (E_DALIAlarmType.HighLimit) or falls below (E_DALIAlarmType.LowLimit) of nAlarmNLevel.

eEventPriority

E_DALIEventPriority

Get, Set

MiddleLow

Setting of the event priority.

nAlarm0Hysteresis...nAlarm3Hysteresis

DINT

Get, Set

0

Value (0…25 %) for calculating a hysteresis in order to prevent frequent and disturbing changes when recording alarms.

nAlarm0Level...nalarm3Level

DINT

Get, Set

MASK

Specifies the threshold value above which an alarm becomes active. The value of eAlarmNType defines whether the alarm is activated when the limit is exceeded (E_DALIAlarmType.HighLimit) or when it falls below the limit (E_DALIAlarmType.LowLimit).

nAlarmReportTimer

UINT

Get, Set

150 s

Time (0...1275 s) after which the pending alarm event is repeated if no other event has occurred in the meantime.

nDeadtimeTimer

UINT

Get, Set

1500 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 an event is sent.

nHysteresis

BYTE

Get, Set

5 %

Value (0...25 %) for calculating a hysteresis to prevent frequent and disturbing changes when recording the measured value.

nHysteresisMin

BYTE

Get, Set

10

As the percentage hysteresis can also lead to large fluctuations if the measured value is too low, a minimum hysteresis can be specified via this property. The minimum hysteresis is an absolute value with a range from 0 to 255. The value depends on the resolution.

nReportTimer

BYTE

Get, Set

150 s

Time (0...255 s) after which the pending event of the measured value is repeated if no other event has occurred in the meantime.

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

Tc3_DALI from v3.19.1.0