ConOpSys V2970  P004.07
ANVILEX control operating system
PRT_Sensor.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file PRT_Sensor.h
3 //! @brief Platinum resistance thermometers class header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2020 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Common/PRT_Sensor.h $
7 //! $Revision: 2796 $
8 //! $Date: 2021-07-12 02:57:34 +0500 (Mo, 12 Jul 2021) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 
40 //------------------------------------------------------------------------------
41 // Protecting header files from mutual, recursive inclusion.
42 //------------------------------------------------------------------------------
43 
44 #pragma once
45 
46 //------------------------------------------------------------------------------
47 // Include standard libraries header files
48 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
51 // Include thrid party header files
52 //------------------------------------------------------------------------------
53 
54 //------------------------------------------------------------------------------
55 // Include ConOpSys header files
56 //------------------------------------------------------------------------------
57 
58 #include "Defines.h"
59 
60 //------------------------------------------------------------------------------
61 // Include ConOpSys application header files
62 //------------------------------------------------------------------------------
63 
64 //------------------------------------------------------------------------------
65 // Macros
66 //------------------------------------------------------------------------------
67 
68 //------------------------------------------------------------------------------
69 // Class fefinitions
70 //------------------------------------------------------------------------------
71 
72 //! @brief Platinum resistance thermometers (PRT) class
73 class TPRT
74 {
75 
76  //----------------------------------------------------------------------------
77  // Public defines, methods and variables
78  //----------------------------------------------------------------------------
79 
80  public:
81 
82  //--------------------------------------------------------------------------
83  // Public defines
84  //--------------------------------------------------------------------------
85 
86  //! @brief Platin resistance temperature scala
87  typedef enum
88  {
89 
90  //! @brief IPTS68 scala
92 
93  //! @ ITS90 scale
94  enum_ITS_90 = 2
95 
97 
98  //! @brief Platin resistance temperature sensor type
99  typedef enum
100  {
101 
102  //! @brief Pt100 based sensor
104 
105  //! @brief Pt200 based sensor
107 
108  //! @brief Pt500 based sensor
110 
111  //! @brief Pt1000 based sensor
113 
114  //! @brief Pt3000 based sensor
116 
117  //! @brief Pt6000 based sensor
119 
120  //! @brief Pt9000 based sensor
121  enum_Pt9000 = 7
122 
124 
125  //-------------------------------------------------------------------------------
126  // Public methods
127  //-------------------------------------------------------------------------------
128 
129  //!------------------------------------------------------------------------------
130  //! @brief The function calculates the electrical resistance for a Platinum Resistance Thermometer (PRT) at given temperature and defined resistance R0 at 0°C for a PRT element.
131  //! @note Only ITS-90 scala implemented
132  //! @param [out] *f32_Resistance Resistance at given temperature.
133  //! @param [in] f32_Temperature Temperature in degree celsius.
134  //! @param [in] enum_PRT_Scala Temperature scala
135  //! @param [in] enum_PRT_Type Type of the platinum resistance termomenter.
136  //! @return Converstion status code
137  //! @retval true Converstion successed
138  //! @retval false Converstion error
139  //! \par Override
140  //! Not allowed
141  //! @attention None
142  //! @dotfile TPRT__Temperature_To_Resistance.dt
143  //------------------------------------------------------------------------------
144 
145  BOOL Temperature_To_Resistance( F32 *f32_Resistance, F32 f32_Temperature, TPRT_Scala enum_PRT_Scala, TPRT_Type enum_PRT_Type );
146 
147  //!-------------------------------------------------------------------------
148  //! @brief The function calculates the electrical resistance for a Platinum Resistance Thermometer (PRT) at given temperature and defined resistance R0 at 0°C for a PRT element.
149  //! @note Only ITS-90 scala implemented
150  //! @param [out] *f32_Temperature Temperature in degree celsius.
151  //! @param [in] f32_Resistance Resistance at given temperature.
152  //! @param [in] enum_PRT_Scala Temperature scala
153  //! @param [in] enum_PRT_Type Type of the platinum resistance termomenter.
154  //! @return Converstion status code
155  //! @retval true Converstion successed
156  //! @retval false Conversuin error
157  //! \par Override
158  //! Not allowed
159  //! @attention None
160  //! @dotfile TPRT__Resistance_To_Temperature.dt
161  //--------------------------------------------------------------------------
162 
163  BOOL Resistance_To_Temperature( F32 *f32_Temperature, F32 f32_Resistance, TPRT_Scala enum_PRT_Scala, TPRT_Type enum_PRT_Type );
164 
165  //----------------------------------------------------------------------------
166  // Protected defines, methods and variables
167  //----------------------------------------------------------------------------
168 
169  protected:
170 
171  //----------------------------------------------------------------------------
172  // Private defines, methods and variables
173  //----------------------------------------------------------------------------
174 
175  private:
176 
177  //--------------------------------------------------------------------------
178  // Private methods
179  //--------------------------------------------------------------------------
180 
181  //!-------------------------------------------------------------------------
182  //! @brief The function returns base electrical resistance in ohms.
183  //! @note None
184  //! @param [out] *f32_Resistance Resistance at given temperature.
185  //! @param [in] enum_PRT_Type Type of the platinum resistance termomenter.
186  //! @return Converstion status code
187  //! @retval true Converstion successed
188  //! @retval false Conversuin error
189  //! \par Override
190  //! Not allowed
191  //! @attention None
192  //! @dotfile TPRT__Get_Base_Resistance.dt
193  //--------------------------------------------------------------------------
194 
195  BOOL Get_Base_Resistance( F32 *f32_Resistance, TPRT_Type enum_PRT_Type );
196 
197  //!-------------------------------------------------------------------------
198  //! @brief The function returns base electrical resistance in ohms.
199  //! @note None
200  //! @param [out] *f32_A Scala coefficient A.
201  //! @param [out] *f32_B Scala coefficient B.
202  //! @param [out] *f32_C Scala coefficient C.
203  //! @param [in] enum_PRT_Scala Temperature scala
204  //! @return Converstion status code
205  //! @retval true Converstion successed
206  //! @retval false Conversuin error
207  //! \par Override
208  //! Not allowed
209  //! @attention None
210  //! @dotfile TPRT__Get_Scala_Coefficients.dt
211  //--------------------------------------------------------------------------
212 
213  BOOL Get_Scala_Coefficients( F32 *f32_A, F32 *f32_B, F32 *f32_C, TPRT_Scala enum_PRT_Scala );
214 
215 };
216 
217 //------------------------------------------------------------------------------
218 // End of file
219 //------------------------------------------------------------------------------
ConOpSys data type definitions header file.
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
float F32
IEEE-754 32-Bit single presession floating point numbers datatype defenition.
Definition: Defines.h:324
Platinum resistance thermometers (PRT) class.
Definition: PRT_Sensor.h:74
BOOL Get_Base_Resistance(F32 *f32_Resistance, TPRT_Type enum_PRT_Type)
The function returns base electrical resistance in ohms.
Definition: PRT_Sensor.cpp:85
BOOL Temperature_To_Resistance(F32 *f32_Resistance, F32 f32_Temperature, TPRT_Scala enum_PRT_Scala, TPRT_Type enum_PRT_Type)
The function calculates the electrical resistance for a Platinum Resistance Thermometer (PRT) at give...
Definition: PRT_Sensor.cpp:299
TPRT_Type
Platin resistance temperature sensor type.
Definition: PRT_Sensor.h:100
@ enum_Pt200
Pt200 based sensor.
Definition: PRT_Sensor.h:106
@ enum_Pt500
Pt500 based sensor.
Definition: PRT_Sensor.h:109
@ enum_Pt1000
Pt1000 based sensor.
Definition: PRT_Sensor.h:112
@ enum_Pt6000
Pt6000 based sensor.
Definition: PRT_Sensor.h:118
@ enum_Pt3000
Pt3000 based sensor.
Definition: PRT_Sensor.h:115
@ enum_Pt100
Pt100 based sensor.
Definition: PRT_Sensor.h:103
@ enum_Pt9000
Pt9000 based sensor.
Definition: PRT_Sensor.h:121
BOOL Get_Scala_Coefficients(F32 *f32_A, F32 *f32_B, F32 *f32_C, TPRT_Scala enum_PRT_Scala)
The function returns base electrical resistance in ohms.
Definition: PRT_Sensor.cpp:229
TPRT_Scala
Platin resistance temperature scala.
Definition: PRT_Sensor.h:88
@ enum_IPTS_68
IPTS68 scala.
Definition: PRT_Sensor.h:91
@ enum_ITS_90
@ ITS90 scale
Definition: PRT_Sensor.h:94
BOOL Resistance_To_Temperature(F32 *f32_Temperature, F32 f32_Resistance, TPRT_Scala enum_PRT_Scala, TPRT_Type enum_PRT_Type)
The function calculates the electrical resistance for a Platinum Resistance Thermometer (PRT) at give...
Definition: PRT_Sensor.cpp:421