R&S FS Series spectrum analyzer
Connecting to an R&S FSL via network
Once connected to the network, the instrument’s IP address can be found by clicking the “Setup” button and navigating to “General Settings” -> “Network Address”.
It can then be connected like this:
from pymeasure.instruments.rohdeschwarz import FSL
fsl = FSL("TCPIP::192.168.1.123::INSTR")
Getting and setting parameters
Most parameters are implemented as properties, which means they can be read and
written (getting and setting) in a consistent and simple way. If numerical
values are provided, base units are used (s, Hz, dB, …).
Alternatively, the values can also be provided with a unit, e.g. "1.5 GHz"
or "1.5GHz". Return values are always numerical.
# Getting the current center frequency
fsl.freq_center
9000000000.0
# Changing it to 10 MHz by providing the numerical value
fsl.freq_center = 10e6
# Verifying:
fsl.freq_center
10000000.0
# Changing it to 9 GHz by providing a string and verifying the result
fsl.freq_center = '9GHz'
fsl.freq_center
9000000000.0
# Setting the span to maximum
fsl.freq_span = '7 GHz'
Reading a trace
We will read the current trace
x, y = fsl.read_trace()
Markers
Markers are implemented as their own class. You can create them like this:
m1 = fsl.create_marker()
Set peak exursion:
m1.peak_excursion = 3
Set marker to a specific position:
m1.x = 10e9
Find the next peak to the left and get the level:
m1.to_next_peak('left')
m1.y
-34.9349060059
Delta markers
Delta markers can be created by setting the appropriate keyword.
d2 = fsl.create_marker(is_delta_marker=True)
d2.name
'DELT2'
Example program
Here is an example of a simple script for recording the peak of a signal.
m1 = fsl.create_marker() # create marker 1
# Set standard settings, set to full span
fsl.continuous_sweep = False
fsl.freq_span = '18 GHz'
fsl.res_bandwidth = "AUTO"
fsl.video_bandwidth = "AUTO"
fsl.sweep_time = "AUTO"
# Perform a sweep on full span, set the marker to the peak and some to that marker
fsl.single_sweep()
m1.to_peak()
m1.zoom('20 MHz')
# take data from the zoomed-in region
fsl.single_sweep()
x, y = fsl.read_trace()
- class pymeasure.instruments.rohdeschwarz.fsseries.FSSeries(adapter, name='Rohde&Schwarz FS series instrument', **kwargs)
Bases:
SCPIMixin,InstrumentRepresents a Rohde&Schwarz FS Series of spectrum analyzers like FSL and FSW.
All physical values that can be set can either be as a string of a value and a unit (e.g. “1.2 GHz”) or as a float value in the base units (Hz, dBm, etc.).
- property attenuation: Any
Control attenuation in dB.
- continue_single_sweep()
Continue with single sweep with synchronization.
- property continuous_sweep_enabled: Any
Control continuous (True) or single sweep (False)
- create_marker(num=1, is_delta_marker=False)
Create a marker.
- Parameters:
num – The marker number (1-4) (default:
1)is_delta_marker – True if the marker is a delta marker, default is False. (default:
False)
- Returns:
The marker object.
- property freq_center: Any
Control center frequency in Hz.
- property freq_span: Any
Control frequency span in Hz.
- property freq_start: Any
Control start frequency in Hz.
- property freq_stop: Any
Control stop frequency in Hz.
- property res_bandwidth: Any
Control resolution bandwidth in Hz. Can be set to ‘AUTO’
- single_sweep()
Perform a single sweep with synchronization.
- property sweep_time: Any
Control sweep time in s. Can be set to ‘AUTO’.
- property trace_mode: Any
Control trace mode (Write: ‘WRIT’, Max Hold: ‘MAXH’, Min Hold: ‘MINH’, Average: ‘AVER’ or View: ‘VIEW’)
- property video_bandwidth: Any
Control video bandwidth in Hz. Can be set to ‘AUTO’
- class pymeasure.instruments.rohdeschwarz.fsseries.FSL(adapter, name='Rohde&Schwarz FSL', **kwargs)
Bases:
FSSeriesRepresents a Rohde&Schwarz FSL spectrum analyzer.
All physical values that can be set can either be as a string of a value and a unit (e.g. “1.2 GHz”) or as a float value in the base units (Hz, dBm, etc.).
- read_trace(n_trace=1)
Read trace data.
- Parameters:
n_trace – The trace number (1-6). Default is 1. (default:
1)- Returns:
2d numpy array of the trace data, [[frequency], [amplitude]].
- class pymeasure.instruments.rohdeschwarz.fsseries.FSW(adapter, name='Rohde&Schwarz FSW', **kwargs)
Bases:
FSSeriesRepresents a Rohde&Schwarz FSW spectrum analyzer.
All physical values that can be set can either be as a string of a value and a unit (e.g. “1.2 GHz”) or as a float value in the base units (Hz, dBm, etc.).
- property activate_channel
Control the name of the active channel. Note: The channel needs to be open on the device!
- Returns:
active channel name
- Return type:
string
- property active_channel
Control the name of the active channel. Note: The channel needs to be open on the device!
- Returns:
active channel name
- Return type:
string
- auto_all()
Adjust all determinable settings automatically.
- auto_freq()
Adjust center frequency automatically.
- auto_level()
Adjust reference level automatically.
- property available_channels: Any
Measure open channel names and corresponding types
- create_channel(channel_type, channel_name)
Create a new channel.
- Parameters:
channel_type – Type of channel to be created.For example “PNOISE” or “SANALYZER”
channel_name – Name of the channel to be added.
- delete_channel(channel_name)
Deletes an active channel.
- property nominal_level: Any
Control the nominal level of the instrument
- read_trace(n_trace=1)
Read trace data of the active trace.
- Parameters:
n_trace – The trace number (1-6). Default is 1. (default:
1)- Returns:
2d numpy array of the trace data, [[frequency], [amplitude]].
- rename_channel(current_name, new_name)
Rename current_name of a channel to a new_name.
- Parameters:
current_name – Channel to be renamed
new_name – New name of the channel
- select_channel(channel_name)
Select an open channel
- Parameters:
channel_name – Channel to be selected.
- property split_view: Any
Control the viewmode of the device: True for split view or False for single channel view