Triggering in Wavesurfer

This document describes how triggering works in Wavesurfer 0.772 through 0.805 (released July 23, 2015). Triggering is similar but not identical in more recent versions. We are working on updating the documentation.

There is a configurable “trigger scheme” for acquisition, and one for stimulation. The trigger scheme determines whether triggering for that entity will be internally-generated or externally-supplied, and what the triggering parameters are in either case. For an internally-generated trigger scheme, parameters include the time between trigger edges, the number of trigger edges to be generated, and the NI counter number that actually generates the trigger signal. For an externally-supplied trigger scheme, the parameters include the PFI line the external trigger will be coming in on, and whether rising or falling edges will be used as the triggers.

When using an internally-generated trigger scheme, the internally-generated trigger signal is also output from a PFI line. But if the user doesn't need to make use of this signal externally, they can just ignore this. In particular, Wavesurfer does not need a jumper to connect a trigger output PFI line to a trigger input PFI line if one wants to use an internally-generated trigger scheme.

The trigger schemes available to the user are defined in the Wavesurfer MDF file.

A screenshot of the UI controlling the triggering options is shown here:

In the screenshot above, one can see “Internal Trigger Schemes” in the upper right, showing the internal trigger schemes available, along with their associated: NI device name, NI counter number, number of repeats to generate, interval between repeats, PFI line, and edge sign (rising or falling). Generally, the user can change the “Repeats” count (the number of times the trigger repeats) and the “Interval” (the number of seconds between trigger edges), but everything else is specified in the MDF file and cannot be changed in the UI. (But note that in some situations the repeat count and the interval are constrained by other settings—see below.)

One can also see “External Trigger Schemes” in the lower right, showing the external trigger schemes available, along with their associated NI device, PFI line, and sign (rising or falling). These are set in the MDF file, and cannot be changed in the UI.

To select the trigger scheme used for acquisition, the user selects it from the “Scheme:” drop-down menu in the Acquisition section (upper left).

The “Use ASAP triggering” checkbox, when checked, causes Wavesurfer to always wait for the completion of a trial before starting the next trial. In this mode, the “Repeats” count for the current trigger scheme is set to one, and the “Interval” is set to 0.01 s. Additionally, the trial-based stimulation scheme (see below) is forced to be the same as the trial-based acquisition scheme. ASAP triggering mode is only available when the trial-based acquisition scheme is one of the internal triggering schemes. If an external scheme is selected, the “Use ASAP triggering” checkbox is automatically unchecked. When ASAP triggering is off (called “ballistic” mode) and an internal trigger scheme is used, the Repeats count is fixed to the number of trials specified in the main Wavesurfer window, and the Interval is constrained to be greater than or equal to the trial duration plus 0.25 s. This 0.25 s pad allows Wavesurfer to perform required housekeeping between trials.

The advantage of ASAP triggering is that Wavesurfer is guaranteed to never ‘miss’ a trigger. When ASAP triggering is off, it is occasionally possible for the between-trial housekeeping operations to take longer than usual. When this happens, a trial trigger can be missed by Wavesurfer. This will cause Wavesurfer to appear to hang after it collects the last trial, because it thinks that (at least) one more trial is coming. The disadvantage of ASAP triggering is that the time between trials is generally somewhat variable. Ballistic mode, however, does allow greater flexibility when setting up advanced triggering options (see below).

By default, “Use ASAP triggering” is checked, and the stimulation scheme is identical to the acquisition scheme. By unchecking “Use ASAP triggering”, and then unchecking “Use acquisition scheme” in the Stimulation section (middle left), it is possible to set the stimulation trigger scheme to something different than that of the acquisition scheme. To select the trigger scheme used for stimulation, the user selects it from the “Scheme:” dropdown menu. For instance, the user could use an internal trigger scheme for the acquisition triggers, and an external one for the stimulation triggers.

In some situations, the number of stimulation ‘episodes’ in a trial set can be different from the number of acquisition trials. The number of acquisition trials is always specified in the Wavesurfer main window, and Wavesurfer will always run exactly this number of acquisition trials before ending the trial set, regardless of whether the acquisition trigger scheme is internal or external. In ASAP triggering mode, the stimulation subsystem is required to use the same trigger scheme as the acquisition subsystem, so the number of stimulation episodes is always equal to the number of acquisition trials, and trials are performed synchronously with episodes. In ballisitic mode, the stimulation subsystem can use a trigger scheme different than the acquisition trigger scheme. In ballistic mode, if stimulation triggering is internal, the trial set will not end until Wavesurfer has performed a number of stimulus episodes equal to the number of Repeats specified for its trigger scheme. In ballistic mode, if stimulation triggering is external, Wavesurfer will continue the trial set until you click the stop button. (But the data file for the trial set will be saved immediately after all the acquisition trials have completed.)

When external triggering is used, any acquisition triggers that arrive during an ongoing acquisition trial are ignored. Similarly for stimulation triggers and episodes.

In Wavesurfer 0.772, the trigger scheme used does not depend on whether Wavesurfer is in trial-based versus continuous acquisition mode. That is, the acquisition trigger scheme is used for both trial-based and continuous acquisition, and the stimulation trigger scheme is used for both trial-based and continuous acquisition. Because continuous acquisition is essentially a single acquisition trial that runs until the user clicks the stop button, neither the repeat count nor the interval of the trigger scheme have any effect.

updated January 7, 2016