Infosys在阅读器中打开 / AI 翻译

TF8xxx - Industry specific · 0 次阅读

FB_BA_Switch4DALI

FB_BA_Switch4DALI 1:

The template is used to read a 4-fold switch.

Data exchange HMI

The data exchange with the HMI is realized here in the base class FB_BA_BaseSwitch (internal function block). The use of the following variable is visible in this template:

  • bInitializeIn: Start DALI initialization routine from the HMI.

Function

The device itself is specified by the instance numbers of the push buttons, nInstButton1 ... nInstButton4.

The device's internal notification system is always used, which automatically sends a telegram as soon as a button press or release is detected.

The states of the buttons are also queried cyclically in the internal function block FB_BA_Swi4DALI. This ensures that the state of the buttons is always corrected if a telegram is "lost".

The DALI push button function block can be initialized with its set parameters via the input bInitialize or via the HMI (bInitializeRm), see FB_BA_Swi4DALI.

FB_BA_Switch4DALI 2:

The initialization of the template takes place within the method FB_Init.

Block diagram

FB_BA_Switch4DALI 3:

Syntax

FUNCTION_BLOCK FB_BA_Switch4DALI EXTENDS FB_BA_Ext_SwitchBase
VAR_INPUT
  bEn                    : BOOL;
  bInitialize            : BOOL;
END_VAR
VAR_OUTPUT
  bButton1               : BOOL;
  bButton2               : BOOL;
  bButton3               : BOOL;
  bButton4               : BOOL;
  bInitializing          : BOOL;
  bErr                   : BOOL;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
  nAdr                   : BYTE;
  nInstButton1           : BYTE := 0;
  nInstButton2           : BYTE := 1;
  nInstButton3           : BYTE := 2;
  nInstButton4           : BYTE := 3;
  ipDALICommunication    : Tc3_DALI.I_DALICommunication;
END_VAR
VAR_INPUT CONSTANT
  SwitchSns              : FB_BA_Swi4DALI;
END_VAR

FB_BA_Switch4DALI 4: VAR_INPUT

Name

Type

Description

bEn

BOOL

Enabling the function block: a TRUE signal at this input enables the function.

bInitialize

BOOL

A positive edge at this input starts the DALI initialization routine, which transfers the set parameters to the DALI device, see FB_BA_Swi4DALI.

FB_BA_Switch4DALI 5: VAR_OUTPUT

Name

Type

Description

bButton1...bButton4

BOOL

State of the individual push buttons (TRUE = pressed).

bInitializing

BOOL

The push button sensor is in the DALI initialization phase, i.e. the entered parameters are transferred to the DALI device.

bErr

BOOL

Error output. A plain text is output in TwinCAT in the error list in the output window.

FB_BA_Switch4DALI 6: VAR_INPUT CONSTANT PERSISTENT

Name

Type

Description

nAdr

BYTE

DALI individual address of the push button sensor.

nInstButton1...nInstButton4

BYTE

Numbers of the push button instances to be queried.

ipDALICommunication

Tc3_DALI.I_DALICommunication

Interface pointer to the DALI communication block.

FB_BA_Switch4DALI 7: VAR_INPUT CONSTANT

Name

Type

Description

SwitchSns

FB_BA_Swi4DALI

Function block for reading the push button sensor.