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.

{ssSetNumSFcnParams(S, 0);if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {return; /* Parameter mismatch will be reported by Simulink */}/* ssSetNumContStates(S, 0);ssSetNumDiscStates(S, 0); */ssSetNumInputPorts(S, 0);/* ssSetInputPortWidth(S, 0, 0); *//* ssSetInputPortDirectFeedThrough(S, 0, 1); */if (!ssSetNumOutputPorts(S,1)) return;ssSetOutputPortWidth(S, 0, 5);/* 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){unsigned short int addr;addr=0x220;aToD12.addr=0x220;aToD12.maxADCount=4095;aToD12.minADVoltage=-5.0;aToD12.maxADVoltage=5.0;aToD12.nADChannels=16;aToD12.nDAChannels=2;aToD12.base= addr;aToD12.cnt0= addr + 0;aToD12.cnt1=addr + 1;aToD12.cnt2=addr + 2;aToD12.cntCtrl=addr + 3;aToD12.da1Low=addr + 4;aToD12.da1High=addr + 5;133

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

Saved successfully!

Ooh no, something went wrong!