National-instruments AutoCode NI MATRIX Uživatelský manuál Strana 194

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 250
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 193
Chapter 7 Code Optimization
© National Instruments Corporation 7-3 AutoCode Reference
Example 7-2 Code Generated with Variable Block Optimization Turned On
/* Model variable definitions */
RT_FLOAT var;
RT_FLOAT var1;
void subsys_1(U, Y)
struct _Sys_ExtIn *U;
struct _Subsys_1_out *Y;
{
static RT_INTEGER iinfo[4];
/***** Local Block Outputs. *****/
RT_FLOAT new_11_1;
RT_FLOAT new_12_1;
/******* Initialization. *******/
if (SUBSYS_PREINIT[1]) {
iinfo[0] = 0;
iinfo[1] = 1;
iinfo[2] = 1;
iinfo[3] = 1;
SUBSYS_PREINIT[1] = FALSE;
return;
}
/***** Output Update. *****/
/* ---------------------------- Read from Variable */
/* {new..11} */
new_11_1 = var;
/* ---------------------------- Read from Variable */
/* {new..1} */
/* ---------------------------- Sum of Vectors */
/* {new..12} */
new_12_1 = U->new_1 + var1;
/* ---------------------------- Write to Variable */
/* {new..3} */
var = new_12_1;
/* ---------------------------- Sum of Vectors */
/* {new..5} */
Y->new_5_1 = U->new_1 - new_11_1;
if (iinfo[1]) {
SUBSYS_INIT[1] = FALSE;
Zobrazit stránku 193
1 2 ... 189 190 191 192 193 194 195 196 197 198 199 ... 249 250

Komentáře k této Příručce

Žádné komentáře