Download An Integrated, Modular Simulation System for Education and

Transcript
aToD12.da2Low=addr +
6;
aToD12.da2High=addr +
7;
aToD12.adLow=addr +
4;
aToD12.adHigh=addr +
5;
aToD12.diLow=addr +
6;
aToD12.diHigh=addr +
aToD12.cli=addr +
7;
8;
aToD12.gainCtrl=addr +
9;
aToD12.muxCtrl=addr + 10;
aToD12.modeCtrl=addr + 11;
aToD12.softAD=addr + 12;
aToD12.doLow=addr + 13;
aToD12.doHigh=addr + 14;
/* ADCChannel */
rThrottle.cNumber
= 0;
rThrottle.minV = 0.0;
rThrottle.maxV = 1.0;
lThrottle.cNumber
= 1;
lThrottle.minV = 0.0;
lThrottle.maxV =
1.0;
pitchPos.cNumber
= 2;
pitchPos.minV = -1.0;
pitchPos.maxV =
1.0;
rollPos.cNumber
= 7;
rollPos.minV = -1.0;
rollPos.maxV =
1.0;
rudderPos.cNumber
= 12;
rudderPos.minV = -1.0;
rudderPos.maxV =
1.0;
/* Set up for the card and the channels */
PCLabCardInit(&aToD12);
ADCChannelInit(&rThrottle, &aToD12);
ADCChannelInit(&lThrottle, &aToD12);
ADCChannelInit(&pitchPos, &aToD12);
ADCChannelInit(&rollPos, &aToD12);
ADCChannelInit(&rudderPos, &aToD12);
}
#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.
*/
static void mdlInitializeConditions(SimStruct *S)
{
}
134