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.


Connecting the WRF08 RS 485 MODBUS room control unit - introduction

Beckhoff Knowledge Base: Communication with the WRF08 RS485 MODBUS room control unit by Thermokon

Introduction

The following example shows how you can communicate between TwinCAT and the eight-button WRF08 8T RS485 MODBUS room control unit by Thermokon (www.thermokon.de). The example is restricted to basic functions in order to integrate the room control unit in an application.

There are different versions of the room control unit with respect to the number of function buttons. The device has an internal temperature sensor. The function buttons can be scanned and the display controlled via the Modbus communication interface.

Requirements

  • Microsoft Windows with TwinCAT PLC (from version 2.10) for programming and commissioning
  • TwinCAT PLC Modbus RTU (software library for TwinCAT)
  • TwinCAT PLC Serial Communication (software library for TwinCAT)
  • Knowledge of programming in IEC 61131-3 under TwinCAT
  • KL6041(serial interface RS485)
  • WRF08 by Thermokon

Overview

Application examples | Comment
Application example: PLC_KL6041.zip | Target platform CX (ARM)

Libraries to be linked:


Connecting the WRF08 RS 485 MODBUS room control unit to a KL6041

Beckhoff Knowledge Base: Communication with the WRF08 RS485 MODBUS room control unit by Thermokon

Connecting the WRF08 RS485 MODBUS room control unit to a KL6041

The room control unit has four connections. Data is output on terminals 1 (Net A) and 2 (Net B). The terminals 3 (24 V DC) and 4 (GND) are intended for the power supply.

It is essential to follow the manufacturer’s installation instructions. www.thermokon.de

Connect the room control unit to the KL6041 terminal as follows:

On the KL6041, pins 1 and 2 (Data +) and pins 5 and 6 (Data -) must be connected to each other.

Terminal settings

Set the KL6041 Terminal with the KS2000 Software to the following values:

General Settings:

  • 22 data bytes in the process image
  • Half duplex
  • Transfer rate optimisation

RS485 interface parameters:

  • 9600 baud
  • 8 data bits, even parity
  • no parity
  • 1 stop bit


WRF08-RS485-Modbus protocol description

The WRF08-RS485-Modbus protocol description can be downloaded from the Thermokon company’s website.

Note: Further information on the WRF08-RS485-Modbus can similarly be obtained from Thermokon (www.thermokon.de).


STOutRegs

TYPE STOutRegs :
STRUCT
  wButton                   : WORD;              (* Shows the state of the button: 1 = pressed; 0 = not pressed*)
  wButtonBufferd            : WORD;              (* Button press is stored intermediately until the next readout of the register*)
  iTemperature              : INT;               (* Temperature value measured by the internal temperature sensor, in tenths of a degree*)
  iSetTemp1Offset           : INT;               (* Setpoint temperature 1 offset*)
  wSetTemp1Effective        : WORD;              (* Setpoint temperature 1 effective*)
  iSetTemp2Offset           : INT;               (* Setpoint temperature 2 offset*)
  wSetTemp2Effective        : WORD;              (* Setpoint temperature 2 effective*)
  iSetPercent1Offset        : INT;               (* Setpoint percentage 1 offset*)
  wSetPercent1Effective     : WORD;              (* Setpoint percentage 1 effective*)
  iSetPercent2Offset        : INT;               (* Setpoint percentage 2 offset*)
  wSetPrecent2Effective     : WORD;              (* Setpoint percentage 2 effective*)
  iSetpoint1Offset          : INT;               (* Setpoint value 1 offset*)
  wSetpointEffective        : WORD;              (* Setpoint value 1 effective*)
  iSetpoint2Offset          : INT;               (* Setpoint value 2 offset*)
  wSetpoint2Effective       : WORD;              (* Setpoint value 2 effective*)
  wFanStage                 : WORD;              (* Fan stage *)
  wRoomOccupancy            : WORD;              (* Room occupancy *)
END_STRUCT
END_TYPE

This structure contains the state of the output register of the room control unit (register 257 to register 273).


STReadConfigRegs

TYPE STReadConfigRegs :
STRUCT
  wNumberOfButtons             : WORD;             (* WRF08 with the number of function operating buttons*)
  wDeviceLocationID            : WORD;             (* Device location ID*)
  wIllumRest                   : WORD;             (*Intensity of the LCD background lighting after 15 sec without pressing a button*)
  wIllumActive                 : WORD;             (* Intensity of the LCD background lighting when a button is pressed*)
  wIllumLabelRest              : WORD;             (* Intensity of the label background lighting after 15 sec without pressing a button*)
  wIllumLabelActive            : WORD;             (* Intensity of the label background lighting when a button is pressed*)
  wButtonT1                    : WORD;             (* Function button T1 *)
  wButtonT2                    : WORD;             (* Function button T2 *)
  wButtonT3                    : WORD;             (* Function button T3 *)
  wButtonT4                    : WORD;             (* Function button T4 *)
  wButtonT5                    : WORD;             (* Function button T5 *)
  wButtonT6                    : WORD;             (* Function button T6 *)
  wButtonT7                    : WORD;             (* Function button T7 *)
  wButtonT8                    : WORD;             (* Function button T8 *)
  wButtonT9                    : WORD;             (* Function button T9 *)
  wButtonT10                   : WORD;             (* Function button T10 *)
  wButtonT11                   : WORD;             (* Function button T11 *)
  wButtonT12                   : WORD;             (* Function button T12 *)
  wLEDT5                       : WORD;             (* Function LED T5 *)
  wLEDT6                       : WORD;             (* Function LED T6 *)
  wLEDT7                       : WORD;             (* Function LED T7 *)
  wLEDT8                       : WORD;             (* Function LED T8 *)
  wLEDT9                       : WORD;             (* Function LED T9 *)
  wLEDT10                      : WORD;             (* Function LED T10 *)
  wLEDT11                      : WORD;             (* Function LED T11 *)
  wLEDT12                      : WORD;             (* Function LED T12 *)
  wDispWeekday                 : WORD;             (* Display of the day of the week*)
  wDispDate                    : WORD;             (* Display of the date*)
  wDispTime                    : WORD;             (* Display of the time*)
  wDispTimeMode                : WORD;             (* Display of the time mode*)
  wDispUpdate                  : WORD;             (* Update interval of the display in seconds*)
  wMinResponseTime             : WORD;             (* Min. response time*)
  wCalibrationOffset           : WORD;             (* Temperature offset for calibrating the temperature sensor*)
  wTemp1UpperRange             : WORD;             (* Upper temperature setting range, set temperature 1*)
  wTemp1LowerRange             : WORD;             (* Lower temperature setting range, set temperature 1*)
  wJumpDistTemp1               : WORD;             (* Jump distance for set temperature 1 *)
  wSetTemp1                    : WORD;             (* Set temperature 1; basic setpoint after reset*)
  wTemp2UpperRange             : WORD;             (* Upper temperature setting range, set temperature 2 *)
  wTemp2LowerRange             : WORD;             (* Lower temperature setting range, set temperature 2 *)
  wJumpDistTemp2               : WORD;             (* Jump distance for set temperature 2 *)
  wSetTemp2                    : WORD;             (* Set temperature 2; basic setpoint after reset*)
  wAdjust1PercentUpper         : WORD;             (* Upper setting range, set percentage value 1*)
  wAdjust1PercentLower         : WORD;             (* Lower setting range, set percentage value 1 *)
  wJumpDist1Percent            : WORD;             (* Jump distance for set percentage value 1*)
  wSetTemp1Percent             : WORD;             (* Set percentage value 1; basic setpoint after reset*)
  wAdjust2PercentUpper         : WORD;             (* Upper setting range, set percentage value 2*)
  wAdjust2PercentLower         : WORD;             (* Lower setting range, set percentage value 2 *)
  wJumpDist2Percent            : WORD;             (* Jump distance for set percentage value 2*)
  wSetTemp2Percent             : WORD;             (* Set percentage value 2; basic setpoint after reset*)
  wUpperRange1Setpoint         : WORD;             (* Upper setting range, setpoint 1*)
  wLowerRange1Setpoint         : WORD;             (* Lower setting range, setpoint 1*)
  wJumpDist1Setpoint           : WORD;             (* Jump distance for setpoint 1*)
  wSetPoint1                   : WORD;             (* Setpoint 1; basic setpoint after reset*)
  wUpperRange2Setpoint         : WORD;             (* Upper setting range, setpoint 2*)
  wLowerRange2Setpoint         : WORD;             (* Lower setting range, setpoint 2*)
  wJumpDist2Setpoint           : WORD;             (* Jump distance for setpoint 2*)
  wSetPoint2                   : WORD;             (* Setpoint 2; basic setpoint after reset*)
  wFanStages                   : WORD;             (* Number of fan stages*)
END_STRUCT
END_TYPE

The user has the possibility to parameterise the room control unit via the configuration register. Each parameter is predefined as standard with preset values that can be changed to suit the application.