|On this page…|
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.
This example illustrates GPIB triggering using an Agilent® 33120A function generator. The output of the function generator is displayed with an oscilloscope so that you can observe the trigger.
g = gpib('ni',0,1);
fprintf(g,'Func:Shape Sin') fprintf(g,'Volt 3') fprintf(g,'Freq 5000')
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.
fprintf(g,'BM:NCycles 25000') fprintf(g,'Trigger:Source Bus') fprintf(g,'BM:State On')
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.
fclose(g) delete(g) clear g