Figure 6-1. poorly connected gain block – National Instruments AutoCode NI MATRIX User Manual

Page 169

Advertising
background image

Chapter 6

Vectorized Code Generation

AutoCode Reference

6-6

ni.com

Figure 6-1. Poorly Connected Gain Block

Example 6-3

Generated Code for Poorly Connected Gain Block (for Figure 6-1)

void subsys_1(U, Y)

struct _Subsys_1_in *U;

struct _Subsys_1_out *Y;

{

static RT_INTEGER iinfo[4];

/***** Parameters. *****/

static RT_FLOAT R_P[5];

RT_INTEGER cnt;

static const RT_FLOAT _R_P[5] = {1.2, 2.3, 3.4, 4.5, 5.6};

/***** Algorithmic Local Variables. *****/

RT_INTEGER i;

/******* Initialization. *******/

if (SUBSYS_PREINIT[1]) {

iinfo[0] = 0;

iinfo[1] = 1;

iinfo[2] = 1;

iinfo[3] = 1;

for( cnt=0;cnt<5;cnt++ ) {

R_P[cnt] = _R_P[cnt];

}

SUBSYS_PREINIT[1] = FALSE;

return;

}

/***** Output Update. *****/

Advertising