You create an rfsiggen object to communicate with RF signal
generators. You must specify a resource, either when you create the object or after object
creation. The Resource property is the VISA resource string for the
instrument.
You can optionally specify a driver either during or after object creation using the
Driver property. If you don't specify one it is auto-detected.
Create an RF Signal Generator Object and Set Resource and Driver
You can create the rfsiggen object and set the
Resource and Driver during object creation. If those
properties are valid, it automatically connects to the instrument.
This syntax shows how to create the RF Signal Generator object and connect using the specified resource string and driver.
rf = rfsiggen('TCPIP0::172.28.22.99::inst0::INSTR','AgRfSigGen')Create an RF Signal Generator Object without Setting Resource and Driver
You can create the rfsiggen object without setting the Resource or
Driver, and then set it after object creation.
Create the RF Signal Generator object with no arguments.
rf = rfsiggen;
Find available resources using the resources function.
ResourceList = resources(rf)
ResourceList =
3x1 cell array
{'ASRL::COM1'}
{'ASRL::COM3'}
'TCPIP0::172.28.22.99::inst0::INSTR'In this case, it finds two COM ports that could host an instrument, and the VISA resource string of an RF signal generator.
Set the RF Signal Generator resource using the Resource property,
which is the VISA resource string.
rf.Resource = 'TCPIP0::172.28.22.99::inst0::INSTR';
List the drivers using the drivers function.
drivers(rf)
ans =
Driver: AgRfSigGen_SCPI
Supported Models:
E4428C, E4438C
Driver: RsRfSigGen_SCPI
Supported Models:
SMW200A, SMBV100A, SMU200A, SMJ100A, AMU200A, SMATE200A
Driver: AgRfSigGen
Supported Models:
E4428C,E4438C,N5181A,N5182A,N5183A,N5171B,N5181B,N5172B
N5182B,N5173B,N5183B,E8241A,E8244A,E8251A,E8254A,E8247C
In this case, it finds the drivers for a Keysight™ (formerly Agilent®) SCPI-based RF signal generator, a Rohde & Shwartz SCPI-based generator, and another Keysight generator. You can see that it lists the supported models of the driver in each case.
Set the RF Signal Generator driver using the Driver
property.
rf.Driver = 'AgRfSigGen';
You can now connect to the instrument.
connect(rf);
You can download an arbitrary waveform to an RF signal generator using the
download function and assign the IQData and
SampleRate to use. The IQData is a complex vector of
doubles containing the IQ data to use.
This example shows how to download a waveform to your rfsiggen object
and assign the IQData and SampleRate to use.
Create an rfsiggen object to communicate with an RF signal
generator, using the VISA resource string and driver associated with your own
instrument.
rf = rfsiggen('TCPIP0::172.28.22.99::inst0::INSTR','AgRfSigGen')When you designate the Resource and Driver
properties during object creation, it automatically connects to the instrument.
Assign the IQData and SampleRate variables to
use in the download.
IQData = (-0.98:0.02:1) + 1i*(-0.98:0.02:1); SampleRate = 800000;
Perform the download.
download(rf, IQData, SampleRate)
You can use the start function on an RF signal generator object to
start signal output and modulation output. It takes a double value for each of the three
required arguments: CenterFrequency specified in Hz,
OutputPower specified in dB, and LoopCount, which
represents the number of times the waveform should be repeated.
This example shows how to enable signal output and modulation output for the RF signal generator, and assign the required arguments.
Create an rfsiggen object to communicate with an RF signal
generator, using the VISA resource string and driver associated with your own
instrument.
rf = rfsiggen('TCPIP0::172.28.22.99::inst0::INSTR','AgRfSigGen')When you designate the Resource and Driver
properties during object creation, it automatically connects to the instrument.
Assign the CenterFrequency, OutputPower, and
LoopCount variables to use in the signal generation.
CenterFrequency = 4000000 OutputPower = 0 LoopCount = inf
Start the signal generation.
start(rf, CenterFrequency, OutputPower, LoopCount)