MATLAB XPC TARGET 4 - IO Guide de l'utilisateur Page 58

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 182
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 57
3 Network Communication
3-24
between two Simulink models. When one or both of the systems is running
Simulink in non real-time, care must be taken to set the sample time properly.
Our hypothetical models are called Model A and Model B. Two different sets of
data are transferred between these two models. One set from Model A to
Model B and another set in the opposite direction.
The data to transfer is in the following order:
Model A to Model B
uint8 (3x3)
int16 (1x1)
double (2x4)
Model B to Model A
single (4x1)
double (2x2)
uint32 (2x2)
int8 (5x3)
For the purposes of this example, all the models are generated using Simulink
Constant blocks that use the MATLAB random number function (rand). The
random numbers are generated by Real Time Workshop using this function at
the time of code generation. To generate the vector of
uint8 (3x3), use the
MATLAB function.
uint8(255 * rand(3,3))
since 255 is the maximum value for an unsigned 8-bit integer. The other values
are generated similarly.
With this setup, construct the send side of modelA.
Vue de la page 57
1 2 ... 53 54 55 56 57 58 59 60 61 62 63 ... 181 182

Commentaires sur ces manuels

Pas de commentaire