Create a FOM Measurement
All Python examples in this topic create a FOM measurement with the
following attributes:
Sweep the Source (input) from 1 GHz to 2 GHz
Sweep the Receivers (output) from 2 GHz to 3 GHz
You provide an LO at 1 GHz
See Also
Python Basics
Learn more about
Frequency Offset Mode
See Other SCPI Example
Programs
The following Python example will run on any VNA model with FOM (opt
S93080A). However, these commands have no provisions for internal second
source. It uses Sens:Offset
commands.
import pyvisa
as visa
# Change this variable to the
address of your instrument
VISA_ADDRESS = 'TCPIP0::localhost::inst0::INSTR'
# Create a connection (session)
to the instrument
resourceManager = visa.ResourceManager()
session = resourceManager.open_resource(VISA_ADDRESS)
# Command to preset the instrument
and deletes the default trace, measurement, and window
session.write("SYST:FPR")
# Create and turn on window 1
session.write("DISP:WIND1:STAT
ON")
# Create a measurement with parameter
session.write("CALC1:MEAS1:DEF
'S21'")
# Displays measurement 1 in window
1 and assigns the next available trace number to the measurement
session.write("DISP:MEAS1:FEED
1")
# Set the start and stop frequencies
session.write("SENS1:FREQ:START
1e9")
session.write("SENS1:FREQ:STOP
2e9")
# Set the receivers to be 2e9
-> 3e9
# See SENS:FOM:RNUM? to find the
range number for a specific name
session.write("SENS1:FOM:RANG3:FREQ:OFFS
1e9")
# Turns frequency offset on and
enable the freq offset settings
session.write("SENS1:FOM
ON")
|
The following example can be run ONLY on a VNA with FOM (opt S93080A).
It uses the internal 2nd source for the fixed LO frequency.
import pyvisa
as visa
#
Change this variable to the address of your instrument
VISA_ADDRESS
= 'TCPIP0::localhost::inst0::INSTR'
#
Create a connection (session) to the instrument
resourceManager
= visa.ResourceManager()
session = resourceManager.open_resource(VISA_ADDRESS)
#
Command to preset the instrument and deletes the default trace,
measurement, and window
session.write("SYST:FPR")
#
Create and turn on window 1
session.write("DISP:WIND1:STAT
ON")
#
Create a measurement with parameter
session.write("CALC1:MEAS1:DEF
'S21'")
#
Displays measurement 1 in window 1 and assigns the next available
trace number to the measurement
session.write("DISP:MEAS1:FEED
1")
session.write("SENS1:FREQ:START
1e9")
session.write("SENS1:FREQ:STOP
2e9")
#
set the receivers to be 2e9 -> 3e9
session.write("SENS1:FOM:RANG3:FREQ:OFFS
1e9")
#
setup the 2nd source frequencies
session.write("SENS1:FOM:RANG4:COUP
0")
session.write("SENS1:FOM:RANG4:FREQ:START
1e9")
session.write("SENS1:FOM:RANG4:FREQ:STOP
1e9")
#
turn off coupling
session.write("SOUR1:POW:COUP
0")
#
set LO power to 10dBm
session.write("SOUR1:POW3
10")
#
turn ON port 3, our LO signal
session.write("SOUR1:POW3:MODE
ON")
session.write("SENS1:FOM:STAT
ON")
|