FB_KL6581

FB_KL6581 1:

This function block takes care of communication with the KL6581 EnOcean bus terminal. The KL6581 is configured and the data exchange with the EnOcean network is started via this block.

FB_KL6581 2:

Restrictions

  • Only one call per instance
  • Call must be made once per PLC cycle
  • Instance must be called in the same PLC task as the send and receive blocks assigned to it
  • Maximum 64 instances per PLC project allowed

FB_KL6581 3: Inputs

VAR_INPUT
  bInit : BOOL;
  nIdx  : USINT := 1;
END_VAR

Name

Type

Description

bInit

BOOL

Activates the function block that configures the KL6301 and then activates the data exchange.

nIdx

USINT

The idx number must be unique for each KL6581 (valid values: 1...64) if more than one bus terminal is used per PLC program.

FB_KL6581 4: Inputs/outputs

VAR_IN_OUT
  stKL6581_in  : KL6581_Input;
  stKL6581_out : KL6581_Output;
END_VAR

Name

Type

Description

stKL6581_in

KL6581_Input

Is linked to the input addresses of the KL6581 in the System Manager.

stKL6581_out

KL6581_Output

Is linked to the output addresses of the KL6581 in the System Manager.

FB_KL6581 5: Outputs

VAR_OUTPUT
  bReady     : BOOL;
  bBusy      : BOOL;
  bError     : BOOL;
  iErrorID   : E_KL6581_Err;
  str_KL6581 : STR_KL6581;
END_VAR

Name

Type

Description

bReady

BOOL

The function block is ready for sending and receiving data.

bBusy

BOOL

The function block is active. No new data can be sent yet.

bError

BOOL

This output goes TRUE as soon as an error occurs. This error is described via the iErrorID variable.

iErrorID

E_KL6581_Err

Describes the type of error.

str_KL6581

STR_KL6581

Connected with the send and receive function blocks.

Requirements

Development environment

required TC3 PLC library

TwinCAT v3.1.4020.14

Tc2_EnOcean from v3.3.5.0