xPC Target    

Using the Property TriggerSample to Capture Data

xPC Target scopes include the ability to have one scope trigger another, and to delay retrieving data from the second after a trigger event on the first. This feature is most useful when data acquisition for the second scope is triggered after data acquisition for the first scope is complete. In the following explanation, Scope 2 is triggered by Scope 1:

In the figures below, TP is the trigger point or sample where a trigger event occurs.

Figure 6-1: Pre-triggering (P<0)

Figure 6-2: Post-triggering (P>0)

In the simplest case, where P = 0, the first sample will be acquired. If P < 0 (pre-triggering), acquisition will start |P| samples before TP, and if P > 0 (post-triggering), acquisition will start P samples after TP. It is not possible for Scope 1 to trigger Scope 2 before the trigger event occurs:

Acquiring Gap-Free Data

When sc(1).TriggerSample = -1 and sc(2).TriggerSample = -1 you get new functionality that cannot be achieved with pre- and post-triggering. This new functionality is gap-free acquisition of data.

To do this, you would need to set up two scopes, each triggered by the other, with both scopes having TriggerSample = -1. This is represented by the following figure.

Both the scopes receive exactly the same signals, i.e. the signals you wish to retrieve.

One of the scopes needs to be software triggered in order for acquisition to start. Otherwise, each scope would be waiting for the other to finish acquiring data, and would never start. In the example, Scope 1 is software triggered to start the acquisition.

The following script is a typical example of how you can use this feature to retrieve data.

This example assumes that the communication speed and number of samples is 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 shown here.


  Using the Method Syntax with Scope Objects addsignal