The fgen function uses the following functions,
in addition to standard functions such as connect and disconnect.
| Function | Description |
|---|---|
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™ (formerlyAgilent®) 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 |
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 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 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 state. |
Using a SCPI-based Driver for Keysight Function Generators
If you are using a SCPI-based Keysight (formerlyAgilent) 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.