📄 model20to02.h
字号:
#ifndef rtmSetSampleTimeTaskIDArray
# define rtmSetSampleTimeTaskIDArray(rtm, val) ((rtm)->Timing.sampleTimeTaskIDArray = (val))
#endif
#ifndef rtmGetSampleTimeTaskIDPtr
# define rtmGetSampleTimeTaskIDPtr(rtm) ((rtm)->Timing.sampleTimeTaskIDPtr)
#endif
#ifndef rtmSetSampleTimeTaskIDPtr
# define rtmSetSampleTimeTaskIDPtr(rtm, val) ((rtm)->Timing.sampleTimeTaskIDPtr = (val))
#endif
#ifndef rtmGetSimMode
# define rtmGetSimMode(rtm) ((rtm)->simMode)
#endif
#ifndef rtmSetSimMode
# define rtmSetSimMode(rtm, val) ((rtm)->simMode = (val))
#endif
#ifndef rtmGetSimTimeStep
# define rtmGetSimTimeStep(rtm) ((rtm)->Timing.simTimeStep)
#endif
#ifndef rtmSetSimTimeStep
# define rtmSetSimTimeStep(rtm, val) ((rtm)->Timing.simTimeStep = (val))
#endif
#ifndef rtmGetStartTime
# define rtmGetStartTime(rtm) ((rtm)->Timing.tStart)
#endif
#ifndef rtmSetStartTime
# define rtmSetStartTime(rtm, val) ((rtm)->Timing.tStart = (val))
#endif
#ifndef rtmGetStepSize
# define rtmGetStepSize(rtm) ((rtm)->Timing.stepSize)
#endif
#ifndef rtmSetStepSize
# define rtmSetStepSize(rtm, val) ((rtm)->Timing.stepSize = (val))
#endif
#ifndef rtmGetStopRequestedFlag
# define rtmGetStopRequestedFlag(rtm) ((rtm)->Timing.stopRequestedFlag)
#endif
#ifndef rtmSetStopRequestedFlag
# define rtmSetStopRequestedFlag(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val))
#endif
#ifndef rtmGetTaskCounters
# define rtmGetTaskCounters(rtm) ((rtm)->Timing.TaskCounters)
#endif
#ifndef rtmSetTaskCounters
# define rtmSetTaskCounters(rtm, val) ((rtm)->Timing.TaskCounters = (val))
#endif
#ifndef rtmGetTaskTimeArray
# define rtmGetTaskTimeArray(rtm) ((rtm)->Timing.tArray)
#endif
#ifndef rtmSetTaskTimeArray
# define rtmSetTaskTimeArray(rtm, val) ((rtm)->Timing.tArray = (val))
#endif
#ifndef rtmGetTimePtr
# define rtmGetTimePtr(rtm) ((rtm)->Timing.t)
#endif
#ifndef rtmSetTimePtr
# define rtmSetTimePtr(rtm, val) ((rtm)->Timing.t = (val))
#endif
#ifndef rtmGetTimingData
# define rtmGetTimingData(rtm) ((rtm)->Timing.timingData)
#endif
#ifndef rtmSetTimingData
# define rtmSetTimingData(rtm, val) ((rtm)->Timing.timingData = (val))
#endif
#ifndef rtmGetU
# define rtmGetU(rtm) ((rtm)->ModelData.inputs)
#endif
#ifndef rtmSetU
# define rtmSetU(rtm, val) ((rtm)->ModelData.inputs = (val))
#endif
#ifndef rtmGetVarNextHitTimesListPtr
# define rtmGetVarNextHitTimesListPtr(rtm) ((rtm)->Timing.varNextHitTimesList)
#endif
#ifndef rtmSetVarNextHitTimesListPtr
# define rtmSetVarNextHitTimesListPtr(rtm, val) ((rtm)->Timing.varNextHitTimesList = (val))
#endif
#ifndef rtmGetY
# define rtmGetY(rtm) ((rtm)->ModelData.outputs)
#endif
#ifndef rtmSetY
# define rtmSetY(rtm, val) ((rtm)->ModelData.outputs = (val))
#endif
#ifndef rtmGetZCCacheNeedsReset
# define rtmGetZCCacheNeedsReset(rtm) ((rtm)->ModelData.zCCacheNeedsReset)
#endif
#ifndef rtmSetZCCacheNeedsReset
# define rtmSetZCCacheNeedsReset(rtm, val) ((rtm)->ModelData.zCCacheNeedsReset = (val))
#endif
#ifndef rtmGet_TimeOfLastOutput
# define rtmGet_TimeOfLastOutput(rtm) ((rtm)->Timing.timeOfLastOutput)
#endif
#ifndef rtmSet_TimeOfLastOutput
# define rtmSet_TimeOfLastOutput(rtm, val) ((rtm)->Timing.timeOfLastOutput = (val))
#endif
#ifndef rtmGetdX
# define rtmGetdX(rtm) ((rtm)->ModelData.derivs)
#endif
#ifndef rtmSetdX
# define rtmSetdX(rtm, val) ((rtm)->ModelData.derivs = (val))
#endif
#ifndef rtmGetChecksumVal
# define rtmGetChecksumVal(rtm, idx) ((rtm)->Sizes.checksums[idx])
#endif
#ifndef rtmSetChecksumVal
# define rtmSetChecksumVal(rtm, idx, val) ((rtm)->Sizes.checksums[idx] = (val))
#endif
#ifndef rtmGetDWork
# define rtmGetDWork(rtm, idx) ((rtm)->Work.dwork[idx])
#endif
#ifndef rtmSetDWork
# define rtmSetDWork(rtm, idx, val) ((rtm)->Work.dwork[idx] = (val))
#endif
#ifndef rtmGetOffsetTime
# define rtmGetOffsetTime(rtm, idx) ((rtm)->Timing.offsetTimes[idx])
#endif
#ifndef rtmSetOffsetTime
# define rtmSetOffsetTime(rtm, idx, val) ((rtm)->Timing.offsetTimes[idx] = (val))
#endif
#ifndef rtmGetSFunction
# define rtmGetSFunction(rtm, idx) ((rtm)->childSfunctions[idx])
#endif
#ifndef rtmSetSFunction
# define rtmSetSFunction(rtm, idx, val) ((rtm)->childSfunctions[idx] = (val))
#endif
#ifndef rtmGetSampleTime
# define rtmGetSampleTime(rtm, idx) ((rtm)->Timing.sampleTimes[idx])
#endif
#ifndef rtmSetSampleTime
# define rtmSetSampleTime(rtm, idx, val) ((rtm)->Timing.sampleTimes[idx] = (val))
#endif
#ifndef rtmGetSampleTimeTaskID
# define rtmGetSampleTimeTaskID(rtm, idx) ((rtm)->Timing.sampleTimeTaskIDPtr[idx])
#endif
#ifndef rtmSetSampleTimeTaskID
# define rtmSetSampleTimeTaskID(rtm, idx, val) ((rtm)->Timing.sampleTimeTaskIDPtr[idx] = (val))
#endif
#ifndef rtmGetVarNextHitTime
# define rtmGetVarNextHitTime(rtm, idx) ((rtm)->Timing.varNextHitTimesList[idx])
#endif
#ifndef rtmSetVarNextHitTime
# define rtmSetVarNextHitTime(rtm, idx, val) ((rtm)->Timing.varNextHitTimesList[idx] = (val))
#endif
#ifndef rtmIsContinuousTask
# define rtmIsContinuousTask(rtm, tid) (tid) == 0
#endif
#ifndef rtmGetErrorStatus
# define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
#endif
#ifndef rtmSetErrorStatus
# define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = ((val)))
#endif
#ifndef rtmIsMajorTimeStep
# define rtmIsMajorTimeStep(rtm) ((rtm)->Timing.simTimeStep) == MAJOR_TIME_STEP
#endif
#ifndef rtmIsSampleHit
# define rtmIsSampleHit(rtm, sti, tid) (rtmIsMajorTimeStep((rtm)) && (rtm)->Timing.sampleHits[(rtm)->Timing.sampleTimeTaskIDPtr[sti]])
#endif
#ifndef rtmIsSpecialSampleHit
# define rtmIsSpecialSampleHit(rtm, sti, prom_sti, tid) ssIsSpecialSampleHit_obsolete__use_TLC_fcn_LibIsSpecialSampleHit
#endif
#ifndef rtmGetStopRequested
# define rtmGetStopRequested(rtm) (rtm)->Timing.stopRequestedFlag
#endif
#ifndef rtmSetStopRequested
# define rtmSetStopRequested(rtm, val) (rtm)->Timing.stopRequestedFlag = ((val));
#endif
#ifndef rtmGetStopRequestedPtr
# define rtmGetStopRequestedPtr(rtm) &((rtm)->Timing.stopRequestedFlag)
#endif
#ifndef rtmGetT
# define rtmGetT(rtm) rtmGetTPtr((rtm))[0]
#endif
#ifndef rtmSetT
# define rtmSetT(rtm, val) rtmSetErrorStatus((rtm), NULL) /* Not in use*/
#endif
#ifndef rtmGetTFinal
# define rtmGetTFinal(rtm) (rtm)->Timing.tFinal
#endif
#ifndef rtmSetTFinal
# define rtmSetTFinal(rtm, val) (rtm)->Timing.tFinal = ((val))
#endif
#ifndef rtmGetTPtr
# define rtmGetTPtr(rtm) (rtm)->Timing.t
#endif
#ifndef rtmSetTPtr
# define rtmSetTPtr(rtm, val) (rtm)->Timing.t = ((val))
#endif
#ifndef rtmGetTStart
# define rtmGetTStart(rtm) (rtm)->Timing.tStart
#endif
#ifndef rtmSetTStart
# define rtmSetTStart(rtm, val) (rtm)->Timing.tStart = ((val))
#endif
#ifndef rtmGetTaskTime
# define rtmGetTaskTime(rtm, sti) rtmGetTPtr((rtm))[(rtm)->Timing.sampleTimeTaskIDPtr[sti]]
#endif
#ifndef rtmSetTaskTime
# define rtmSetTaskTime(rtm, sti, val) rtmGetTPtr((rtm))[sti] = ((val))
#endif
#ifndef rtmGetTimeOfLastOutput
# define rtmGetTimeOfLastOutput(rtm) (rtm)->Timing.timeOfLastOutput
#endif
#ifdef rtmGetRTWSolverInfo
#undef rtmGetRTWSolverInfo
#endif
#define rtmGetRTWSolverInfo(rtm) &((rtm)->solverInfo)
/* Definition for use in the target main file */
#define model20to02_rtModel rtModel_model20to02
/* Block signals (auto storage) */
typedef struct _BlockIO_model20to02 {
real_T GainA; /* '<Root>/Gain A' */
real_T GainB; /* '<Root>/Gain B' */
} BlockIO_model20to02;
/* Block states (auto storage) for system: '<Root>' */
typedef struct D_Work_model20to02_tag {
struct {
void *LoggedData;
} ScopeA_PWORK; /* '<Root>/Scope A' */
struct {
void *LoggedData;
} ScopeB_PWORK; /* '<Root>/Scope B' */
} D_Work_model20to02;
/* Backward compatible GRT Identifiers */
#define rtB model20to02_B
#define BlockIO BlockIO_model20to02
#define rtXdot model20to02_Xdot
#define StateDerivatives StateDerivatives_model20to02
#define tXdis model20to02_Xdis
#define StateDisabled StateDisabled_model20to02
#define rtP model20to02_P
#define Parameters Parameters_model20to02
#define rtDWork model20to02_DWork
#define D_Work D_Work_model20to02
/* Parameters (auto storage) */
struct _Parameters_model20to02 {
real_T SineWave_Amp; /* Expression: 1
* '<Root>/Sine Wave'
*/
real_T SineWave_Bias; /* Expression: 0
* '<Root>/Sine Wave'
*/
real_T SineWave_Freq; /* Expression: 1
* '<Root>/Sine Wave'
*/
real_T SineWave_Phase; /* Expression: 0
* '<Root>/Sine Wave'
*/
real_T GainA_Gain; /* Expression: A
* '<Root>/Gain A'
*/
real_T GainB_Gain; /* Expression: B
* '<Root>/Gain B'
*/
};
/* Real-time Model Data Structure */
struct _rtModel_model20to02_Tag {
const char *path;
const char *modelName;
struct SimStruct_tag * *childSfunctions;
const char *errorStatus;
SS_SimMode simMode;
RTWLogInfo *rtwLogInfo;
RTWExtModeInfo *extModeInfo;
RTWSolverInfo solverInfo;
RTWSolverInfo *solverInfoPtr;
void *sfcnInfo;
/*
* ModelData:
* The following substructure contains information regarding
* the data used in the model.
*/
struct {
void *blockIO;
const void *constBlockIO;
real_T *defaultParam;
ZCSigState *prevZCSigState;
real_T *contStates;
real_T *discStates;
real_T *derivs;
real_T *nonsampledZCs;
void *inputs;
void *outputs;
boolean_T *contStateDisabled;
boolean_T zCCacheNeedsReset;
boolean_T derivCacheNeedsReset;
boolean_T blkStateChange;
} ModelData;
/*
* Sizes:
* The following substructure contains sizes information
* for many of the model attributes such as inputs, outputs,
* dwork, sample times, etc.
*/
struct {
uint32_T checksums[4];
uint32_T options;
int_T numContStates;
int_T numU;
int_T numY;
int_T numSampTimes;
int_T numBlocks;
int_T numBlockIO;
int_T numBlockPrms;
int_T numDwork;
int_T numSFcnPrms;
int_T numSFcns;
int_T numIports;
int_T numOports;
int_T numNonSampZCs;
int_T sysDirFeedThru;
int_T rtwGenSfcn;
} Sizes;
/*
* SpecialInfo:
* The following substructure contains special information
* related to other components that are dependent on RTW.
*/
struct {
const void *mappingInfo;
void *xpcData;
} SpecialInfo;
/*
* Timing:
* The following substructure contains information regarding
* the timing information for the model.
*/
struct {
time_T stepSize;
uint32_T clockTick0;
uint32_T clockTickH0;
time_T stepSize0;
uint32_T clockTick1;
uint32_T clockTickH1;
time_T stepSize1;
time_T tStart;
time_T tFinal;
time_T timeOfLastOutput;
void *timingData;
real_T *varNextHitTimesList;
SimTimeStep simTimeStep;
boolean_T stopRequestedFlag;
time_T *sampleTimes;
time_T *offsetTimes;
int_T *sampleTimeTaskIDPtr;
int_T *sampleHits;
int_T *perTaskSampleHits;
time_T *t;
time_T sampleTimesArray[2];
time_T offsetTimesArray[2];
int_T sampleTimeTaskIDArray[2];
int_T sampleHitArray[2];
int_T perTaskSampleHitsArray[4];
time_T tArray[2];
} Timing;
/*
* Work:
* The following substructure contains information regarding
* the work vectors in the model.
*/
struct {
struct _ssDWorkRecord *dwork;
} Work;
};
/* Block parameters (auto storage) */
extern Parameters_model20to02 model20to02_P;
/* Block signals (auto storage) */
extern BlockIO_model20to02 model20to02_B;
/* Block states (auto storage) */
extern D_Work_model20to02 model20to02_DWork;
/* Model entry point functions */
extern void model20to02_initialize(boolean_T firstTime);
extern void model20to02_output(int_T tid);
extern void model20to02_update(int_T tid);
extern void model20to02_terminate(void);
/* Real-time Model object */
extern rtModel_model20to02 *model20to02_M;
/*
* The generated code includes comments that allow you to trace directly
* back to the appropriate location in the model. The basic format
* is <system>/block_name, where system is the system number (uniquely
* assigned by Simulink) and block_name is the name of the block.
*
* Use the MATLAB hilite_system command to trace the generated code back
* to the model. For example,
*
* hilite_system('<S3>') - opens system 3
* hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
*
* Here is the system hierarchy for this model
*
* '<Root>' : model20to02
*/
#endif /* _RTW_HEADER_model20to02_h_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -