MATLAB XPC TARGET RELEASE NOTES Guide de l'utilisateur Page 47

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 531
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 46
Working with Scope Objects
start(tg);
% Star t things off by triggering scope 1.
scNum = 1;
sc(scNum).trigger;
% Use the two scopes as a double buffer to log the data.
while (1)
% Wa it until this scope has finished acquiring 500 samples
% or the model stops (scope i s interrupted).
while ~(strcmp(sc(scNum).Status, 'Finished') || ...
strcmp(sc(scNum).Status, 'Interrupted')), end
% St op buffering data when the model stops.
if s trcmp(tg.Status, 'stopped')
break
end
% Sa ve the data.
t( end + 1 : end + 500) = sc(scNum).Time;
data(end + 1 : end + 500, :) = sc(scNum).Data;
% Re start this scope.
start(sc(scNum));
% Sw itch to the next scope.
scNum=3-scNum;
end
% Remo ve the scopes we added.
remscope(tg,[1 2]);
% Plot the data.
plot(t,data); grid on; legend('Signal 0','Signal 1');
2-23
Vue de la page 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 530 531

Commentaires sur ces manuels

Pas de commentaire