NI MATRIXx Reference Manual

Chapter 6 Vectorized Code Generation
AutoCode Reference 6-16 ni.com
1.2, 2.3, 3.4, 4.5, 5.6,
1.0, 1.0, 1.0, 1.0, 1.0};
/***** Local Block Outputs. *****/
RT_FLOAT top[5];
RT_FLOAT bottom[5];
/***** 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<20;cnt++ ) {
R_P[cnt] = _R_P[cnt];
}
SUBSYS_PREINIT[1] = FALSE;
return;
}
/***** Output Update. *****/
/* ---------------------------- Gain Block */
/* {gain..2} */
for (i=1; i<=5; i++) {
top[-1+i] = R_P[-1+i]*U->gain_1[-1+i];
}
/* ---------------------------- Gain Block */
/* {gain..1} */
for (i=1; i<=5; i++) {
bottom[-1+i] = R_P[4+i]*U->gain_1[4+i];
}
/* ---------------------------- Gain Block */
/* {gain..99} */
for (i=1; i<=5; i++) {
Y->final[-1+i] = R_P[9+i]*top[-1+i];
}
for (i=6; i<=10; i++) {
Y->final[-1+i] = R_P[9+i]*bottom[-6+i];
}}