Main Content

Quick-Control Function Generator Functions

The fgen function uses the following functions, in addition to standard functions such as connect and disconnect.

FunctionDescription
selectChannel

Specifies the channel name from which the function generator produces the waveform.

Example:

 selectChannel(myFGen, '1');
drivers

Returns a list of available function generator instrument drivers.

Example:

driverlist = drivers(myFGen);

See the note following this table about using a SCPI-based driver for Keysight® function generators.

resources

Retrieves a list of available instrument resources. It returns a list of available VISA resource strings when using an IVI-C function generator.

Example:

res = resources(myFGen);
selectWaveform

Specifies which arbitrary waveform the function generator produces.

Example:

selectWaveform (myFGen, wh);

where wh is the waveform handle you are selecting.

downloadWaveform

Downloads an arbitrary waveform to the function generator. If you provide an output variable, a waveform handle is returned. It can be used in the selectWaveform and removeWaveform functions.

If you don't provide an output variable, function generator overwrites the waveform when a new waveform is downloaded and deletes it upon disconnection.

Example:

 % Download the following waveform to fgen
 w = 1:0.001:2;
 downloadWaveform (myFGen, w);
 % Download a waveform to fgen and return 
    a waveform handle
 wh = downloadWaveform (myFGen, w);
removeWaveform

Removes a previously created arbitrary waveform from the function generator's memory. If a waveform handle is provided, it removes the waveform represented by the waveform handle.

Example:

 % Remove a waveform from fgen with waveform 
     handle 10000
  removeWaveform (myFGen, 10000);
enableOutput

Enables the function generator to produce a signal that appears at the output connector. This function produces a waveform defined by the Waveform property. If the Waveform property is set to 'Arb', the function uses the latest internal waveform handle to output the waveform.

enableOutput (myFGen);
disableOutput

Disables the signal that appears at the output connector. Disables the selected channel.

disableOutput (myFGen);
reset

Sets the function generator to factory default state.

Using a SCPI-based Driver for Keysight Function Generators

If you are using a SCPI-based Keysight function generator such as the 33220A, you will see the following when you use the drivers function on an fgen object myFGen.

driverlist = drivers(myFGen);

driverlist = 

Driver: Agilent332x0_SCPI
Supported Models:
   33210A, 33220A, 33250A

The _SCPI after the instrument name indicates this is using a SCPI driver instead of the IVI® driver.

Using Properties

For a list of supported properties for use with Quick-Control Function Generator, see Quick-Control Function Generator Properties.