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

  • 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 177
Chapter 6 Vectorized Code Generation
© National Instruments Corporation 6-15 AutoCode Reference
Note The examples within this section assume maximal vectorization unless otherwise
noted.
Multiple Arrays within a Block
All blocks support multiple vectors (arrays) as both outputs and inputs.
However, depending on exactly how the signals are connected and the
algorithm, loops might not be generated as expected. Generally speaking,
as long as multiple arrays are connected contiguously to the inputs of the
block, loops are possible. For example, examine the model in Figure 6-3
and the generated code in Example 6-6.
Figure 6-3. Multiple Array Mode
Example 6-6 Multiple Array Code (for Figure 6-3)
void subsys_1(U, Y)
struct _Sys_ExtIn *U;
struct _Subsys_1_out *Y;
{
static RT_INTEGER iinfo[4];
/***** Parameters. *****/
static RT_FLOAT R_P[20];
RT_INTEGER cnt;
static const RT_FLOAT _R_P[20] = {1.2, 2.3, 3.4, 4.5, 5.6,
1.2, 2.3, 3.4, 4.5, 5.6,
Vue de la page 177
1 2 ... 173 174 175 176 177 178 179 180 181 182 183 ... 249 250

Commentaires sur ces manuels

Pas de commentaire