MATLAB XPC TARGET 4 - API GUIDE Guide de l'utilisateur Page 35

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 372
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 34
Working with Scope Objects
2-17
“Acquisition of Gap-Free Data” on page 2-17, illustrates how the scopes trigger
one another.
Acquisition of Gap-Free Data
The following code is a typical example of how you can retrieve gap-free data.
You can type this code into an m file and run that file for a downloaded target
application. This example assumes that the communication speed and number
of samples are fast enough to acquire the full data set before the next
acquisition cycle is due to start. You can also use more than two scopes to
implement a triple- or quadruple-buffering scheme instead of the
double-buffering one illustrated here.
% Assumes that model is built and loaded on target.
tg = xpctarget.xpc;
sc = tg.addscope('target', [1 2]);
addsignal(sc,[0 1]);
% [0 1] are the signals of interest; add to both
% Default value for TriggerSample is 0, need to change it.
set(sc, 'NumSamples', 500, 'TriggerSample', -1)
set(sc, 'TriggerMode', 'Scope');
sc(1).TriggerScope = 2;
sc(2).TriggerScope = 1;
start(sc);
start(tg);
Vue de la page 34
1 2 ... 30 31 32 33 34 35 36 37 38 39 40 ... 371 372

Commentaires sur ces manuels

Pas de commentaire