User`s guide
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);