FB_EnOceanSTM100
![FB_EnOceanSTM100 1:](Images/gif/173347979__en-US__Web.gif)
![]() | Outdated For new projects the block FB_EnOceanSTM100Generic() should be used! |
The function block FB_EnOceanSTM100() provides a user-friendly evaluation of the data of an EnOcean STM100 module. The function block FB_EnOceanReceive() is required for this purpose.
![]() | A new instance of this function block must be created for each button module used. |
Inputs
VAR_INPUT
bEnable : BOOL := FALSE;
tWatchdog : TIME;
nTransmitterId : UDINT;
stEnOceanReceivedData : ST_EnOceanReceivedData;
END_VAR
Name | Type | Description |
---|---|---|
bEnable | BOOL | A positive signal at this input activates the function block. A negative signal at the input disables the function block functionality, and all outputs are set to 0 or FALSE. |
tWatchdog | TIME | Monitoring time. Within this time, new information must reach this function block via the input stEnOceanReceivedData described below. If this time is set to t#0s, the watchdog function is inactive. |
nTransmitterId | UDINT | ID of the EnOcean module, to which the function block should respond. |
stEnOceanReceivedData | Information and required connection to the EnOcean receive function block FB_EnOceanReceive(). This information is stored in a structure. |
Outputs
VAR_OUTPUT
eEnOceanRotarySwitch : E_EnOceanRotarySwitch;
nSetpoint : INT;
nTemperature : INT;
bPresentSwitch : BOOL;
bLearnSwitch : BOOL;
bError : BOOL := FALSE;
nErrorId : UDINT := 0;
END_VAR
Name | Type | Description |
---|---|---|
eEnOceanRotarySwitch | The output at this output describes the position of the rotary switch on the room control unit. | |
nSetpoint | INT | This output variable indicates the setpoint value set on the device. The values can range from -100 to +100. |
nTemperature | INT | The measured temperature is output here in 1/10 °C with a measuring range of 0 °C to 40 °C. If the watchdog is triggered, the function block assumes a wire break-like fault and the value is fixed at 850 °C. |
bPresentSwitch | BOOL | If the presence button at the room control unit is activated, this output becomes TRUE. |
bLearnSwitch | BOOL | If the learn button at the room control unit is activated, this output becomes TRUE. |
bError | BOOL | This output goes TRUE as soon as an error occurs. This error is described via the variable nErrorID. |
nErrorId | UDINT | Describes the type of error. |
The following sample program illustrates the operating principle of this function block:
PROGRAM MAIN
VAR
fbEnOceanReceive : FB_EnOceanReceive;
fbEnOceanSTM100_1 : FB_EnOceanSTM100;
fbEnOceanSTM100_2 : FB_EnOceanSTM100;
nTemperature : ARRAY [1..2] OF INT;
nSetpoint : ARRAY [1..2] OF INT;
nStateRotarySwitch : ARRAY [1..2] OF E_EnOceanRotarySwitch;
bPresentSwitch : ARRAY [1..2] OF BOOL;
END_VAR
fbEnOceanReceive(
bEnable := TRUE,
stEnOceanInData := stEnOceanInData,
stEnOceanOutData := stEnOceanOutData);
fbEnOceanSTM100_1(
bEnable := NOT fbEnOceanReceive.bError AND fbEnOceanReceve.bEnable,
nTransmitterId := 16#000000C4,
tWatchdog:=t#1h,
stEnOceanReceivedData := fbEnOceanReceive.stEnOceanReceivedData
nTemperature => Temperature[1],
nSetpoint => nSetpoint[1] ,
eEnOceanRotarySwitch => nStateRotarySwitch[1],
bPresentSwitch => bPresentSwitch[1]);
fbEnOceanSTM100_2(
bEnable := NOT fbEnOceanReceive.bError AND fbEnOceanReceive.bEnable,
nTransmitterId := 16#000000C5,
tWatchdog:=t#0s,
stEnOceanReceivedData := fbEnOceanReceive.stEnOceanReceivedData
nTemperature => Temperature[2],
nSetpoint => nSetpoint[2] ,
eEnOceanRotarySwitch => nStateRotarySwitch[2],
bPresentSwitch => bPresentSwitch[2]);
In this sample program two room control units are queried; one with the transmitter ID 16#000000C4 and another one with the transmitter ID 16#000000C5. A function block FB_EnOceanSTM100 is created for each of the two function blocks. Both function blocks obtain their information from the upstream receive function block FB_EnOceanReceive and are only active (input bEnable) if the receive function block is active and not in error. The first device is monitored by the watchdog function, whereby new values must be transmitted to the control unit within 1 hour; the second device is programmed without watchdog monitoring. The values output to the function blocks are assigned to flags for further evaluation.
Requirements
Development environment | required TC3 PLC library |
---|---|
TwinCAT v3.1.4020.14 | Tc2_EnOcean from v3.3.5.0 |