Integration Thies weather station

This manual shows the integration of a Thies weather station Compact WSC11, 4.9056.10.000, using the template "FB_BA_Weatherstation_Thies".

Required hardware:

Required additional library:

Adding the template:

Click on the desired PLC project (1).
1. In the template repository, right-click on the template FB_BA_WeatherStation_Thies (2)
2. Add the template (3) and (4).
Integration Thies weather station 1:
3. The following dialog with the list of additionally implemented function blocks opens. Close the dialog with OK.
Integration Thies weather station 2:
4. All new PLC function blocks are now dragged into a folder Templates and can be distributed in the project if required.
Integration Thies weather station 3:
In the standard PLC project a weather station template FB_BA_Weatherstation_Draft is already included, which contains all necessary display objects and is intended for individual linking.
Integration Thies weather station 4:

Adding a fast task for serial communication

The serial terminal (KL6041) is configured to the following communication parameters during a PLC restart:

The process image must be set to 22 bytes beforehand.

After that the actual communication between terminal and weather station starts.

The function blocks required for this are available in the Tc2_SerialCom library and are called in the "FastCycle" method of the "FB_BA_Weatherstation_Thies" template. This call must be assigned to a faster task than the normal PLC cycle task.

1. Right-click POU to open the new window, select add (1) and POU (2).
Integration Thies weather station 5:
2. A window opens. Enter the name there (example MAIN_fast) (3). The POU type is a program in structured text (ST).
Integration Thies weather station 6:
In this program, the method FastCycle is now called.
3. Add a new item (2) by right-clicking on Tasks (1). Name it with a meaningful name, for example FastTask (3).
Integration Thies weather station 7:
This new task must now be set to a small cycle time. The 5 ms shown here are a recommendation
Integration Thies weather station 8:
A task reference must be created so that this task is available to the program part:
4. Right-click on the project (1), select add (2) then taskreference (3). A window opens. There, select the Task to which the reference should refer (4).
Integration Thies weather station 9:
The task reference now appears in the PLC part below. The function block that is to be called in this task can now be assigned to it.
5. Open a dialog by right-clicking on the task Fast Task(1), select add (2) and then existing item (3).
Integration Thies weather station 10:
A window will open where you can select the call program.
Integration Thies weather station 11:

Adding the serial communication library

Dragging in the template "FB_BA_WeatherStation_Thies" does not automatically add the required serial communication library. This must be inserted manually:

Integration Thies weather station 12:

Right-click on "References" (1) and select "Add Library" (2). In the window that opens, select the "Tc2_SerialCom" library (3) and confirm with "OK" (4).

Creating program links

The link variables for the process image of the serial terminal are located in the "FB_BA_WeatherStation_Thies" template. However, just because of the implementation of the template, they are not automatically available for linking. To do this, the solution must be rebuilt once.

It is important at this point that no other compilation errors occur in the program.

Integration Thies weather station 13:

Under "Build", select "Rebuild Solution". At this point, only the already existing PLC task has a process image.

Integration Thies weather station 14:

After an error-free creation, the link variables of the template are available and the Fast Task also holds a process image area.

Integration Thies weather station 15:

First, all input variables of the terminal process image are marked (click on status and then press the arrow down key while holding down the shift key) (1), then right-click and select "Multi-link" (2). Link to "stRawDataIn" of the template.

Integration Thies weather station 16:

The linking of the output data is done analogously.