User`s guide

Working with Scope Objects
5 Set the NumSamples property for both scopes to 500 and the TriggerSamp le
property for both scopes to -1. With this property setting, each scope
triggers the next scope at the end of its 500 sample acqu isition.
set(sc, 'NumSamples', 500, 'TriggerSample', -1)
6 Set the TriggerMode property for both scopes to 'Scope'.Setthe
TriggerScope property such that each scopeistriggeredbytheother.
set(sc, 'TriggerMode', 'Scope');
sc(1).TriggerScope = 2;
sc(2).TriggerScope = 1;
7 Set up storage for time, t,andsignal,data acquisition.
t=[];
data = zeros(0, 2);
8 Start both scopes a nd the model.
start(sc);
start(tg);
Note that both scopes receive exactly the same signals, 0 and 1.
9 Trigger scope 1 to start acquiring data.
scNum = 1;
sc(scNum).trigger;
Setting scNum to 1 indicates that scope 1 will acquire data first.
10 Start acquiring data using the two scopes to double buffer the data.
while (1)
% Wait until this scope has finished acqui ring 500 sample s
% or the model stops (scope is interrupted ).
while ~(strcmp(sc(scNum).Status, 'Finished') || ...
strcmp(sc(scNum).Status, 'Interrupted')), end
% Stop buffering data when the model stops .
if strcmp(tg.Status, 'stopped')
break
end
2-21