13.07.2015 Views

An Integrated, Modular Simulation System for Education ... - Cal Poly

An Integrated, Modular Simulation System for Education ... - Cal Poly

An Integrated, Modular Simulation System for Education ... - Cal Poly

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

typedef struct stickSTICK;/* Function: mdlInitializeSizes ===============================================* Abstract:* Setup sizes of the various vectors.*/static void mdlInitializeSizes(SimStruct *S){ssSetNumSFcnParams(S, 0);if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {return; /* Parameter mismatch will be reported by Simulink */}ssSetNumInputPorts(S, 0);/* ssSetInputPortWidth(S, 0, 0); *//* ssSetInputPortDirectFeedThrough(S, 0, 1); */if (!ssSetNumOutputPorts(S,1)) return;ssSetOutputPortWidth(S, 0, 2);/* Stick, rudder, and throttles */ssSetNumSampleTimes(S, 1);}/* Take care when specifying exception free code - see sfuntmpl.doc */ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE);/* Function: mdlInitializeSampleTimes =========================================* Abstract:* Specifiy that we inherit our sample time from the driving block.*/static void mdlInitializeSampleTimes(SimStruct *S){ssSetSampleTime(S, 0, INHERITED_SAMPLE_TIME);ssSetOffsetTime(S, 0, 0.0);}#define MDL_START /* Change to #undef to remove function */#if defined(MDL_START)/* Function: mdlStart ========================================* Abstract:* Initialize the da cards.*/static void mdlStart(SimStruct *S){}#endif /* MDL_START */#define MDL_INITIALIZE_CONDITIONS /* Change to #undef to remove function */#if defined(MDL_INITIALIZE_CONDITIONS)/* Function: mdlInitializeConditions ========================================* Abstract:* Initialize the state. Note, that if this S-function is placed* with in an enabled subsystem which is configured to reset states,* this routine will be called during the reset of the states.169

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!