Instrument Control Toolbox    

Triggers

You can execute a trigger with the trigger function. This function is equivalent to writing the GET (Group Execute Trigger) GPIB command to the instrument.

trigger instructs all the addressed Listeners to perform some instrument-specific function such as taking a measurement. Refer to your instrument documentation to learn how to use its triggering capabilities.

Example: Executing a Trigger

This example illustrates GPIB triggering using an Agilent 33120A function generator. The output of the function generator is displayed with an oscilloscope so that the trigger can be observed.

  1. Create an instrument object -- Create the GPIB object g associated with a National Instruments GPIB controller with board index 0, and an instrument with primary address 1.
  2. Connect to the instrument -- Connect g to the function generator.
  3. Write and read data -- Configure the function generator to produce a 5000 Hz sine wave, with 6 volts peak-to-peak.
  1. Configure the burst of the trigger to display the sine wave for five seconds, configure the function generator to expect the trigger from the GPIB board, and enable the burst mode.

    Trigger the instrument.

    Disable the burst mode.

    While the function generator is triggered, the sine wave is saved to the Ref A memory location of the oscilloscope. The saved waveform is shown below.

  1. Disconnect and clean up -- When you no longer need g, you should disconnect it from the instrument, and remove it from memory and from the MATLAB workspace.

  Example: Using Events and Callbacks to Read Binary Data Serial Polls