While programming a small OpenPLC project I created some function blocks which might be useful for someone else. Therefore, I post them here. You will find them in the ZIP-file containing a blank project with the blocks. To use them, just use copy-paste.
Short description below. Detailed one in the PDF attached.

1) „Rnd_any_DecPt“: 

2) „Analog_IN_Realtemp_OUT“: 

If you like to measure temperatures with an transmitter which converts the resistance of a probe (normally PT100, PT1000) into a voltage or currency signal using an analog input, you might find this function block useful. It converts the analog input into a temperature value. 

3) “Two_Steps_Burner_PID”: 

This is a bit weird function block. We needed this one to control a 200KW gas burner from a brewery. 

4) “Hysetrese2”: 

This function block I converted from the “OSCAT-Library”. 

5) „Well_pak_steu“: 

This FB is used to control the power of an AC-resistive-load or the speed of an AC-motor. Typically used in controlling electric heaters or circulating pumps in heating systems. 

6) “PT_Calc“: 

If you measure temperature with PT probes you might have recognized that there are several approaches. An easy way is described above: „Analog_IN_Realtemp_OUT“. There are two limitations: First, it’s not the best way in terms of accuracy. Second, you have to define the range of temperature to be measured in advance due to PT’s non-linearity over wider temperature ranges. Here you find a way which solves both limitations: You can use a PT probe in range of -200-850°C. And the resolution is much higher (16bit). I get my raw data from a MAX31865 chip, converted into a resistance at first. The resistance is converted into temperature by two equitation. 
Quote 0 0