This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Trigger One Scope with Another Scope

When you have started two scopes that you want to keep synchronized, you can trigger one scope with another to acquire data. Set up the first scope with the trigger of your choice, and then trigger the second scope from the first.

In this setup, Scope 1 triggers Scope 2.

  1. Two scope objects are configured as a vector with the command:

    tg = slrt;
    sc = addscope(tg, 'host', [1 2]);
  2. For Scope 1, set these values:

    sc(1).ScopeId = 1
    sc(1).NumSamples = N1
    sc(1).NumPrePostSamples = P1
  3. For Scope 2, set these values:

    sc(2).ScopeId = 2
    sc(2).NumSamples = N2
    sc(2).TriggerMode = 'Scope'
    sc(2).TriggerScope = 1
    sc(2).NumPrePostSamples = P2

Because Scope 1 triggers Scope 2, the trigger point TP is the same for both scopes. However, Scopes 1 and 2 can acquire different samples.

Scope-Triggered Data Acquisition

Some representative relationships between data acquisitions by Scope 1 and Scope 2 are shown in the figures. P1 and P2 are the values of NumPrePostSamples for Scopes 1 and 2. TP is the trigger point, the sample where a trigger event occurs, for both Scopes 1 and 2. Scope 2 begins acquiring data as described.

  • P1 = 0 and P2 = 0 — Scope 1 and Scope 2 start acquiring data immediately at trigger point TP.

  • P1 < 0 and P2 > 0 — Scope 1 starts acquiring data |P1| samples before trigger point TP. Scope 2 starts acquiring data P2 samples after trigger point TP.

  • P1 > 0 and P2 < 0— Scope 1 starts acquiring data P1 samples after trigger point TP. Scope 2 starts acquiring data |P2| samples before trigger point TP.

Trigger Sample Setting

For additional flexibility in scope triggering, you can use the Scope 2 trigger sample setting.

sc(2).TriggerSample = range 0 to (N + P1 - 1)
  • sc(2).TriggerSample = 0 (default) — Scope 2 triggers when Scope 1 triggers. Trigger point TP is the same sample for both scopes.

  • sc(2).TriggerSample = ts > 0 — Scope 2 triggers ts samples after Scope 1 is triggered. Trigger point TP2 for Scope 2 is ts samples after TP1 for Scope 1.

    Setting sc(2).TriggerSample to a value ts larger than (N + P - 1) does not cause an error. It implies that Scope 2 cannot be triggered, because Scope 1 cannot acquire more than (N + P - 1) samples after TP.

  • sc(2).TriggerSample = -1 (special case) — Causes Scope 2 to start acquiring data from the sample after Scope 1 stops acquiring.