Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning these components.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under development.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and XFC® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

Patent Pending

The TwinCAT Technology is covered, including but not limited to the following patent applications and patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


Overview

The EIB library is a TwinCAT PLC library for data exchange with EIB devices.

This library is to be used only in conjunction with a KL6301 (EIB master terminal).


Target groups

This software library is intended for building automation system partners of Beckhoff Automation GmbH. The system partners operate in the field of building automation and are concerned with the installation, commissioning, expansion, maintenance and service of measurement, control and regulating systems for the technical equipment of buildings.


User requirement profile

The user of this library requires basic knowledge of the following.

  • TwinCAT PLC-Control
  • TwinCAT System Manager
  • PCs and networks
  • Structure and properties of the Beckhoff Embedded PC and its Bus Terminal system
  • Technology of EIB devices
  • Relevant safety regulations for building technical equipment


Function of the KL6401

TwinCAT PLC Library: EIB

Function of the KL6301

Operation of the EIB Bus Terminal requires function blocks which are described in this documentation.

From firmware version B1 and library version V3.000.000 three different modes are available and can be activated within the KL6301() function block.

Mode 0: 4 filters each with 64 group entries (compatible to firmware version B0 )

Mode 1: 8 filter each with 32 group entries

Mode 100: Monitor Function (all group address telegrams can be received, the KL6301 doesn't send an ACK). In this mode transmitting is not possible.

Note 		Mode 1 and 100
Mode 1 and 100 can only be used with the basic blocks from the TcKL6301 library.
Sending

The KL6301 sends data individually. This means that an Data variable sent to the KL6301 is sent to the EIB network individually. Subsequent EIB data can only be transferred to the KL6301 after a successful transfer. Two types of EIB telegrams can be sent:

  • WRITE_GROUP for writing data to other EIB devices
  • READ_GROUP_REQ for requesting data from other EIB devices
Receiving

The KL6301 has a maximum of 8 filter addresses. These filters filter the EIB group addresses. Only EIB telegrams entered in the filter are visible in the process image and are acknowledged.

A filter may contain up to 64 group addresses. With filters a total of 256 group addresses are available. For 8 filters multiplied by 32 entries this makes a total of 256 group addresses to receive data. The system is configured via a function block. The group addresses are loaded and are immediately active when the Bus Terminal is initialized.

At lease one filter has to be parameterized. The data type is not significant for the filter setting.

Monitor function

If mode 100 is activated no filters must be set. The filters EIB_GROUP_FILTER just have to be empty and not to be written.


Programming

Content
Genaral information
KL6301 - Linking to the TwinCAT System Manager
TwinCAT programming interface
EIB group filter

POUs/Basic

Content | Description
Basic interface function blocks |
KL6301 | Communication with KL6301

POUs/Basic/Read

POUs | Description
EIB_2OCTET_FLOAT_REC | Receiving of 2 byte float EIB-Data and conversion to REAL
EIB_2OCTET_SIGN_REC | Receiving of 2 byte sign EIB-Data and conversion to INT
EIB_2OCTET_UNSIGN_REC | Receiving of 2 byte unsign EIB-Data and conversion to UINT
EIB_3BIT_CONTROL_REC | Receiving of "3 Bit Controlled" data type
EIB_4OCTET_FLOAT_REC | Receiving of 4 byte float EIB-Data and conversion to REAL
EIB_4OCTET_SIGN_REC | Receiving of 4 byte sign EIB-Data and conversion to DINT
EIB_4OCTET_UNSIGN_REC | Receiving of 4 byte unsign EIB-Data and conversion to UDINT
EIB_8BIT_SIGN_REC | Receiving of 8 bit EIB-Data and conversion to INT
EIB_8BIT_UNSIGN_REC | Receiving of 8 bit EIB-Data and conversion to BYTE
EIB_ALL_DATA_TYPES_REC | Receiving of variable EIB data
EIB_ALL_DATA_TYPES_REC_Ex | Receiving of variable EIB data
EIB_BIT_CONTROL_REC | Receiving of "1 Bit Controlled" data type
EIB_BIT_REC | Receiving of 1 bit EIB-Data and conversion to BOOL
EIB_DATE_REC | Receiving a date
EIB_TIME_REC | Receiving a time

POUs/Basic/Send

POUs | Description
EIB_2OCTET_FLOAT_SEND | Sending of a REAL-value (Conversion to of 2 Byte Float EIB-Data)
EIB_2OCTET_FLOAT_SEND_EX | Sending of a REAL-value (Conversion to of 2 Byte Float EIB-Data)
EIB_2OCTET_SIGN_SEND | Sending of a INT value (Conversion to of 2 Byte sign EIB-Data)
EIB_2OCTET_UNSIGN_SEND | Sending of a UINT value (Conversion to of 2 Byte unsign EIB-Data)
EIB_3BIT_CONTROL_SEND | Sending of a "3 Bit Controlled" data type
EIB_4OCTET_FLOAT_SEND | Sending of a REAL-value (Conversion to of 4 Byte Float EIB-Data)
EIB_4OCTET_FLOAT_SEND_EX | Sending of a REAL-value (Conversion to of 4 Byte Float EIB-Data)
EIB_4OCTET_SIGN_SEND | Sending of a DINT-value (Conversion to of 4 Byte sign EIB-Data)
EIB_4OCTET_SIGN_SEND_EX | Sending of a DINT-value (Conversion to of 4 Byte sign EIB-Data)
EIB_4OCTET_UNSIGN_SEND | Sending of a UDINT-value (Conversion to of 4 Byte unsign EIB-Data)
EIB_8BIT_SIGN_SEND | Sending of a INT-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_SIGN_SEND_EX | Sending of a INT-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_UNSIGN_SEND | Sending of a BYTE-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_UNSIGN_SEND_EX | Sending of a BYTE-value (Conversion to of 8 bit EIB-Data)
EIB_ALL_DATA_TYPES_SEND | Sending variable EIB-Data
EIB_BIT_CONTROL_SEND | Sending of a "1 Bit Controlled" data type
EIB_BIT_SEND | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_BIT_SEND_EX | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_BIT_SEND_MANUAL | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_DATE_SEND | Send a date
EIB_READ_SEND | Send a Read_Group_Req
EIB_TIME_SEND | Send a time

POUs/Function

POUs | Description
F_CONV_2GROUP_TO_3GROUP | Conversion of a 2-level group address in a 3-level group address
F_CONV_3GROUP_TO_2GROUP | Conversion of a 3-level group address in a 2-level group address

POUs/Professional

POUs | Description
KL6301_Professional | Communication with KL6301

Data types/Enums

Data types | Description
EIB_ERROR_CODE | Error messages
EIB_PRIORITY | Priority of the EIB telegram

Data types/Structure

Data types | Description
EIB_GROUP_ADDR | 3-level group address
EIB_GROUP_ADDR_2GROUP | 2-level group address
EIB_GROUP_FILTER | group filter
EIB_PHYS_ADDR | Physical address
EIB_REC | Connection between KL6301 and the read / send function blocks.


TwinCAT Libraries for the KL6301

TwinCAT PLC Library: EIB

General information

Note 		Installation
Beginning with TwinCAT 2.11 Build 2229 (R3 and x64 Engineering), the libraries "TcEIB.lib/.lb6/.lbx" will be installed automatically.

Note 		Name of the library
This library replaces the "TcKL6301.lib/.lb6./.lbx". Only the name of the libraries has changed. The modules are still compatible.

Hardware documentation in Beckhoff Information System: KL6301 - EIB Bus Terminal

Further libraries are required

For PC systems (x86) and Embedded-PCs (CXxxxx):

  • Standard.lib
  • TcBase.lib
  • TcSystem.lib

For Bus Terminal Controller of BCxx00 series:

  • Standard.lb6
  • PlcHelperBC.lb6

For Bus Terminal Controller of BCxx50, BCxx20 and BC9191 series:

  • Standard.lbx
  • TcBaseBCxx50.lbx
  • TcSystemBCxx50.lbx

For Bus Terminal Controller of BXxx00 series:

  • Standard.lbx
  • TcBaseBX.lbx
  • TcSystemBX.lbx

Note 		Memory usage
By linking the library PLC program memory is already consumed. Depending on the application program the remaining memory can not be sufficient.


TwinCAT programming interface

The TwinCAT libraries for the KL6301 make function blocks available that enable data exchange between the applications program running on the higher-level control system and the EIB devices connected to the KL6301. This function blocks is available as a basic version and a professional version.

Basic interface

The basic interface consists of a collection of function blocks that significantly reduce the programming and data type conversion effort. A send and receive block is available for each popular data type. The send blocks have a very simple structure. They only transfer data in the event of a change. Further information can be found in the descriptions of the individual basic blocks.

Professional interface

The professional interface consists of a single function block offering a wide range of parameters and complete freedom for sending or receiving data.

The professional block may not be used at the same time as basic interface blocks on a KL6301! If several KL6301 are used, one KL6301 can be used with the basic interface operate and another with the professional interface.


KL6301 - EIB group filter

TwinCAT PLC Library: EIB

EIB group filter

The EIB group filters have to be parameterized before the KL6301 can enter data exchange mode. The filters are required for all data with a group address sent to the KL6301. Each group telegram that is also included in the filters is acknowledged and entered in the process data, i.e. it is visible in the function blocks. The KL6301 discards EIB telegrams with group addresses that are not included in the filter.

Example

Filter 1 group address 1/2/0 length: 20
All EIB telegrams with group address 1/2/0 - 1/2/19 pass through the filter

At least one filter has to be activated. A maximum of 4 filters are possible. Filter entries can have a length between 0 and 63. 0 means exactly 1 entry. 63 means that 64 group addresses are enabled.

Changes for Firmware B1 and library version V3.000.000

With firmware version B1 and TwinCAT library TcKL6301 (V3.000.000) instead of 4 filters also 8 filters can be parameterized. But the maximum length of each filter is reduced from 64 to 32 entries per filter group. So the maximum of all group filters to be received is constant with 256.


KL6301 - TwinCAT System Manager

TwinCAT PLC Library: EIB

KL6301 - Linking to the TwinCAT System Manager

How do I link the KL6771 to the System Manager?

Figure 1

Select "All Types" and "Continuous" (see Figure 2).

Figure 2

Click the mouse on the first variable in the KL6301 (Parameter Status). Then press the <SHIFT> key, and hold it down. Take the mouse pointer to the last variable in the KL6301 (Input Data 22), and again click the left mouse button. Now release the <SHIFT> key again. All the terminal's data should now be highlighted (see Figure 3). Then press the "OK" button.

Figure 3

You can now check the connection. To do this, go to the KL6301 and open it. All the terminal's data should now be marked by a small arrow (see Figure 4). If that is the case, then proceed in exactly the same way with the outputs.

Figure 4


Integration in TwinCAT (CX9020)

This example describes how a simple PLC program for EIB can be written in TwinCAT and how it is linked with the hardware. The task is to change the state of a switching output with a button.

Unpacking the example files

Hardware

Setting up the components

The following hardware is required:

  • 1x Embedded PC CX9020
  • 1x digital 2-channel input terminal KL1002 (for the set and reset functions)
  • 1x EIB terminal KL6301
  • 1x end terminal KL9010

Set up the hardware and the EIB components as described in the associated documentation.

This example assumes that a Set button was connected to the first KL1002 input and a Reset button to the second, and that the EIB group address of the switching output is known.

Software

Creation of the PLC program

Create a new PLC project for PC-based systems (ARM) and add the TcEIB.lib library.

Next, generate the following global variables:

VAR_GLOBAL
    bSet            AT %I* : BOOL;
    bReset          AT %I* : BOOL;
    arrKL6301_in    AT %I* : ARRAY[1..24] OF BYTE;
    arrKL6301_out   AT %Q* : ARRAY[1..24] OF BYTE;
    stDataRec              : EIB_REC;
END_VAR

bSet : Input variable for the Set button.

bReset: Input variable for the Reset button.

arrKL6301_in : Input variable for the EIB terminal.

arrKL6301_out : Output variable for the EIB terminal.

stDataRec : required for communication with EIB.

Then create a program (CFC) for background communication with EIB. In this program the block KL6301() is called up. Make sure to link the communication block with arrKL6301, arrKL6301and stDataRec.

Create a MAIN program (CFC) in which the block EIB_BIT_SEND is called up. Link the local variable bData with the global variables bSet and bReset, then with the input bData of the send block. Link the global variable stDataRec with st_Rec.

Under Task Configuration create a new task for the background communication. Add the communication program to this task. Assign a higher priority (lower number) and shorter interval time to this task than for the standard task. More detailed information can be found in the KL6301 block description.

Load the project to the CX as the boot project and save it.

Configuration in the System Manager

Create a new System Manager project, select the CX as the target system, and search for the associated hardware.

Add the PLC program created above under PLC configuration. The two tasks are listed when the PLC project is expanded in the tree view. Expand the tasks – all global input and output variables should be allocated to the standard task. However, since the variables arrKL6301_in and arrKL6301_out are to be processed faster, move them to the background communication task via drag & drop.

Now link the global variables of the PLC program with the Bus Terminal inputs and outputs, create the allocations, and activate the configuration. Then start the device in run mode.
Your CX is now ready for use.

The switching output can be set or reset by pressing the button.


Integration into TwinCAT (BC9191)

This example describes how a simple PLC program for EIB can be written in TwinCAT and how it is linked with the hardware. The task is to change the state of a switching output with a button.

Unpacking the example files

Hardware

Setting up the components

The following hardware is required:

  • 1x Bus Terminal Controller BC9191
  • 1x potential feed terminal 24V DC
  • 1x digital 2-channel input terminal KL1002 (for the set and reset functions)
  • 1x EIB terminal KL6301
  • 1x end terminal KL9010

Set up the hardware and the EIB components as described in the associated documentation.

This example assumes that a Set button was connected to the first KL1002 input and a Reset button to the second, and that the EIB group address of the switching output is known.

Software

Creation of the PLC program

Create a new PLC project for BC-based systems (BCxx50 via AMS) and add the libraries TcEIB.lbx and TcSystemBCxx50.lbx. Then navigate to Project → Options... → Build and select Treat LREAL as REAL.

Next, generate the following global variables:

VAR_GLOBAL
    bSet            AT %I* : BOOL;
    bReset          AT %I* : BOOL;
    arrKL6301_in    AT %I* : ARRAY[1..24] OF BYTE;
    arrKL6301_out   AT %Q* : ARRAY[1..24] OF BYTE;
    stDataRec              : EIB_REC;
END_VAR

bSet : Input variable for the Set button.

bReset: Input variable for the Reset button.

arrKL6301_in : Input variable for the EIB terminal.

arrKL6301_out : Output variable for the EIB terminal.

stDataRec : required for communication with EIB.

Since BC devices can only process one task, communication with EIB cannot run separately.

Therefore, create a MAIN program (CFC) in which the KL6301() and EIB_BIT_SEND function blocks are called. Make sure to link the communication block with arrKL6301, arrKL6301and stDataRec.

Link the local variable bData with the global variables bSet and bReset, then with the input bData of the send block. Link the global variable stDataRec with st_Rec.

Go to the task configuration and give the task a lower interval time. More detailed information can be found in the KL6301 block description.

Now load the project as a boot project to the BC and save it.

Configuration in the System Manager

Create a new System Manager project, select the BC as the target system, and search for the associated hardware.

Add the PLC program created above under PLC configuration.

Now link the global variables of the PLC program with the Bus Terminal inputs and outputs, create the allocations, and activate the configuration. Then start the device in run mode.
Your BC is now ready for use.

The switching output can be set or reset by pressing the button.


POUs

TwinCAT PLC Library: EIB

POUs/Basic

Content | Description
Basic interface function blocks |
KL6301 | Communication with KL6301

POUs/Basic/Read

POUs | Description
EIB_2OCTET_FLOAT_REC | Receiving of 2 byte float EIB-Data and conversion to REAL
EIB_2OCTET_SIGN_REC | Receiving of 2 byte sign EIB-Data and conversion to INT
EIB_2OCTET_UNSIGN_REC | Receiving of 2 byte unsign EIB-Data and conversion to UINT
EIB_3BIT_CONTROL_REC | Receiving of "3 Bit Controlled" data type
EIB_4OCTET_FLOAT_REC | Receiving of 4 byte float EIB-Data and conversion to REAL
EIB_4OCTET_SIGN_REC | Receiving of 4 byte sign EIB-Data and conversion to DINT
EIB_4OCTET_UNSIGN_REC | Receiving of 4 byte unsign EIB-Data and conversion to UDINT
EIB_8BIT_SIGN_REC | Receiving of 8 bit EIB-Data and conversion to INT
EIB_8BIT_UNSIGN_REC | Receiving of 8 bit EIB-Data and conversion to BYTE
EIB_ALL_DATA_TYPES_REC | Receiving of variable EIB data
EIB_ALL_DATA_TYPES_REC_Ex | Receiving of variable EIB data
EIB_BIT_CONTROL_REC | Receiving of "1 Bit Controlled" data type
EIB_BIT_REC | Receiving of 1 bit EIB-Data and conversion to BOOL
EIB_DATE_REC | Receiving a date
EIB_TIME_REC | Receiving a time

POUs/Basic/Send

POUs | Description
EIB_2OCTET_FLOAT_SEND | Sending of a REAL-value (Conversion to of 2 Byte Float EIB-Data)
EIB_2OCTET_FLOAT_SEND_EX | Sending of a REAL-value (Conversion to of 2 Byte Float EIB-Data)
EIB_2OCTET_SIGN_SEND | Sending of a INT value (Conversion to of 2 Byte sign EIB-Data)
EIB_2OCTET_UNSIGN_SEND | Sending of a UINT value (Conversion to of 2 Byte unsign EIB-Data)
EIB_3BIT_CONTROL_SEND | Sending of a "3 Bit Controlled" data type
EIB_4OCTET_FLOAT_SEND | Sending of a REAL-value (Conversion to of 4 Byte Float EIB-Data)
EIB_4OCTET_FLOAT_SEND_EX | Sending of a REAL-value (Conversion to of 4 Byte Float EIB-Data)
EIB_4OCTET_SIGN_SEND | Sending of a DINT-value (Conversion to of 4 Byte sign EIB-Data)
EIB_4OCTET_SIGN_SEND_EX | Sending of a DINT-value (Conversion to of 4 Byte sign EIB-Data)
EIB_4OCTET_UNSIGN_SEND | Sending of a UDINT-value (Conversion to of 4 Byte unsign EIB-Data)
EIB_8BIT_SIGN_SEND | Sending of a INT-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_SIGN_SEND_EX | Sending of a INT-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_UNSIGN_SEND | Sending of a BYTE-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_UNSIGN_SEND_EX | Sending of a BYTE-value (Conversion to of 8 bit EIB-Data)
EIB_ALL_DATA_TYPES_SEND | Sending variable EIB-Data
EIB_BIT_CONTROL_SEND | Sending of a "1 Bit Controlled" data type
EIB_BIT_SEND | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_BIT_SEND_EX | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_BIT_SEND_MANUAL | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_DATE_SEND | Send a date
EIB_READ_SEND | Send a Read_Group_Req
EIB_TIME_SEND | Send a time

POUs/Function

POUs | Description
F_CONV_2GROUP_TO_3GROUP | Conversion of a 2-level group address in a 3-level group address
F_CONV_3GROUP_TO_2GROUP | Conversion of a 3-level group address in a 2-level group address

POUs/Professional

POUs | Description
KL6301_Professional | Communication with KL6301


Basic

Content | Description
Basic interface function blocks |
KL6301 | Communication with KL6301

Read

POUs | Description
EIB_2OCTET_FLOAT_REC | Receiving of 2 byte float EIB-Data and conversion to REAL
EIB_2OCTET_SIGN_REC | Receiving of 2 byte sign EIB-Data and conversion to INT
EIB_2OCTET_UNSIGN_REC | Receiving of 2 byte unsign EIB-Data and conversion to UINT
EIB_3BIT_CONTROL_REC | Receiving of "3 Bit Controlled" data type
EIB_4OCTET_FLOAT_REC | Receiving of 4 byte float EIB-Data and conversion to REAL
EIB_4OCTET_SIGN_REC | Receiving of 4 byte sign EIB-Data and conversion to DINT
EIB_4OCTET_UNSIGN_REC | Receiving of 4 byte unsign EIB-Data and conversion to UDINT
EIB_8BIT_SIGN_REC | Receiving of 8 bit EIB-Data and conversion to INT
EIB_8BIT_UNSIGN_REC | Receiving of 8 bit EIB-Data and conversion to BYTE
EIB_ALL_DATA_TYPES_REC | Receiving of variable EIB data
EIB_ALL_DATA_TYPES_REC_Ex | Receiving of variable EIB data
EIB_BIT_CONTROL_REC | Receiving of "1 Bit Controlled" data type
EIB_BIT_REC | Receiving of 1 bit EIB-Data and conversion to BOOL
EIB_DATE_REC | Receiving a date
EIB_TIME_REC | Receiving a time

Send

POUs | Description
EIB_2OCTET_FLOAT_SEND | Sending of a REAL-value (Conversion to of 2 Byte Float EIB-Data)
EIB_2OCTET_FLOAT_SEND_EX | Sending of a REAL-value (Conversion to of 2 Byte Float EIB-Data)
EIB_2OCTET_SIGN_SEND | Sending of a INT value (Conversion to of 2 Byte sign EIB-Data)
EIB_2OCTET_UNSIGN_SEND | Sending of a UINT value (Conversion to of 2 Byte unsign EIB-Data)
EIB_3BIT_CONTROL_SEND | Sending of a "3 Bit Controlled" data type
EIB_4OCTET_FLOAT_SEND | Sending of a REAL-value (Conversion to of 4 Byte Float EIB-Data)
EIB_4OCTET_FLOAT_SEND_EX | Sending of a REAL-value (Conversion to of 4 Byte Float EIB-Data)
EIB_4OCTET_SIGN_SEND | Sending of a DINT-value (Conversion to of 4 Byte sign EIB-Data)
EIB_4OCTET_SIGN_SEND_EX | Sending of a DINT-value (Conversion to of 4 Byte sign EIB-Data)
EIB_4OCTET_UNSIGN_SEND | Sending of a UDINT-value (Conversion to of 4 Byte unsign EIB-Data)
EIB_8BIT_SIGN_SEND | Sending of a INT-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_SIGN_SEND_EX | Sending of a INT-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_UNSIGN_SEND | Sending of a BYTE-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_UNSIGN_SEND_EX | Sending of a BYTE-value (Conversion to of 8 bit EIB-Data)
EIB_ALL_DATA_TYPES_SEND | Sending variable EIB-Data
EIB_BIT_CONTROL_SEND | Sending of a "1 Bit Controlled" data type
EIB_BIT_SEND | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_BIT_SEND_EX | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_BIT_SEND_MANUAL | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_DATE_SEND | Send a date
EIB_READ_SEND | Send a Read_Group_Req
EIB_TIME_SEND | Send a time


Basic interface function blocks

Description | _Rec | _Send
 |  | _Send | First Cycle | Delta, min. Send Time | Polling | Auto/manual
EIB_BIT | yes | yes | no | yes, 200 msec | no | auto
EIB_BIT_MANUAL | no | yes | no | no | no | manual
EIB_BIT_CONTROL | yes | yes | no | yes, 200 msec | no | auto
EIB_3BIT_CONTROL | yes | yes | no | yes, 200 msec | no | auto
EIB_8BIT_SIGN | yes | yes | no | yes, 1 sec | no | auto
EIB_8BIT_SIGN_EX | no | yes | yes | yes, 200 msec | yes | auto/manual
EIB_8BIT_UNSIGN | yes | yes | no | yes, 1 sec | no | auto
EIB_8BIT_UNSIGN_EX | no | yes | yes | yes, 200 msec | yes | auto/manual
EIB_2OCTETE_SIGN | yes | yes | no | yes, 1 sec | no | auto
EIB_2OCTETE_UNSIGN | yes | yes | no | yes, 1 sec | no | auto
EIB_2OCTETE_FLOAT | yes | yes | no | yes, 1 sec | no | auto
EIB_TIME | yes | yes | yes | no | yes, 5 min | auto
EIB_DATE | yes | yes | yes | no | yes, 5 min | auto
EIB_4OCTETE_SIGN | yes | yes | no | yes, 1 sec | no | auto
EIB_4OCTETE_UNSIGN | yes | yes | no | yes, 1 sec | no | auto
EIB_4OCTETE_FLOAT | yes | yes | no | yes, 1 sec | no | auto
EIB_READ | no | yes | no | no | no | manual
EIB_ALL_DATA_TYPES | yes | yes | no | yes, variable | yes, variable | auto/manual

_Rec: yes - receiving is supported, no - receiving is not supported

_Send: yes - sending is supported, no - sending is not supported

First Cycle: An EIB telegram is sent when the block is first called

Delta, min. Send Time: An EIB telegram is only sent in the event of a change in data. The parameter "min. send time" is used to activate a "send filter". It does not extend the response time for the first relative change in input, but is active for subsequent changes. The min. send time (send delay time) describes the minimum interval required between sending of two telegrams. The min. send time reduces bus communication and ensures that send instructions from other blocks can also transmit their EIB telegrams.

Polling: The data are automatically sent at the specified interval, even if the data did not change

Auto/Manual: Auto - data are automatically sent when the block is called; Manual - data are only sent the block requests this


KL6301

Application

This function block deals with the KL6301 EIB Bus Terminal communication. It is used for configuring the KL6301 and for starting the data exchange with the EIB network.

Restrictions:

  • This block may only be called once for each KL6301!
  • In the PLC project this block may only be called once per cycle!
  • A PLC project may contain a maximum of 64 KL6301 terminals!

VAR_INPUT

bActivate             : BOOL;
idx                   : INT := 1;
EIB_PHYS_ADDR         : EIB_PHYS_ADDR;
EIB_GROUP_FILTER      : ARRAY [1..8] OF EIB_GROUP_FILTER;
iMode                 : INT;

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

idx: If more than one Bus Terminal per PLC program is used, each KL6301 must have a unique idx number. Valid values 1...64.

EIB_PHYS_ADDR: Physical EIB address (see EIB_PHYS_ADDR). The default address is 1.2.3. This address must be unique in the EIB network!

EIB_GROUP_FILTER: Group address filter (see EIB_GROUP_FILTER). A maximum of 8 filters are possible.

iMode:
0 - for firmware B0 and higher - 4 Filter, each with 64 entries
1 - for firmware B1 and higher - 8 Filter, each with 32 entries
100 - for firmware B1 and higher - monitor function, all group address telegrams can be received. The telegrams are not acknowledged (no ACK is being sent). At monitor operation transmission is not possible.

VAR_OUTPUT

bActive               : BOOL;
bReady                : BOOL;
bError                : BOOL;
iErrorId              : EIB_Error_Code;
str_Data_Rec          : EIB_REC;

bActive: The block was activated.

bReady: The block is ready for sending and receiving data.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorId.

iErrorId: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.

str_Data_Rec: The data structure with which the send and receive blocks are connected (see EIB_REC).

VAR_IN_OUT

KL6301_IN             : ARRAY [1..24] OF BYTE;
KL6301_OUT            : ARRAY [1..24] OF BYTE;

KL6301_IN: Linked with the KL6301 input addresses.

KL6301_OUT: Linked with the KL6301 output addresses.


Read

POUs | Description
EIB_2OCTET_FLOAT_REC | Receiving of 2 byte float EIB-Data and conversion to REAL
EIB_2OCTET_SIGN_REC | Receiving of 2 byte sign EIB-Data and conversion to INT
EIB_2OCTET_UNSIGN_REC | Receiving of 2 byte unsign EIB-Data and conversion to UINT
EIB_3BIT_CONTROL_REC | Receiving of "3 Bit Controlled" data type
EIB_4OCTET_FLOAT_REC | Receiving of 4 byte float EIB-Data and conversion to REAL
EIB_4OCTET_SIGN_REC | Receiving of 4 byte sign EIB-Data and conversion to DINT
EIB_4OCTET_UNSIGN_REC | Receiving of 4 byte unsign EIB-Data and conversion to UDINT
EIB_8BIT_SIGN_REC | Receiving of 8 bit EIB-Data and conversion to INT
EIB_8BIT_UNSIGN_REC | Receiving of 8 bit EIB-Data and conversion to BYTE
EIB_ALL_DATA_TYPES_REC | Receiving of variable EIB data
EIB_ALL_DATA_TYPES_REC_Ex | Receiving of variable EIB data
EIB_BIT_CONTROL_REC | Receiving of "1 Bit Controlled" data type
EIB_BIT_REC | Receiving of 1 bit EIB-Data and conversion to BOOL
EIB_DATE_REC | Receiving a date
EIB_TIME_REC | Receiving a time


EIB_2OCTET_FLOAT_REC

Application

This function block receives 2 bytes of float EIB data on the set group address and converts them into an IEC61131-3 REAL variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
rData              : REAL;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

rData: Contains the user data of the received EIB telegram.


EIB_2OCTET_SIGN_REC

Application

This function block receives 2 bytes of sign EIB data on the set group address and converts them into an IEC61131-3 INT variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
iData              : INT;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received

iData: Contains the user data of the received EIB telegram.


EIB_2OCTET_UNSIGN_REC

Application

This function block receives 2 bytes of unsign EIB data on the set group address and converts them into an IEC61131-3 UINT variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
uiData             : UINT;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

uiData: Contains the user data of the received EIB telegram.


EIB_3BIT_CONTROL_REC

Application

This function block receives 4 bits of EIB data on the set group address and converts them into an IEC61131-3 BOOL variable and a byte variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
bControl           : BOOL;
byRange            : BYTE;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

bControl: Valid values (TRUE/FALSE).

byRange: Valid values (000b..111b).

Allocation of the 4 bits to the variables bControl and byRange.

bControl byRange.2 byRange.1 byRange.0


EIB_4OCTET_FLOAT_REC

Application

This function block receives 4 bytes of float EIB data on the set group address and converts them into an IEC61131-3 REAL variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
rData              : REAL;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

rData: Contains the user data of the received EIB telegram.


EIB_4OCTET_SIGN_REC

Application

This function block receives 4 bytes of sign EIB data on the set group address and converts them into an IEC61131-3 DINT variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
uiData             : DINT;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

uiData: Contains the user data of the received EIB telegram.


EIB_4OCTET_UNSIGN_REC

Application

This function block receives 4 bytes of unsign EIB data on the set group address and converts them into an IEC61131-3 UDINT variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
uiData             : UDINT;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

uiData: Contains the user data of the received EIB telegram.


EIB_8BIT_SIGN_REC

Application

This function block receives 8 bits of EIB data on the set group address and converts them into an IEC61131-3 INT variable. In addition the value may be converted automatically.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
Scaling_Mode       : INT;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

Scaling_Mode:
0 - The 8 bit value is output as a percentage value 0...100%
1 - The 8 bit value is output as an angle 0...360°
2 - The 8 bit value is output as a byte value 0...255

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
iData              : INT;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

iData: Scaled value, see Scaling_Mode (-1 - an invalid scaling mode was entered).


EIB_8BIT_UNSIGN_REC

Application

This function block receives 8 bits of EIB data on the set group address and converts them into an IEC61131-3 BYTE variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
byData             : BYTE;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

byData: Contains the user data of the received EIB telegram.


EIB_ALL_DATA_TYPES_REC

Application

This function block receives variable EIB data sizes on the set group address and outputs the raw data as a byte ARRAY.

VAR_INPUT

Group_Address         : EIB_GROUP_ADDR;
strData_Rec           : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive          : BOOL;
EIB_Data_Receive      : ARRAY [1..14] OF BYTE;
EIB_Data_Len          : USINT;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

EIB_Data_Receive: Contains the user data of the received EIB telegram.

EIB_Data_Len: Contains the user data length of the incoming EIB telegram.
Data < 8 bit specified length 1
Data >=) 8 bit specified length +1
Example: If 1 bit of data is received, the length in EIB_Data_Len is 1. If 2 bytes of data are received, the length in EIB_Data_Len is 3.


EIB_ALL_DATA_TYPES_REC_Ex

Application

This function block receives variable EIB data sizes of all group addresses and outputs the raw data as a byte ARRAY.

VAR_INPUT

strData_Rec           : EIB_REC;

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive          : BOOL;
Group_Address         : EIB_GROUP_ADDR;
EIB_Data_Receive      : ARRAY [1..14] OF BYTE;
EIB_Data_Len          : USINT;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

EIB_Data_Receive: Contains the user data of the received EIB telegram.

EIB_Data_Len: Contains the user data length of the incoming EIB telegram.
Data < 8 bit specified length 1
Data >=) 8 bit specified length +1
Example: If 1 bit of data is received, the length in EIB_Data_Len is 1. If 2 bytes of data are received, the length in EIB_Data_Len is 3.


EIB_BIT_CONTROL_REC

Application

This function block receives 2 bits of EIB data on the set group address and converts them into two IEC61131-3 BOOL variables.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
bControl           : BOOL;
bValue             : BOOL;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

bControl: Valid values (TRUE/FALSE).

bValue: Valid values (TRUE/FALSE).

Allocation of the 2 bits to the variables bControl and bValue.

bControl bValue


EIB_BIT_REC

Application

This function block receives 1 bit of EIB data on the set group address and converts them into an IEC61131-3 BOOL variable.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
bData              : BOOL;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

bData: Valid values (TRUE/FALSE).


EIB_DATE_REC

Application

This function block receives 3 bytes of EIB data on the set group address and converts them into three IEC61131-3 WORD variables.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
wDay               : WORD;
wMonth             : WORD;
wYear              : WORD;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

wDay: date, days [1...31].

wMonth: date, month [1...12].

wYear: date, year [0...99].


EIB_TIME_REC

Application

This function block receives 3 bytes of EIB data on the set group address and converts them into three IEC61131-3 WORD variables.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
strData_Rec        : EIB_REC;

Group_Address: Group address from which the data were sent (see EIB_GROUP_ADDR). This group address must be entered in the filters!

strData_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bDataReceive       : BOOL;
wHoure             : WORD;
wMinute            : WORD;
wSecond            : WORD;

bDataReceive: This bit is set to FALSE for exactly one cycle when an EIB telegram with the group address is received.

wHoure: Time, hours [0...23].

wMinute: Time, minutes [0...59].

wSecond: Time, seconds [0...59].


Send

POUs | Description
EIB_2OCTET_FLOAT_SEND | Sending of a REAL-value (Conversion to of 2 Byte Float EIB-Data)
EIB_2OCTET_FLOAT_SEND_EX | Sending of a REAL-value (Conversion to of 2 Byte Float EIB-Data)
EIB_2OCTET_SIGN_SEND | Sending of a INT value (Conversion to of 2 Byte sign EIB-Data)
EIB_2OCTET_UNSIGN_SEND | Sending of a UINT value (Conversion to of 2 Byte unsign EIB-Data)
EIB_3BIT_CONTROL_SEND | Sending of a "3 Bit Controlled" data type
EIB_4OCTET_FLOAT_SEND | Sending of a REAL-value (Conversion to of 4 Byte Float EIB-Data)
EIB_4OCTET_FLOAT_SEND_EX | Sending of a REAL-value (Conversion to of 4 Byte Float EIB-Data)
EIB_4OCTET_SIGN_SEND | Sending of a DINT-value (Conversion to of 4 Byte sign EIB-Data)
EIB_4OCTET_SIGN_SEND_EX | Sending of a DINT-value (Conversion to of 4 Byte sign EIB-Data)
EIB_4OCTET_UNSIGN_SEND | Sending of a UDINT-value (Conversion to of 4 Byte unsign EIB-Data)
EIB_8BIT_SIGN_SEND | Sending of a INT-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_SIGN_SEND_EX | Sending of a INT-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_UNSIGN_SEND | Sending of a BYTE-value (Conversion to of 8 bit EIB-Data)
EIB_8BIT_UNSIGN_SEND_EX | Sending of a BYTE-value (Conversion to of 8 bit EIB-Data)
EIB_ALL_DATA_TYPES_SEND | Sending variable EIB-Data
EIB_BIT_CONTROL_SEND | Sending of a "1 Bit Controlled" data type
EIB_BIT_SEND | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_BIT_SEND_EX | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_BIT_SEND_MANUAL | Sending of a BOOL-value (Conversion to of 1 bit EIB-Data)
EIB_DATE_SEND | Send a date
EIB_READ_SEND | Send a Read_Group_Req
EIB_TIME_SEND | Send a time


EIB_2OCTET_FLOAT_SEND

Application

This function block sends a 2-byte float EIB value to the set group address. An IEC61131-3 real value is available as input value. The data are only transferred if there is a change. If the value changes again within 1 second, new data are only sent to the EIB device after another second has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
rData              : REAL;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

rData: The data value in REAL. This is automatically converted to an EIB 2OCTET FLOAT value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_2OCTET_FLOAT_SEND_EX

Application

This function block sends a 2-byte float EIB value to the set group address. An IEC61131-3 real value is available as input value. In dependence of the mode (iMode) the data can be sent manually, by polling or on change.

VAR_INPUT

bStart             : BOOL;
iMode              : INT;
CyclePolling       : TIME := t#500ms;
MinSendTime        : TIME := t#1s;
Group_Address      : EIB_GROUP_ADDR;
rData              : REAL;
str_Rec            : EIB_REC;

bStart: Activates the block. The block starts to work in dependence of the parameterized mode (see iMode).

iMode:
0 - At rising edge of bStart an EIB-Telegramm is sent. If the output bBusy is FALSE again then the command was executed.
1 - Polling Mode: If bStart is TRUE EIB telegrams are sent with a time intervall of CyclePolling.
2 - OnChange Mode: If bStart is TRUE at change of data an EIB telegram is sent automatically. With MinSendTime the minimum interval between two EIB messages can be parameterized to avoid unnecessary load to the EIB network.

CyclePolling: Polling time for iMode = 1 (polling mode). The minimum time is 200ms.

MinSendTime: Intervall time that has to be last at minimum until another telegram is changed in OnChange mode. The minimum time is 200ms.

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

rData: The data value in REAL. This is automatically converted to an EIB 2OCTET FLOAT value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bBusy: The block is active. For new functions wait until bBusy is set back to FALSE.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_2OCTET_SIGN_SEND

Application

This function block sends a 2-byte sign EIB value to the set group address. An IEC61131-3 INT value is available as input value. The data are only transferred if there is a change. If the value changes again within 1 second, new data are only sent to the EIB device after another second has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
iData              : INT;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

iData: The data value in INT. This is automatically converted to an EIB 2OCTET SIGN value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_2OCTET_UNSIGN_SEND

Application

This function block sends a 2-byte unsign EIB value to the set group address. An IEC61131-3 UINT value is available as input value. The data are only transferred if there is a change. If the value changes again within 1 second, new data are only sent to the EIB device after another second has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
uiData             : UINT;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

uiData: The data value in UINT. This is automatically converted to an EIB 2OCTET UNSIGN value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_3BIT_CONTROL_SEND

Application

This function block sends a 4-bit EIB value to the set group address. An IEC61131-3 BOOL and a BYTE value are available as input value. The data are only transferred if there is a change in one of the two data types. If the value changes again within 200 milliseconds, new data are only sent to the EIB device after another 200 millisecond has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
bControl           : BOOL;
byRange            : BYTE;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

bControl: Range of values TRUE/FALSE.

byRange: Range 000b..111b.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_4OCTET_FLOAT_SEND

Application

This function block sends a 4-byte float EIB value to the set group address. An IEC61131-3 REAL value is available as input value. The data are only transferred if there is a change. If the value changes again within 1 second, new data are only sent to the EIB device after another second has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
rData              : REAL;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

rData: The data value in REAL. This is automatically converted to an EIB 2OCTET FLOAT value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_4OCTET_FLOAT_SEND_EX

Application

This function block sends a 4-byte float EIB value to the set group address. An IEC61131-3 real value is available as input value. In dependence of the mode (iMode) the data can be sent manually, by polling or on change.

VAR_INPUT

bStart             : BOOL;
iMode              : INT;
CyclePolling       : TIME := t#10m;
MinSendTime        : TIME := t#1s;
Group_Address      : EIB_GROUP_ADDR;
rData              : REAL;
str_Rec            : EIB_REC;

bStart: Activates the block. The block starts to work in dependence of the parameterized mode (see iMode).

iMode:
0 - At rising edge of bStart an EIB-Telegramm is sent. If bBusy the command is executed.
1 - Polling Mode: If bStart is TRUE EIB telegrams are sent with a time intervall of CyclePolling.
2 - OnChange Modus: If bStart is TRUE at change of data an EIB telegram is sent automatically. With MinSendTime the minimum interval between two EIB messages can be parameterized to avoid unnecessary load to the EIB network.

CyclePolling: Polling time for the polling mode. The minimum time is 200ms.

MinSendTime: Intervall time that has to be last at minimum until another telegram is changed in OnChange mode. The minimum time is 200ms.

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

rData: The data value in REAL. This is automatically converted to an EIB 2OCTET FLOAT value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bBusy: The block is active. For new functions wait until bBusy is set back to FALSE.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_4OCTET_SIGN_SEND

Application

This function block sends a 4-byte sign EIB value to the set group address. An IEC61131-3 DINT value is available as input value. The data are only transferred if there is a change. If the value changes again within 1 second, new data are only sent to the EIB device after another second has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
uiData             : DINT;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

uiData: The data value in DINT. This is automatically converted to an EIB 4OCTET SIGN value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_4OCTET_SIGN_SEND_EX

Application

This function block sends a 4-byte sign EIB value to the set group address. An IEC61131-3 DINT value is available as input value. In dependence of the mode (iMode) the data can be sent manually, by polling or on change.

VAR_INPUT

bStart             : BOOL;
iMode              : INT;
CyclePolling       : TIME := t#500ms;
MinSendTime        : TIME := t#1s;
Group_Address      : EIB_GROUP_ADDR;
uiData             : DINT;
str_Rec            : EIB_REC;

bStart: Activates the block. The block starts to work in dependence of the parameterized mode (see iMode).

iMode:
0 - At rising edge of bStart an EIB-Telegramm is sent. If bBusy the command is executed.
1 - Polling Mode: If bStart is TRUE EIB telegrams are sent with a time intervall of CyclePolling.
2 - OnChange Modus: If bStart is TRUE at change of data an EIB telegram is sent automatically. With MinSendTime the minimum interval between two EIB messages can be parameterized to avoid unnecessary load to the EIB network.

CyclePolling: Polling time for the polling mode. The minimum time is 200ms.

MinSendTime: Intervall time that has to be last at minimum until another telegram is changed in OnChange mode. The minimum time is 200ms.

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

uiData: The data value in DINT. This is automatically converted to an EIB 4OCTET SIGN value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bBusy: The block is active. For new functions wait until bBusy is set back to FALSE.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_4OCTET_UNSIGN_SEND

Application

This function block sends a 4-byte unsign EIB value to the set group address. An IEC61131-3 UDINT value is available as input value. The data are only transferred if there is a change. If the value changes again within 1 second, new data are only sent to the EIB device after another second has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
uiData             : UDINT;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

uiData: The data value in UDINT. This is automatically converted to an EIB 4OCTET SIGN value.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_8BIT_SIGN_SEND

Application

This function block sends a 8-bit EIB value to the set group address. An IEC61131-3 INT is available as input value. Scaling_Mode can be used to scale the input data value. The data are only transferred if there is a change in the data value. If the value changes again within 1 second, new data are only sent to the EIB device after minSendTime has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
iData              : INT;
Scaling_Mode       : INT;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

iData: Data to be sent. Range of values depending on Scaling_Mode.

Scaling_Mode:
0 - 0...100 [%]
1 - 0...360 [°]
2 - 0...255

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_8BIT_SIGN_SEND_EX

Application

This function block sends an 8 Bit EIB value to the parameterized group address. As entry value there is an IEC61131-3 INT. By Scaling_Mode the entry data value can be scaled. In dependence of the mode (iMode) the data can be sent manually, by polling or on change.

VAR_INPUT

bStart             : BOOL;
iMode              : INT;
Group_Address      : EIB_GROUP_ADDR;
iData              : INT;
Scaling_Mode       : INT;
str_Rec            : EIB_REC;
CyclePolling       : TIME := t#500ms;
MinSendTime        : TIME := t#1s;

bStart: Activates the block. The block starts to work in dependence of the parameterized mode (see iMode).

iMode:
0 - At rising edge of bStart an EIB-Telegramm is sent. If bBusy the command is executed.
1 - Polling Mode: If bStart is TRUE EIB telegrams are sent with a time intervall of CyclePolling.
2 - OnChange Modus: If bStart is TRUE at change of data an EIB telegram is sent automatically. With MinSendTime the minimum interval between two EIB messages can be parameterized to avoid unnecessary load to the EIB network.

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

iData: Data that has to be sent. The value range depends on the Scaling_Mode.

Scaling_Mode:
0 - 0...100 [%]
1 - 0...360 [°]
2 - 0...255

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

CyclePolling: Polling time for the polling mode. The minimum time is 200ms.

MinSendTime: Intervall time that has to be last at minimum until another telegram is changed in OnChange mode. The minimum time is 200ms.

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bBusy: The block is active. For new functions wait until bBusy is set back to FALSE.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_8BIT_UNSIGN_SEND

Application

This function block sends a 8-bit EIB value to the set group address. An IEC61131-3 byte variable is available as input value. The data are only transferred if there is a change in the data value. If the value changes again within 1 second, new data are only sent to the EIB device after minSendTime has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
byData             : BYTE;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

byData: Data to be sent. Range of values 0x00...0xFF.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_8BIT_UNSIGN_SEND_EX

Application

This function block sends an 8 Bit EIB value to the parameterized group address. As entry value there is an IEC61131--3 Byte-Variable. In dependence of the mode (iMode) the data can be sent manually, by polling or on change.

VAR_INPUT

bStart             : BOOL;
iMode              : INT;
Group_Address      : EIB_GROUP_ADDR;
byData             : BYTE;
str_Rec            : EIB_REC;
CyclePolling       : TIME := t#500ms;
MinSendTime        : TIME := t#1s;

bStart: Activates the block. The block starts to work in dependence of the parameterized mode (see iMode).

iMode:
0 - At rising edge of bStart an EIB-Telegramm is sent. If bBusy the command is executed.
1 - Polling Mode: If bStart is TRUE EIB telegrams are sent with a time intervall of CyclePolling.
2 - OnChange Modus: If bStart is TRUE at change of data an EIB telegram is sent automatically. With MinSendTime the minimum interval between two EIB messages can be parameterized to avoid unnecessary load to the EIB network.

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

byData: Data that has to be sent. Value range 0x00...0xFF.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

CyclePolling: Polling time for the polling mode. The minimum time is 200ms.

MinSendTime: Intervall time that has to be last at minimum until another telegram is changed in OnChange mode. The minimum time is 200ms.

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bBusy: The block is active. For new functions wait until bBusy is set back to FALSE.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.

OnChange Mode:


EIB_ALL_DATA_TYPES_SEND

Application

This function block sends a freely selectable EIB value to the set group address. An IEC61131-3 byte ARRAY variable is available as input value. The data are sent depending on the set mode.

VAR_INPUT

bStart             : BOOL;
iMode              : INT;
Group_Address      : EIB_GROUP_ADDR;
DATA               : ARRAY [1..14] OF OF BYTE;
EIB_Data_Len       : USINT := 1;
PRIORITY           : EIB_PRIORITY := EIB_PRIORITY_LOW;
CyclePolling       : TIME := t#100ms;
MinSendTime        : TIME := t#1s;
str_Rec            : EIB_REC;

bStart: If the mode is set to 0, an EIB telegram with rising edge is sent to bStart .

iMode:
0 - manual (Fig. 1)
1 - polling (Fig. 2)
2 - OnChange (Fig. 3)

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

DATA: EIB data value.

EIB_Data_Len: Length of EIB data,
EIB values >=) 1 byte: use length +1,
EIB values < 1 byte: use length = 1

PRIORITY: EIB priority, low, high, alarm.

CyclePolling: Polling time for the polling mode. The minimum time is 200ms.

MinSendTime: Intervall time that has to be last at minimum until another telegram is changed in OnChange mode. The minimum time is 200ms.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bBusy: If the bit is set, the block is still active. As long as the bBusy bit is set, no new data can be transferred!

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.

Transfer mode

Mode 0 manual

Figure 1

Mode 1 Polling

Figure 2

Mode 2 OnChange

Figure 3


EIB_BIT_CONTROL_SEND

Application

This function block sends a 2-bit EIB value to the set group address. Two IEC61131-3 BOOL variables are available as input values. The data are only transferred if there is a change in one of the two data types. If the value changes again within 200 milliseconds, new data are only sent to the EIB device after another 200 millisecond has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
bControl           : BOOL;
bValue             : BOOL;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

bControl: Range of values TRUE/FALSE.

bValue: Range of values TRUE/FALSE.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs.

iErrorID: The iErrorID output issues an error code when an error occurs (EIB_ERROR_CODE)


EIB_BIT_SEND

Application

This function block sends a 1-bit EIB value to the set group address. An IEC61131-3 BOOL variable is available as input value. The data are only transferred if there is a change in the data value. If the value changes again within 200 milliseconds, new data are only sent to the EIB device after another 200 millisecond has passed (see diagram). No new EIB telegram is sent if the value changes within the "min. send time" but falls back to the old, already sent value within the "min. send time".

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
bData              : BOOL;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

bData: Range of values TRUE/FALSE.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_BIT_SEND_EX

Application

This function block sends an 1 Bit EIB value to the parameterized group address. In dependence of the mode (iMode) the data can be sent manually, by polling or on change.

VAR_INPUT

bStart             : BOOL;
iMode              : INT;
CyclePolling       : TIME := t#10s;
MinSendTime        : TIME := t#1s;
Group_Address      : EIB_GROUP_ADDR;
bData              : BOOL;
str_Rec            : EIB_REC;

bStart: Activates the block. The block starts to work in dependence of the parameterized mode (see iMode).

iMode:
0 - At rising edge of bStart an EIB-Telegramm is sent. If bBusy the command is executed.
1 - Polling Mode: If bStart is TRUE EIB telegrams are sent with a time intervall of CyclePolling.
2 - OnChange Modus: If bStart is TRUE at change of data an EIB telegram is sent automatically. With MinSendTime the minimum interval between two EIB messages can be parameterized to avoid unnecessary load to the EIB network.

CyclePolling: Polling time for the polling mode. The minimum time is 200ms.

MinSendTime: Intervall time that has to be last at minimum until another telegram is changed in OnChange mode. The minimum time is 200ms.

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

bData: Range of values TRUE/FALSE.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bBusy: The block is active. For new functions wait until bBusy is set back to FALSE.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_BIT_SEND_MANUAL

Application

This function block sends a 1-bit EIB value to the parameterized group address. As entry value there is an EC61131-3 BOOL-Variable. The data is sent at a rising edge of bSend. As long as the block is active, the bit bBusy is set. bBusy is set back to FALSE if the EIB command is sent or an error occurs. An error is displayed by setting the variable bError. In this case the error code is given in iErrorID.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
bSend              : BOOL;
bData              : BOOL;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

bSend: Positive edge sends EIB telegram.

bData: Range of values TRUE/FALSE.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bBusy: If the block is active bBusy is TRUE, if the EIB telegram is sent it is set back to FALSE.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_DATE_SEND

Application

This function block sends a 3-byte EIB value to the set group address. Three IEC61131-3 word variables are available as input values. The data are sent when the block is called for the first time the and then every 5 minutes.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
wDay               : WORD;
wMonth             : WORD;
wYear              : WORD;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

wDay: Range of values 1...31.

wMonth: Range of values 1...12.

wYear: Range of values 0...99. If a value greater 2000 entered, 2000 is automatically subtracted. For the year 2005, for example, only the 5 is transferred to the EIB node.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


EIB_READ_SEND

Application

This function block sends a Read_Group_Req to the set group address. For receiving a Read_Group_Res the group address filter of the KL6301 has to be parameterized accordingly.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
bRead              : BOOL;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

bRead: Rising edge starts the block and sends a Read_Group_Req to the EIB device. Warning: For receiving a response the group address must be entered in the filter!

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;
bBusy              : BOOL;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.

bBusy: The block is active. For new functions wait until bBusy is set back to FALSE.


EIB_TIME_SEND

Application

This function block sends a 3-byte EIB value to the set group address. Three IEC61131-3 word variables are available as input values. The data are sent when the block is called for the first time the and then every 5 minutes.

VAR_INPUT

Group_Address      : EIB_GROUP_ADDR;
wHoure             : WORD;
wMinute            : WORD;
wSecond            : WORD;
str_Rec            : EIB_REC;

Group_Address: Group address to which the data are sent (see EIB_GROUP_ADDR).

wHoure: Range of values 0..23.

wMinute: Range of values 0..59.

wSecond: Range of values 0..59.

str_Rec: The data structure with which the KL6301() function block must be linked (see EIB_REC).

VAR_OUTPUT

bError             : BOOL;
iErrorID           : EIB_ERROR_CODE;

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorID.

iErrorID: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.


Function

POUs | Description
F_CONV_2GROUP_TO_3GROUP | Conversion of a 2-level group address in a 3-level group address
F_CONV_3GROUP_TO_2GROUP | Conversion of a 3-level group address in a 2-level group address


F_CONV_2GROUP_TO_3GROUP

TwinCAT PLC Library: EIB

F_CONV_2GROUP_TO_3GROUP : EIB_GROUP_ADDR

Application

Conversion of a 2-level group address in a 3-level group address.

VAR_INPUT

IN      : EIB_GROUP_ADDR_2GROUP;

IN: 2-level group address (see EIB_GROUP_ADDR_2GROUP).


F_CONV_3GROUP_TO_2GROUP

TwinCAT PLC Library: EIB

F_CONV_3GROUP_TO_2GROUP : EIB_GROUP_ADDR_2GROUP

Application

Conversion of a 3-level group address in a 2-level group address.

VAR_INPUT

IN      : EIB_GROUP_ADDR;

IN: 3-level group address (see EIB_GROUP_ADDR).


Professional

POUs | Description
KL6301_Professional | Communication with KL6301


KL6301_Professional

Application

This function block deals with the KL6301 EIB Bus Terminal communication. It is used for configuring the KL6301 and for starting the data exchange with the EIB network.

Restrictions:

  • This block may only be called once for each KL6301!
  • In the PLC project this block may only be called once per cycle!
  • For the KL6301 addressed by the professional block no blocks from the basic interface may be used!

VAR_INPUT

bActivate             : BOOL;
bWrite                : BOOL;
bRead                 : BOOL;
EIB_PHYS_ADDR         : EIB_PHYS_ADDR;
EIB_GROUP_FILTER      : ARRAY [1..4] OF EIB_GROUP_FILTER;
wWriteGroupAddr       : EIB_GROUP_ADDR;
pWriteData            : DWORD;
EIB_PRIORITY          : EIB_PRIORITY := EIB_PRIORITY_LOW;
uiLen                 : USINT;
pReadData             : DWORD;

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

bWrite: In the event of a positive edge the block sends a WRITE_GROUP command.

bRead: In the event of a positive edge the block sends a READ_GROUP_REQ.

EIB_PHYS_ADDR: Physical EIB address (see EIB_PHYS_ADDR). The default address is 1.2.3. This address must be unique in the EIB network!

EIB_GROUP_FILTER: Group address filter (see EIB_GROUP_FILTER). A maximum of 4 filters are possible.

wWriteGroupAddr: Contains the group address of the telegram to be sent (see EIB_GROUP_ADDR).

pWriteData: Pointer to a variable containing the data of an EIB telegram to be sent. The data length is specified with uiLen.

EIB_PRIORITY: Specifies the priority of the EIB telegram. Default value is "EIB_PRIORITY_LOW" (see EIB_PRIORITY).

uiLen: Number of EIB data to be sent. For data lengths of less than 1 byte, a length of "1" should be entered. For data lengths greater of equal 1 byte, the length should be increased by 1.

pReadData: Pointer to a variable for storing the data of a received EIB telegram.

VAR_OUTPUT

bActive               : BOOL;
bWriteBusy            : BOOL;
bReadBusy             : BOOL;
bReceiveData          : BOOL;
bReady                : BOOL;
bError                : BOOL;
iErrorId              : EIB_Error_Code;
iLenDataRead          : INT;
GroupReceive          : EIB_GROUP_ADDR;
str_Data_Rec          : EIB_REC;

bActive: The block was activated.

bWriteBusy: The block processes a WRITE instruction. Once processing is complete, bWriteBusy is set to FALSE again.

bReadBusy: The block processes a READ instruction. Once processing is complete, bReadBusy is set to FALSE again.

bReceiveData: The block has received an EIB telegram. This is announced by briefly setting the variable to FALSE.

bReady: The block is ready for sending and receiving data.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable iErrorId.

iErrorId: The output issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously bError is TRUE.

iLenDataRead: Specifies the number of valid data received.

GroupReceive: Specifies the group address of the received EIB telegram (see EIB_GROUP_ADDR).

str_Data_Rec: The data structure with which the send and receive blocks are connected (see EIB_REC).

VAR_IN_OUT

KL6301_IN             : ARRAY [1..24] OF BYTE;
KL6301_OUT            : ARRAY [1..24] OF BYTE;

KL6301_IN: Linked with the KL6301 input addresses.

KL6301_OUT: Linked with the KL6301 output addresses.


Data types

TwinCAT PLC Library: EIB

Data types/Enums

Data types | Description
EIB_ERROR_CODE | Error messages
EIB_PRIORITY | Priority of the EIB telegram

Data types/Structure

Data types | Description
EIB_GROUP_ADDR | 3-level group address
EIB_GROUP_ADDR_2GROUP | 2-level group address
EIB_GROUP_FILTER | group filter
EIB_PHYS_ADDR | Physical address
EIB_REC | Connection between KL6301 and the read / send function blocks.


Enums

Data types | Description
EIB_ERROR_CODE | Error messages
EIB_PRIORITY | Priority of the EIB telegram


EIB_ERROR_CODE

Error messages of library.

TYPE EIB_ERROR_CODE :
(
  NO_EIB_ERROR                        := 0,
  WRONG_EIB_PHYS_ADDR                 := 1,
  WRONG_EIB_GROUP_ADDR                := 2,
  WRONG_EIB_GROUP_LEN                 := 3,
  WRONG_EIB_FIRMWARE                  := 10,
  WRONG_EIB_MODE                      := 11,
  WRONG_MODE                          := 12,
  WRONG_EIB_FIRMWARE_B1_NECESSARY     := 14,
  WRONG_EIB_DATA_LEN                  := 20,
  ERROR_EIB_SERVICE_NOT_SUPPORT       := 21,
  KL6301_TP_TOGGLE_ERROR              := 30,
  TIME_OUT                            := 31,
  KL6301_NO_RESPONSE_FROM_TERMINAL    := 32,
  ERROR_SEND_8BIT_WRONG_Scaling_Mode  := 40,
  ERROR_EIB_PHY_ADDR_NOT_SUPPORT      := 100,
  ERROR_EIB_WRITE_DATA                := 101,
  MONITOR_MODE_LEN_IS_NOT_OK_MUST_0   := 102,
  MONITOR_MODE_ADDR_IS_NOT_OK_MUST_0  := 103,
  ERROR_EIB_NO_ACK                    := 16#0BBB,
  ERROR_EIB_NO_COM_TO_TP              := 16#FAFB,
  ERROR_TP_TEMP_WARNING               := 16#0FCC,
  ERROR_TP_PROTOCOL_ERROR             := 16#17CC,
  ERROR_TP_TRANSMITTER_ERROR          := 16#27CC,
  ERROR_TP_RECEIVE_ERROR              := 16#47CC,
  ERROR_TP_SLAVE_COLLISION            := 16#87CC
)
END_TYPE

NO_EIB_ERROR: No error.

WRONG_EIB_PHYS_ADDR: Obsolete, no longer used.

WRONG_EIB_GROUP_ADDR: Input variable EIB_GROUP_FILTER.GROUP_ADDR is incorrect. Check GROUP_ADDR of the filter. MAIN must be less then 16, SUB_MAIN must be less then 8.

WRONG_EIB_GROUP_LEN: Input variable EIB_GROUP_FILTER.GROUP_LEN is incorrect. Wrong length of the filter. Check mode and length of filter.

WRONG_EIB_FIRMWARE: Mode is not supported with the firmware.

WRONG_EIB_MODE: Specified mode is not supported. Check iMode. Valid values are 0, 1 and 100.

WRONG_MODE: Input variable iMode has an wrong value.

WRONG_EIB_FIRMWARE_B1_NECESSARY: Firmware B1 or higher is required.

WRONG_EIB_DATA_LEN: Expected data length of the EIB telegram is wrong. Telegram is discarded. Check EIB group address and/or used data type.

ERROR_EIB_SERVICE_NOT_SUPPORT: EIB telegram is not supported.

KL6301_TP_TOGGLE_ERROR: Terminal did not responded for one second. Check the connection to the KL6301. Is it still in data exchange?

TIME_OUT: Terminal unresponsive during parameterization. Check the connection to the KL6301.

KL6301_NO_RESPONSE_FROM_TERMINAL: No connection to the KL6301. Either terminal does not exist or mapping error.

ERROR_SEND_8BIT_WRONG_Scaling_Mode: Incorrect or unsupported Scaling Mode.

ERROR_EIB_PHY_ADDR_NOT_SUPPORT: Physical addressing not allowed.

ERROR_EIB_WRITE_DATA: Obsolete. Is no longer used.

MONITOR_MODE_LEN_IS_NOT_OK_MUST_0: The length of the filter must be 0 for monitor mode.

MONITOR_MODE_ADDR_IS_NOT_OK_MUST_0: The addresses must be 0 for monitor mode.

ERROR_EIB_NO_ACK: No ACK received.

ERROR_EIB_NO_COM_TO_TP: No communication with the EIB hardware.

ERROR_TP_TEMP_WARNING: Temperature exceedance in KL6301.

ERROR_TP_PROTOCOL_ERROR: Protocol error on the EIB physics.

ERROR_TP_TRANSMITTER_ERROR: Protocol error on the EIB physics.

ERROR_TP_RECEIVE_ERROR: Protocol error on the EIB physics.

ERROR_TP_SLAVE_COLLISION: Too many collisions on the EIB physics. Reduce the EIB load.


EIB_PRIORITY

Priority of the EIB telegram.

TYPE EIB_PRIORITY :
(
  EIB_PRIORITY_LOW    := 1,
  EIB_PRIORITY_HIGH   := 2,
  EIB_PRIORITY_ALARM  := 3,
)
END_TYPE

EIB_PRIORITY_LOW: Priority low.

EIB_PRIORITY_HIGH: Priority high.

EIB_PRIORITY_ALARM: Priority alarm.


Structure

Data types | Description
EIB_GROUP_ADDR | 3-level group address
EIB_GROUP_ADDR_2GROUP | 2-level group address
EIB_GROUP_FILTER | group filter
EIB_PHYS_ADDR | Physical address
EIB_REC | Connection between KL6301 and the read / send function blocks.


EIB_GROUP_ADDR

3-level group address.

TYPE EIB_GROUP_ADDR :
STRUCT
  MAIN      : BYTE;
  SUB_MAIN  : BYTE;
  NUMBER    : BYTE;
END_STRUCT
END_TYPE

MAIN: Main group (range 0..15).

SUB_MAIN: Middle group (range 0..7).

NUMBER: Sub group (range 0..255).


EIB_GROUP_ADDR_2GROUP

2-level group address.

TYPE EIB_GROUP_ADDR_2GROUP :
STRUCT
  MAIN      : BYTE;
  SUB_MAIN  : WORD;
END_STRUCT
END_TYPE

MAIN: Main group (range 0..15).

SUB_MAIN: Sub group (range 0..2048).


EIB_GROUP_FILTER

Group filter.

TYPE EIB_GROUP_FILTER :
STRUCT
  GROUP_ADDR  : EIB_GROUP_ADDR;
  GROUP_LEN   : WORD;
END_STRUCT
END_TYPE

GROUP_ADDR: Group address (see EIB_GROUP_ADDR).

GROUP_LEN: iMode 0 - 0..63. iMode 1 - 0..31.


EIB_PHYS_ADDR

Physical address.

TYPE EIB_PHYS_ADDR :
STRUCT
  Area    : BYTE := 1;
  Line    : BYTE := 2;
  Device  : BYTE := 3;
END_STRUCT
END_TYPE

Area: 0..15.

Line: 0..15.

Device: 0..255.


EIB_REC

Connection between KL6301 and the read / send function blocks.

TYPE EIB_REC :
STRUCT
  Rec_Group       : EIB_GROUP_ADDR;
  Rec_Len         : INT;
  Rec_Idx         : INT := 1;
  Rec_Data        : ARRAY[1..15] OF BYTE;
  Rec_bWriteBusy  : BOOL;
  Rec_bReadBusy   : BOOL;
  Rec_bReady      : BOOL;
  Rec_bError      : BOOL;
  Rec_iErrorID    : EIB_Error_Code;
  pStr_Send       : DWORD;
  Rec_Data_rec    : BOOL;
END_STRUCT
END_TYPE

Rec_Group: Group address (see EIB_GROUP_ADDR).

Rec_Len: Length.

Rec_Idx: Index.

Rec_Data: Data bytes.

Rec_bWriteBusy: Data is sent.

Rec_bReadBusy: Data is read.

Rec_bReady: Ready.

Rec_bError: Becomes TRUE as soon as an error occurs. The error is described via the variable Rec_iErrorID.

Rec_iErrorID: Issues an error code when an error occurs (see EIB_ERROR_CODE). Simultaneously Rec_bError is TRUE.

pStr_Send:

Rec_Data_rec:


Download examples

CX or PC TwinCAT PLC

TwinCAT PLC project for the basic library:

BCxx00 Controller

Example for a Bus Terminal Controller of BCxx00 series and the basic library:

Example for a Bus Terminal Controller of BCxx00 series and the professional library:


Support and Service

Beckhoff and their partners around the world offer comprehensive support and service, making available fast and competent assistance with all questions related to Beckhoff products and system solutions.

Beckhoff's branch offices and representatives

Please contact your Beckhoff branch office or representative for local support and service on Beckhoff products!

The addresses of Beckhoff's branch offices and representatives round the world can be found on her internet pages:
http://www.beckhoff.com

You will also find further documentation for Beckhoff components there.

Beckhoff Headquarters

Beckhoff Automation GmbH

Huelshorstweg 20
33415 Verl
Germany

Phone: | +49(0)5246/963-0
Fax: | +49(0)5246/963-198
e-mail: | info@beckhoff.com
Beckhoff Support

Support offers you comprehensive technical assistance, helping you not only with the application of individual Beckhoff products, but also with other, wide-ranging services:

  • support
  • design, programming and commissioning of complex automation systems
  • and extensive training program for Beckhoff system components
Hotline: | +49(0)5246/963-157
Fax: | +49(0)5246/963-9157
e-mail: | support@beckhoff.com
Beckhoff Service

The Beckhoff Service Center supports you in all matters of after-sales service:

  • on-site service
  • repair service
  • spare parts service
  • hotline service
Hotline: | +49(0)5246/963-460
Fax: | +49(0)5246/963-479
e-mail: | service@beckhoff.com