ConOpSys V2970  P004.07
ANVILEX control operating system
Function_Block_Environment.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Function_Block_Environment.h
3 //! @URL $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Blocks/Function_Block_Environment.h $
4 //! @author $Author: minch $ (ANVILEX GmbH)
5 //! @version $Revision: 2904 $
6 //! @date $Date: 2021-12-02 02:39:23 +0500 (Do, 02 Dez 2021) $
7 //! @brief Environment class header file.
8 //! @attention
9 //!
10 //! COPYRIGHT(C) 2015-2018 ANVILEX GmbH
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 // Protecting header files from mutual, recursive inclusion.
41 //------------------------------------------------------------------------------
42 
43 #pragma once
44 
45 //------------------------------------------------------------------------------
46 // Include standard libraries header files
47 //------------------------------------------------------------------------------
48 
49 //------------------------------------------------------------------------------
50 // Include thrid party header files
51 //------------------------------------------------------------------------------
52 
53 //------------------------------------------------------------------------------
54 // Include ConOpSys header files
55 //------------------------------------------------------------------------------
56 
57 #include "Function_Block_Base.h"
58 
59 //------------------------------------------------------------------------------
60 // Include ConOpSys application header files
61 //------------------------------------------------------------------------------
62 
63 //------------------------------------------------------------------------------
64 //! @brief Class declaration description
65 //------------------------------------------------------------------------------
66 
68 {
69 
70  //----------------------------------------------------------------------------
71  // Public defines, methods and variables
72  //----------------------------------------------------------------------------
73 
74  public:
75 
76  //!-------------------------------------------------------------------------
77  //! @brief Class constructor method.
78  //! @note None
79  //! \par Override
80  //! Not allowed
81  //! @attention Don't call this method directly.
82  //--------------------------------------------------------------------------
83 
85 
86  //!-------------------------------------------------------------------------
87  //! @brief Class destructor method.
88  //! @note None
89  //! \par Override
90  //! Not allowed
91  //! @attention Don't call this method directly.
92  //--------------------------------------------------------------------------
93 
95 
96  //!-------------------------------------------------------------------------
97  //! @brief Function block initialisation method.
98  //! @note None
99  //! \par Override
100  //! Not allowed
101  //! @attention Don't call this method directly.
102  //--------------------------------------------------------------------------
103 
104  virtual VOID Init();
105 
106  //!-------------------------------------------------------------------------
107  //! @brief Function block execution method.
108  //! @note None
109  //! \par Override
110  //! Not allowed
111  //! @attention None
112  //--------------------------------------------------------------------------
113 
114  virtual VOID Execute();
115 
116  //--------------------------------------------------------------------------
117  // Function block parameter connectors
118  //--------------------------------------------------------------------------
119 
120  TBlock_Input_Connector object_f32_Sample_Time; //!< Function block sample parameter
121  TBlock_Input_Connector object_f32_Low_Temperature_Warning_Level; //!< Low ambient temperature warning level parameter
122  TBlock_Input_Connector object_f32_Low_Temperature_Trip_Level; //!< Low ambient temperature trip level parameter
123  TBlock_Input_Connector object_f32_Low_Temperature_Trip_Delay; //!< Low ambient temperature trip delay parameter
124  TBlock_Input_Connector object_f32_High_Temperature_Warning_Level; //!< High ambient temperature warning level parameter
125  TBlock_Input_Connector object_f32_High_Temperature_Trip_Level; //!< High ambient temperature trip level parameter
126  TBlock_Input_Connector object_f32_High_Temperature_Trip_Delay; //!< High ambient temperature trip delay parameter
127 
128  //--------------------------------------------------------------------------
129  // Function block input connectors
130  //--------------------------------------------------------------------------
131 
132  TBlock_Input_Connector object_f32_Actual_Temperature; //!< Actual ambient temperature input connector
133  TBlock_Input_Connector object_bool_Invalid_Temperature; //!< Invalid temperature flag input connector
134 
135  //--------------------------------------------------------------------------
136  // Function block output connectors
137  //--------------------------------------------------------------------------
138 
139  TBlock_Output_Connector object_bool_Low_Temperature_Warning; //!< Low ambient temperature warning output connector
140  TBlock_Output_Connector object_bool_Low_Temperature_Alarm; //!< Low ambient temperature alarm output connector
141  TBlock_Output_Connector object_bool_Low_Temperature_Trip; //!< Low ambient temperature trip output connector
142  TBlock_Output_Connector object_bool_High_Temperature_Warning; //!< High ambient temperature warning output connector
143  TBlock_Output_Connector object_bool_High_Temperature_Alarm; //!< High ambient temperature alarm output connector
144  TBlock_Output_Connector object_bool_High_Temperature_Trip; //!< High ambient temperature trip output connector
145  TBlock_Output_Connector object_bool_Temperature_Warning; //!< Ambient temperature warning output connector
146  TBlock_Output_Connector object_bool_Temperature_Alarm; //!< Ambient temperature alarm output connector
147  TBlock_Output_Connector object_bool_Temperature_Trip; //!< Ambient temperature trip output connector
148 
150 
151  //----------------------------------------------------------------------------
152  // Protected methods and variables
153  //----------------------------------------------------------------------------
154 
155  protected:
156 
157  //----------------------------------------------------------------------------
158  // private methods and variables
159  //----------------------------------------------------------------------------
160 
161  private:
162 
163  typedef union
164  {
166  struct
167  {
168  U16 bit_Invalid_Temperature:1; //<! Bit 0 : Invalid temperature
169  U16 bit_Low_Temperature_Warning:1; //<! Bit 1 : Low temperature warning
170  U16 bit_Low_Temperature_Alarm:1; //<! Bit 2 : Low temperature alarm
171  U16 bit_Low_Temperature_Trip:1; //<! Bit 3 : Low temperature trip
172  U16 bit_High_Temperature_Warning:1; //<! Bit 4 : High temperature warning
173  U16 bit_High_Temperature_Alarm:1; //<! Bit 5 : High temperature alarm
174  U16 bit_High_Temperature_Trip:1; //<! Bit 6 : High temperature trip
175  U16 :9; //!< Bits 7-15 : Not used
176  };
177  } TStatus_Word;
178 
179  U32 u32_Low_Temperature_Trip_Delay; //!< Low temperature trip delay
180  U32 u32_High_Temperature_Trip_Delay; //!< High temperature trip delay
181 
184 
185 };
186 
187 //------------------------------------------------------------------------------
188 // End of file
189 //------------------------------------------------------------------------------
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.
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
Class declaration description.
Definition: Function_Block_Environment.h:68
TBlock_Input_Connector object_f32_Low_Temperature_Trip_Delay
Low ambient temperature trip delay parameter.
Definition: Function_Block_Environment.h:123
U32 u32_Low_Temperature_Trip_Delay
Low temperature trip delay.
Definition: Function_Block_Environment.h:179
TBlock_Input_Connector object_f32_High_Temperature_Trip_Level
High ambient temperature trip level parameter.
Definition: Function_Block_Environment.h:125
TBlock_Input_Connector object_f32_Actual_Temperature
Actual ambient temperature input connector.
Definition: Function_Block_Environment.h:132
TBlock_Output_Connector object_bool_Temperature_Alarm
Ambient temperature alarm output connector.
Definition: Function_Block_Environment.h:146
U32 u32_Low_Temperature_Trip_Delay_Counter
Time delay counter.
Definition: Function_Block_Environment.h:182
TBlock_Input_Connector object_f32_Low_Temperature_Trip_Level
Low ambient temperature trip level parameter.
Definition: Function_Block_Environment.h:122
TBlock_Output_Connector object_u16_Status
Definition: Function_Block_Environment.h:149
TBlock_Output_Connector object_bool_High_Temperature_Warning
High ambient temperature warning output connector.
Definition: Function_Block_Environment.h:142
TBlock_Input_Connector object_f32_High_Temperature_Trip_Delay
High ambient temperature trip delay parameter.
Definition: Function_Block_Environment.h:126
TBlock_Output_Connector object_bool_High_Temperature_Alarm
High ambient temperature alarm output connector.
Definition: Function_Block_Environment.h:143
TBlock_Input_Connector object_bool_Invalid_Temperature
Invalid temperature flag input connector.
Definition: Function_Block_Environment.h:133
TBlock_Input_Connector object_f32_High_Temperature_Warning_Level
High ambient temperature warning level parameter.
Definition: Function_Block_Environment.h:124
virtual ~TFunction_Block_Environment()
Class destructor method.
Definition: Function_Block_Environment.cpp:151
TBlock_Output_Connector object_bool_Low_Temperature_Trip
Low ambient temperature trip output connector.
Definition: Function_Block_Environment.h:141
U32 u32_High_Temperature_Trip_Delay_Counter
Time delay counter.
Definition: Function_Block_Environment.h:183
TBlock_Input_Connector object_f32_Sample_Time
Function block sample parameter.
Definition: Function_Block_Environment.h:120
TBlock_Output_Connector object_bool_Low_Temperature_Warning
Low ambient temperature warning output connector.
Definition: Function_Block_Environment.h:139
virtual VOID Init()
Function block initialisation method.
Definition: Function_Block_Environment.cpp:159
virtual VOID Execute()
Function block execution method.
Definition: Function_Block_Environment.cpp:176
TBlock_Output_Connector object_bool_Temperature_Trip
Ambient temperature trip output connector.
Definition: Function_Block_Environment.h:147
TBlock_Input_Connector object_f32_Low_Temperature_Warning_Level
Low ambient temperature warning level parameter.
Definition: Function_Block_Environment.h:121
TBlock_Output_Connector object_bool_Temperature_Warning
Ambient temperature warning output connector.
Definition: Function_Block_Environment.h:145
TFunction_Block_Environment()
Class constructor method.
Definition: Function_Block_Environment.cpp:64
TBlock_Output_Connector object_bool_High_Temperature_Trip
High ambient temperature trip output connector.
Definition: Function_Block_Environment.h:144
TBlock_Output_Connector object_bool_Low_Temperature_Alarm
Low ambient temperature alarm output connector.
Definition: Function_Block_Environment.h:140
U32 u32_High_Temperature_Trip_Delay
High temperature trip delay
Definition: Function_Block_Environment.h:180
U16 bit_Low_Temperature_Alarm
Definition: Function_Block_Environment.h:170
U16 u16_Word
Definition: Function_Block_Environment.h:165
U16 bit_Invalid_Temperature
Definition: Function_Block_Environment.h:168
U16 bit_High_Temperature_Warning
Definition: Function_Block_Environment.h:172
U16 bit_High_Temperature_Trip
Definition: Function_Block_Environment.h:174
U16 bit_Low_Temperature_Warning
Definition: Function_Block_Environment.h:169
U16 bit_High_Temperature_Alarm
Definition: Function_Block_Environment.h:173
U16 bit_Low_Temperature_Trip
Definition: Function_Block_Environment.h:171