FB_Rec_Teach_In 1:

This function block indicates when a learn button is pressed on an EnOcean device. If the flag bLearnType is set, further information about the EnOcean device can be read. This function must be provided by the EnOcean device. So far, however, it is only supported by very few EnOcean devices.


bStart     : BOOL;
byNode     : BYTE;
str_KL6581 : STR_KL6581;

bStart: If TRUE the block is activated, if FALSE it is deactivated.

byNode: Filter - if the value is zero the EnOcean telegrams from all KL6583s are received. If a value of 1 to 8 is entered, only the data from the corresponding KL6583 are received.

str_KL6581: Is linked with the data structure of block FB_KL6581() (see STR_KL6581).


bLearnType   : BOOL;
by_Node      : BYTE;
dw_ID        : DWORD;
str_Teach_In : STR_Teach_In;
bReceive     : BOOL := TRUE;

bLearnType: If the bit is set you will find further data in the str_Teach_In structure.

by_Node: Number of EnOcean devices found.

dw_ID: EnOcean ID for which the teach-in button was pressed.

str_Teach_In: Data structure, profile, type and manufacturer ID (see STR_Teach_In).

bReceive: On receiving an EnOcean telegram this value is set to FALSE for one cycle.


Development environment

required TC3 PLC library

TwinCAT v3.1.4020.14

Tc2_EnOcean from v3.3.5.0