ConOpSys V2970  P004.07
ANVILEX control operating system
Grid_To_Code.h
Go to the documentation of this file.
1 //
2 // File: Grid_To_Code.h
3 //
4 // Code generated for Simulink model 'Grid_To_Code'.
5 //
6 // Model version : 1.20
7 // Simulink Coder version : 8.14 (R2018a) 06-Feb-2018
8 // C/C++ source code generated on : Mon May 24 14:54:57 2021
9 //
10 // Target selection: ert.tlc
11 // Embedded hardware selection: Custom Processor->Custom
12 // Code generation objectives:
13 // 1. Execution efficiency
14 // 2. RAM efficiency
15 // Validation result: Not run
16 //
17 #ifndef RTW_HEADER_Grid_To_Code_h_
18 #define RTW_HEADER_Grid_To_Code_h_
19 #include "math.h"
20 #ifndef Grid_To_Code_COMMON_INCLUDES_
21 # define Grid_To_Code_COMMON_INCLUDES_
22 #include "rtwtypes.h"
23 #include "rtw_continuous.h"
24 #include "rtw_solver.h"
25 #endif // Grid_To_Code_COMMON_INCLUDES_
26 
27 // Macros for accessing real-time model data structure
28 #ifndef rtmGetErrorStatus
29 # define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
30 #endif
31 
32 #ifndef rtmSetErrorStatus
33 # define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val))
34 #endif
35 
36 #ifndef rtmGetStopRequested
37 # define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag)
38 #endif
39 
40 #ifndef rtmSetStopRequested
41 # define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val))
42 #endif
43 
44 #ifndef rtmGetStopRequestedPtr
45 # define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag))
46 #endif
47 
48 #ifndef rtmGetT
49 # define rtmGetT(rtm) (rtmGetTPtr((rtm))[0])
50 #endif
51 
52 #ifndef rtmGetTPtr
53 # define rtmGetTPtr(rtm) ((rtm)->Timing.t)
54 #endif
55 
56 // Forward declaration for rtModel
57 typedef struct tag_RTM RT_MODEL;
58 
59 // Block signals and states (default storage) for system '<Root>'
60 typedef struct {
61  real_T StateSpace[3]; // '<S11>/State-Space'
62  real_T StateSpace_DSTATE[2]; // '<S11>/State-Space'
63  real_T Gain2; // '<Root>/Gain2'
64  real_T Gain1; // '<Root>/Gain1'
65  real_T Gain; // '<Root>/Gain'
66  int_T StateSpace_IWORK[11]; // '<S11>/State-Space'
67  struct {
68  void *AS;
69  void *BS;
70  void *CS;
71  void *DS;
72  void *DX_COL;
73  void *BD_COL;
74  void *TMP1;
75  void *TMP2;
76  void *XTMP;
77  void *SWITCH_STATUS;
78  void *SWITCH_STATUS_INIT;
79  void *SW_CHG;
80  void *G_STATE;
81  void *USWLAST;
82  void *XKM12;
83  void *XKP12;
84  void *XLAST;
85  void *ULAST;
86  void *IDX_SW_CHG;
87  void *Y_SWITCH;
88  void *SWITCH_TYPES;
89  void *IDX_OUT_SW;
90  void *SWITCH_TOPO_SAVED_IDX;
91  void *SWITCH_MAP;
92  } StateSpace_PWORK; // '<S11>/State-Space'
93 } DW;
94 
95 // Continuous states (default storage)
96 typedef struct {
97  real_T Integrator_CSTATE; // '<Root>/Integrator'
98 } X;
99 
100 // State derivatives (default storage)
101 typedef struct {
102  real_T Integrator_CSTATE; // '<Root>/Integrator'
103 } XDot;
104 
105 // State disabled
106 typedef struct {
107  boolean_T Integrator_CSTATE; // '<Root>/Integrator'
108 } XDis;
109 
110 #ifndef ODE1_INTG
111 #define ODE1_INTG
112 
113 // ODE1 Integration Data
114 typedef struct {
115  real_T *f[1]; // derivatives
116 } ODE1_IntgData;
117 
118 #endif
119 
120 // Constant parameters (default storage)
121 typedef struct {
122  // Expression: S.A
123  // Referenced by: '<S11>/State-Space'
124 
125  real_T StateSpace_AS_param[4];
126 
127  // Expression: S.B
128  // Referenced by: '<S11>/State-Space'
129 
130  real_T StateSpace_BS_param[6];
131 
132  // Expression: S.C
133  // Referenced by: '<S11>/State-Space'
134 
135  real_T StateSpace_CS_param[6];
136 
137  // Expression: S.D
138  // Referenced by: '<S11>/State-Space'
139 
140  real_T StateSpace_DS_param[9];
141 
142  // Expression: S.x0
143  // Referenced by: '<S11>/State-Space'
144 
145  real_T StateSpace_X0_param[2];
146 } ConstP;
147 
148 // External outputs (root outports fed by signals with default storage)
149 typedef struct {
150  real32_T R1_Voltage; // '<Root>/R1_Voltage'
151  real32_T R2_Voltage; // '<Root>/R2_Voltage'
152  real32_T R3_Voltage; // '<Root>/R3_Voltage'
153 } ExtY;
154 
155 // Real-time Model Data Structure
156 struct tag_RTM {
157  const char_T *errorStatus;
159  X *contStates;
162  real_T *derivs;
167  real_T odeF[1][1];
169 
170  //
171  // Sizes:
172  // The following substructure contains sizes information
173  // for many of the model attributes such as inputs, outputs,
174  // dwork, sample times, etc.
175 
176  struct {
180  } Sizes;
181 
182  //
183  // Timing:
184  // The following substructure contains information regarding
185  // the timing information for the model.
186 
187  struct {
193  time_T *t;
194  time_T tArray[2];
196 };
197 
198 // Constant parameters (default storage)
199 extern const ConstP rtConstP;
200 
201 // Class declaration for model Grid_To_Code
203  {
204  // public data and function members
205  public:
206  // model initialize function
207  void initialize();
208 
209  // model step function
210  void step();
211 
212  // Constructor
214 
215  // Destructor
217 
218  // Root outports get method
219  const ExtY & getExternalOutputs() const;
220 
221  // Real-Time Model get method
222  RT_MODEL * getRTM();
223 
224  // protected data and function members
225  protected:
226  // External outputs
228 
229  // private data and function members
230  private:
231  // Block signals and states
233  X rtX; // Block continuous states
234 
235  // Real-Time Model
237 
238  // Continuous states update member function
240 
241  // Derivatives member function
243 };
244 
245 //-
246 // These blocks were eliminated from the model due to optimizations:
247 //
248 // Block '<S4>/do not delete this gain' : Eliminated nontunable gain of 1
249 // Block '<S5>/do not delete this gain' : Eliminated nontunable gain of 1
250 // Block '<S6>/do not delete this gain' : Eliminated nontunable gain of 1
251 
252 
253 //-
254 // The generated code includes comments that allow you to trace directly
255 // back to the appropriate location in the model. The basic format
256 // is <system>/block_name, where system is the system number (uniquely
257 // assigned by Simulink) and block_name is the name of the block.
258 //
259 // Use the MATLAB hilite_system command to trace the generated code back
260 // to the model. For example,
261 //
262 // hilite_system('<S3>') - opens system 3
263 // hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
264 //
265 // Here is the system hierarchy for this model
266 //
267 // '<Root>' : 'Grid_To_Code'
268 // '<S1>' : 'Grid_To_Code/Controlled Voltage Source'
269 // '<S2>' : 'Grid_To_Code/Controlled Voltage Source1'
270 // '<S3>' : 'Grid_To_Code/Controlled Voltage Source2'
271 // '<S4>' : 'Grid_To_Code/L1'
272 // '<S5>' : 'Grid_To_Code/L2'
273 // '<S6>' : 'Grid_To_Code/L3'
274 // '<S7>' : 'Grid_To_Code/powergui'
275 // '<S8>' : 'Grid_To_Code/L1/Model'
276 // '<S9>' : 'Grid_To_Code/L2/Model'
277 // '<S10>' : 'Grid_To_Code/L3/Model'
278 // '<S11>' : 'Grid_To_Code/powergui/EquivalentModel1'
279 // '<S12>' : 'Grid_To_Code/powergui/EquivalentModel1/Sources'
280 // '<S13>' : 'Grid_To_Code/powergui/EquivalentModel1/Yout'
281 
282 #endif // RTW_HEADER_Grid_To_Code_h_
283 
284 //
285 // File trailer for generated code.
286 //
287 // [EOF]
288 //
SimTimeStep
Definition: rtw_continuous.h:35
unsigned int uint32_T
Definition: rtwtypes.h:54
char char_T
Definition: rtwtypes.h:71
double real_T
Definition: rtwtypes.h:64
unsigned char boolean_T
Definition: rtwtypes.h:66
float real32_T
Definition: rtwtypes.h:57
double time_T
Definition: rtwtypes.h:65
int int_T
Definition: rtwtypes.h:67
AnsiString AS
Linear data and time.
Definition: Defines.h:352
UnicodeString DS
Unicode string datatype definition.
Definition: Defines.h:355
const ConstP rtConstP
Definition: DFIG_Model_To_Code_data.cpp:43
Definition: Grid_To_Code.h:203
ExtY rtY
Definition: Grid_To_Code.h:227
void Grid_To_Code_derivatives()
Definition: Grid_To_Code.cpp:242
void initialize()
Definition: Grid_To_Code.cpp:254
void step()
Definition: Grid_To_Code.cpp:103
RT_MODEL rtM
Definition: Grid_To_Code.h:236
~GRID_MODEL_TESTModelClass()
Definition: Grid_To_Code.cpp:341
DW rtDW
Definition: Grid_To_Code.h:232
RT_MODEL * getRTM()
Definition: Grid_To_Code.cpp:355
const ExtY & getExternalOutputs() const
Definition: Grid_To_Code.cpp:349
void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si)
Definition: Grid_To_Code.cpp:81
GRID_MODEL_TESTModelClass()
Definition: Grid_To_Code.cpp:336
X rtX
Definition: Grid_To_Code.h:233
Definition: rtw_solver.h:44
Definition: DFIG_Model_To_Code.h:218
Definition: DFIG_Model_To_Code.h:62
real_T Gain
Definition: Grid_To_Code.h:65
real_T Gain1
Definition: Grid_To_Code.h:64
Definition: DFIG_Model_To_Code.h:328
real32_T R2_Voltage
Definition: Grid_To_Code.h:151
real32_T R1_Voltage
Definition: Grid_To_Code.h:150
real32_T R3_Voltage
Definition: Grid_To_Code.h:152
Definition: DFIG_Model_To_Code.h:211
Definition: DFIG_Model_To_Code.h:198
Definition: DFIG_Model_To_Code.h:193
Definition: DFIG_Model_To_Code.h:188
Definition: DFIG_Model_To_Code.h:352
SimTimeStep simTimeStep
Definition: DFIG_Model_To_Code.h:387
boolean_T derivCacheNeedsReset
Definition: DFIG_Model_To_Code.h:361
time_T tArray[2]
Definition: DFIG_Model_To_Code.h:390
const char_T * errorStatus
Definition: DFIG_Model_To_Code.h:353
boolean_T stopRequestedFlag
Definition: DFIG_Model_To_Code.h:388
uint32_T clockTick1
Definition: DFIG_Model_To_Code.h:386
real_T * periodicContStateRanges
Definition: DFIG_Model_To_Code.h:357
real_T odeF[1][1]
Definition: DFIG_Model_To_Code.h:363
int_T * periodicContStateIndices
Definition: DFIG_Model_To_Code.h:356
struct tag_RTM::@2 Sizes
boolean_T zCCacheNeedsReset
Definition: DFIG_Model_To_Code.h:360
int_T numSampTimes
Definition: DFIG_Model_To_Code.h:375
int_T numContStates
Definition: DFIG_Model_To_Code.h:373
time_T * t
Definition: DFIG_Model_To_Code.h:389
struct tag_RTM::@3 Timing
RTWSolverInfo solverInfo
Definition: DFIG_Model_To_Code.h:354
ODE1_IntgData intgData
Definition: DFIG_Model_To_Code.h:364
boolean_T CTOutputIncnstWithState
Definition: DFIG_Model_To_Code.h:362
X * contStates
Definition: DFIG_Model_To_Code.h:355
real_T * derivs
Definition: DFIG_Model_To_Code.h:358
time_T stepSize0
Definition: DFIG_Model_To_Code.h:385
uint32_T clockTick0
Definition: DFIG_Model_To_Code.h:384
boolean_T * contStateDisabled
Definition: DFIG_Model_To_Code.h:359
int_T numPeriodicContStates
Definition: DFIG_Model_To_Code.h:374