National-instruments AutoCode NI MATRIX Manuel d'utilisateur Page 183

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 250
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 182
Chapter 6 Vectorized Code Generation
AutoCode Reference 6-20 ni.com
Example 6-8 Generated Code (for Figure 6-5)
/***** Output Update. *****/
/* ---------------------------- Gain Block */
/* {gain.top.2} */
for (i=1; i<=5; i++) {
top[-1+i] = R_P[-1+i]*U->gain_1[-1+i];
}
/* ---------------------------- Gain Block */
/* {gain.bottom.1} */
for (i=1; i<=5; i++) {
bottom[-1+i] = R_P[4+i]*U->gain_1[4+i];
}
/* ---------------------------- Gain Block */
/* {gain.merge.12} */
merged_data[0] = top[2];
merged_data[1] = bottom[3];
merged_data[2] = top[0];
merged_data[3] = bottom[2];
merged_data[4] = top[1];
merged_data[5] = bottom[0];
/* ---------------------------- Nth Order Integrator */
/* {gain..3} */
if (INIT && XREMAP) {
for (i=1; i<=6; i++) {
X->gain_3_S1[0] = X->gain_3_S1[0] - TSAMP*X->gain_3_S1[1];
X->gain_3_S1[1] = X->gain_3_S1[1] - TSAMP*merged_data[1+i];
}
}
for (i=1; i<=6; i++) {
Y->gain_3_1[-1+i] = X->gain_3_S1[1] + TSAMP*merged_data[-1+i];
Y->gain_3_1[-1+i] = X->gain_3_S1[0] + TSAMP*Y->gain_3_1[-1+i];
Y->gain_3_1[-1+i] = R_P[15+i]*Y->gain_3_1[-1+i];
}
/***** State Update. *****/
/* ---------------------------- Nth Order Integrator */
/* {gain..3} */
for (i=1; i<=6; i++) {
XD->gain_3_S1[1] = X->gain_3_S1[1] + TSAMP*merged_data[-1+i];
XD->gain_3_S1[0] = X->gain_3_S1[0] + TSAMP*(XD->gain_3_S1[1]);}
Vue de la page 182
1 2 ... 178 179 180 181 182 183 184 185 186 187 188 ... 249 250

Commentaires sur ces manuels

Pas de commentaire