MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Guide de l'utilisateur Page 153

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 210
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 152
The C MEX S-Function SimStruct
3-109
ssGetOutputPortOffsetTime
(S,outputPortIdx)
Canbeusedinanyroutine(exceptmdlInitializeSizes)
to determine the offset time of an output port. This
should only be used if you have specified port-based
sample times.
ssGetOutputPortRealSignal
(S,outputPortIdx)
Canbeusedinanysimulationlooproutine,
mdlInitializeConditions,ormdlStart to access an
output port signal where the output port index starts at
0 and must be less than the number of output ports. This
returns a contiguous
real_T vector of length equal to the
width of the output port. For example, to write to all
output ports, you would use:
int_T i,j;
int_T nOutputPorts = ssGetNumOutputPorts(S);
for (i = 0; i < nOutputPorts; i++) {
real_T *y = ssGetOutputPortRealSignal(S,i);
int_T ny = ssGetOutputPortWidth(S,i);
for (j = 0; j < ny; j++) {
y[j] = SomeFunctionToFillInOutput();
}
}
Table 3-8: Parameter SimStruct Macros
Macros Description
ssSetNumSFcnParams
(S,nSFcnParams)
Used in mdlInitializeSizes to set the number of S-function
parameters.
ssGetSFcnParamsCount
(S)
Used in mdlInitializeSizes t o get the number of parameters
entered by in the S-function block dialog box.
Table 3-7: Input and Output Port Signal SimStruct Macros (Continued)
Macro Description
Vue de la page 152
1 2 ... 148 149 150 151 152 153 154 155 156 157 158 ... 209 210

Commentaires sur ces manuels

Pas de commentaire