ConOpSys V2970  P004.07
ANVILEX control operating system
KG3_CAB_EXT_T1.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file KG3_CAB_EXT_T1.h
3 //! @author ANVILEX LLC
4 //! @version V1.0
5 //! @date 02.11.2018
6 //! @brief Function block template class header file.
7 //! @attention
8 //!
9 //! COPYRIGHT(C) 2018-2021 ANVILEX LLC
10 //!
11 //! Redistribution and use in source and binary forms, with or without
12 //! modification, are permitted provided that the following conditions are met:
13 //!
14 //! 1. Redistributions of source code must retain the above copyright notice,
15 //! this list of conditions and the following disclaimer.
16 //!
17 //! 2. Redistributions in binary form must reproduce the above copyright notice,
18 //! this list of conditions and the following disclaimer in the documentation
19 //! and/or other materials provided with the distribution.
20 //!
21 //! 3. Neither the name of ANVILEX nor the names of its contributors may be
22 //! used to endorse or promote products derived from this software without
23 //! specific prior written permission.
24 //!
25 //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 //! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 //! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 //! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 //! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 //! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 //! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 //! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 //! POSSIBILITY OF SUCH DAMAGE.
36 //------------------------------------------------------------------------------
37 
38 //------------------------------------------------------------------------------
39 // Protecting header files from mutual, recursive inclusion.
40 //------------------------------------------------------------------------------
41 
42 #pragma once
43 
44 //------------------------------------------------------------------------------
45 // Include standard libraries header files
46 //------------------------------------------------------------------------------
47 
48 //------------------------------------------------------------------------------
49 // Include thrid party header files
50 //------------------------------------------------------------------------------
51 
52 //------------------------------------------------------------------------------
53 // Include ConOpSys header files
54 //------------------------------------------------------------------------------
55 
56 #include "Function_Block_Base.h"
57 #include "PRT_Sensor.h"
58 
59 //------------------------------------------------------------------------------
60 // Include ConOpSys application header files
61 //------------------------------------------------------------------------------
62 
63 //------------------------------------------------------------------------------
64 // Macros
65 //------------------------------------------------------------------------------
66 
67 //------------------------------------------------------------------------------
68 // Class declarations
69 //------------------------------------------------------------------------------
70 
71 //! @brief Cabunet board class, type 1 declaration
73 {
74 
75  //----------------------------------------------------------------------------
76  // Public defines, variables and methods
77  //----------------------------------------------------------------------------
78 
79  public:
80 
81  //! @brief Register structure for generic access
82  typedef struct
83  {
84 
85  //! @brief 0x00 : Module identification register
87 
88  //! @brief 0x01 : Module identification register
90 
91  //! @brief 0x02 : Control register
93 
94  //! @brief 0x03 : Status register
96 
97  //! @brief 0x04 : Cabinet temperature register
99 
101 
102  //--------------------------------------------------------------------------
103  // Constructor and destructor methods
104  //--------------------------------------------------------------------------
105 
106  //!-------------------------------------------------------------------------
107  //! @brief Function block class constructor method.
108  //! @note None
109  //! \par Override
110  //! Not allowed
111  //! @attention Don't call this method directly.
112  //--------------------------------------------------------------------------
113 
114  TKG3_CAB_EXT_T1();
115 
116  //!-------------------------------------------------------------------------
117  //! @brief Function block class desstructor method.
118  //! @note None
119  //! \par Override
120  //! Not allowed
121  //! @attention Don't call this method directly.
122  //--------------------------------------------------------------------------
123 
125 
126  //!-------------------------------------------------------------------------
127  //! @brief Hardware mapping method.
128  //! @note None
129  //! @param [in] *struct_Registers_Base_Address - Base adress to register structure mapping
130  //! \par Override
131  //! Not allowed
132  //! @attention None
133  //--------------------------------------------------------------------------
134 
135  VOID Map( TKG3_CAB_EXT_T1_Registers *struct_Registers_Base_Address );
136 
137  //!-------------------------------------------------------------------------
138  //! @brief Function block initialisation method.
139  //! @note None
140  //! \par Override
141  //! Not allowed
142  //! @attention None
143  //--------------------------------------------------------------------------
144 
145  virtual VOID Init();
146 
147  //!-------------------------------------------------------------------------
148  //! @brief Function block execution method.
149  //! @note None
150  //! \par Override
151  //! Not allowed
152  //! @attention None
153  //--------------------------------------------------------------------------
154 
155  virtual VOID Execute();
156 
157  //!-------------------------------------------------------------------------
158  //! @brief Send information about driver over communication link protocol
159  //! @note This method sends information about driver over specified communication link protocol.
160  //! @param [in] *object_Protocol - Pointer to the communication link protocol
161  //! @return None
162  //! \par Override
163  //! Not allowed
164  //! @attention None
165  //--------------------------------------------------------------------------
166 
167  virtual VOID Send_Information( TProtocol_Base *object_Protocol );
168 
169  //--------------------------------------------------------------------------
170  // Function block parameters
171  //--------------------------------------------------------------------------
172 
173  //--------------------------------------------------------------------------
174  // Function block inputs
175  //--------------------------------------------------------------------------
176 
177  //! @brief Cabinet temperature offset output connector
179 
180  //! @brief Cabinet temperature offset input connector
182 
183  //! @brief Fan control input connector
185 
186  //! @brief Heater control input connector
188 
189  //! @brief Temperature gain value
191 
192  //! @brief Temperature offset value
194 
195  //--------------------------------------------------------------------------
196  // Function block outputs
197  //--------------------------------------------------------------------------
198 
199  //! @brief Door status output connector
201 
202  //! @brief Door emergency stop button status output connector
204 
205  //! @brief Fan state
207 
208  //! @brief Heater state
210 
211  //! @brief Raw data temperature value
213 
214  //! @brief Temperature value after processing
216 
217  //----------------------------------------------------------------------------
218  // Protected defines, variables and methods
219  //----------------------------------------------------------------------------
220 
221  protected:
222 
223  //----------------------------------------------------------------------------
224  // Private defines, variables and methods
225  //----------------------------------------------------------------------------
226 
227  private:
228 
229  //! @brief Structure control register for bit parsing
230  typedef union
231  {
232 
233  //! @brief Raw data
235 
236  //! @brief Structure of the bits
237  struct
238  {
239 
240  //! @brief Bit 0, Cabinet heater control
242 
243  //! @brief Bit 1, Cabinet fan control
245 
246  //! @brief Bits 2..15, unused bits
247  U16 :14;
248 
249  };
250 
251  }TControl_Register;
252 
253  //! @brief Structure status register for bit parsing
254  typedef union
255  {
256 
257  //! @brief Raw data
259 
260  //! @brief Structure of the bits
261  struct
262  {
263 
264  //! @brief Bit 0, Cabinet door status
266 
267  //! @brief Bit 1, Cabinet emergency stop button status
269 
270  //! @brief Bits 2..15, unused bits
271  U16 :14;
272 
273  };
274 
275  }TStatus_Register;
276 
277  //! @brief object PRT
279 
280  //! @brief Sensor valid data count
282 
283  //! @brief Open sensor error count
285 
286  //! @brief Short sensor error coun
288 
289  //! @brief Pointer to the memory area in FPGA address space
291 
292 };
293 
294 //------------------------------------------------------------------------------
295 // End of file
296 //------------------------------------------------------------------------------
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
Function block base class header file.
Platinum resistance thermometers class header file.
Function block input connector class.
Definition: Block_Input_Connector.h:83
Function block output connector class.
Definition: Block_Output_Connector.h:59
Function block base class for device.
Definition: Function_Block_Base.h:96
Cabunet board class, type 1 declaration.
Definition: KG3_CAB_EXT_T1.h:73
TBlock_Output_Connector object_u16_Temperature_Raw_Data
Raw data temperature value.
Definition: KG3_CAB_EXT_T1.h:212
TKG3_CAB_EXT_T1()
Function block class constructor method.
Definition: KG3_CAB_EXT_T1.cpp:73
TBlock_Input_Connector object_bool_Fan_Control
Fan control input connector.
Definition: KG3_CAB_EXT_T1.h:184
TBlock_Input_Connector object_f32_Temperature_Gain
Cabinet temperature offset output connector.
Definition: KG3_CAB_EXT_T1.h:178
TBlock_Input_Connector object_f32_Gain
Temperature gain value.
Definition: KG3_CAB_EXT_T1.h:190
TBlock_Input_Connector object_bool_Heater_Control
Heater control input connector.
Definition: KG3_CAB_EXT_T1.h:187
virtual VOID Send_Information(TProtocol_Base *object_Protocol)
Send information about driver over communication link protocol.
Definition: KG3_CAB_EXT_T1.cpp:232
U32 u32_Sensor_Valid_Data_Count
Sensor valid data count.
Definition: KG3_CAB_EXT_T1.h:281
U32 u32_Sensor_Short_Error_Count
Short sensor error coun.
Definition: KG3_CAB_EXT_T1.h:287
U32 u32_Sensor_Open_Error_Count
Open sensor error count.
Definition: KG3_CAB_EXT_T1.h:284
virtual VOID Execute()
Function block execution method.
Definition: KG3_CAB_EXT_T1.cpp:141
~TKG3_CAB_EXT_T1()
Function block class desstructor method.
Definition: KG3_CAB_EXT_T1.cpp:110
TBlock_Output_Connector object_bool_Door_Emergency_Stop_Button_Status
Door emergency stop button status output connector.
Definition: KG3_CAB_EXT_T1.h:203
VOID Map(TKG3_CAB_EXT_T1_Registers *struct_Registers_Base_Address)
Hardware mapping method.
Definition: KG3_CAB_EXT_T1.cpp:118
TBlock_Input_Connector object_f32_Offset
Temperature offset value.
Definition: KG3_CAB_EXT_T1.h:193
virtual VOID Init()
Function block initialisation method.
Definition: KG3_CAB_EXT_T1.cpp:133
TBlock_Output_Connector object_bool_Fan_Contactor_Status
Fan state.
Definition: KG3_CAB_EXT_T1.h:206
TPRT object_PRT
object PRT
Definition: KG3_CAB_EXT_T1.h:278
TBlock_Output_Connector object_bool_Heater_Contactor_Status
Heater state.
Definition: KG3_CAB_EXT_T1.h:209
TBlock_Output_Connector object_f32_Temperature
Temperature value after processing.
Definition: KG3_CAB_EXT_T1.h:215
TBlock_Output_Connector object_bool_Door_Status
Door status output connector.
Definition: KG3_CAB_EXT_T1.h:200
volatile TKG3_CAB_EXT_T1_Registers * struct_Registers
Pointer to the memory area in FPGA address space.
Definition: KG3_CAB_EXT_T1.h:290
TBlock_Input_Connector object_f32_Temperature_Offset
Cabinet temperature offset input connector.
Definition: KG3_CAB_EXT_T1.h:181
Platinum resistance thermometers (PRT) class.
Definition: PRT_Sensor.h:74
Definition: Protocol_Base.h:57
Register structure for generic access.
Definition: KG3_CAB_EXT_T1.h:83
U16 u16_Control_Register
0x02 : Control register
Definition: KG3_CAB_EXT_T1.h:92
U16 u16_Unit_ID_L
0x00 : Module identification register
Definition: KG3_CAB_EXT_T1.h:86
U16 u16_Cabinet_Temperature_Register
0x04 : Cabinet temperature register
Definition: KG3_CAB_EXT_T1.h:98
U16 u16_Unit_ID_H
0x01 : Module identification register
Definition: KG3_CAB_EXT_T1.h:89
U16 u16_Status_Register
0x03 : Status register
Definition: KG3_CAB_EXT_T1.h:95
U16 u16_Raw_Data
Raw data.
Definition: KG3_CAB_EXT_T1.h:234
U16 bool_Cabinet_Fan_Control
Bit 1, Cabinet fan control.
Definition: KG3_CAB_EXT_T1.h:244
U16 bool_Cabinet_Heater_Control
Bit 0, Cabinet heater control.
Definition: KG3_CAB_EXT_T1.h:241
U16 bool_Cabinet_Door_Status
Bit 0, Cabinet door status.
Definition: KG3_CAB_EXT_T1.h:265
U16 bool_Cabinet_Emergency_Stop_Status
Bit 1, Cabinet emergency stop button status.
Definition: KG3_CAB_EXT_T1.h:268
U16 u16_Raw_Data
Raw data.
Definition: KG3_CAB_EXT_T1.h:258