Debian Codegraph @

docs/api/instruments/rohdeschwarz/fsl.rst

raw
1 ######################################
2 R&S FSL spectrum analyzer
3 ######################################
4
5 Connecting to the instrument via network
6 ----------------------------------------
7 Once connected to the network, the instrument's IP address can be found by
8 clicking the "Setup" button and navigating to "General Settings" -> "Network
9 Address".
10
11 It can then be connected like this:
12
13 .. code:: python
14
15 from pymeasure.instruments.rohdeschwarz import FSL
16 fsl = FSL("TCPIP::192.168.1.123::INSTR")
17
18 Getting and setting parameters
19 ------------------------------
20
21 Most parameters are implemented as properties, which means they can be read and
22 written (getting and setting) in a consistent and simple way. If numerical
23 values are provided, base units are used (s, Hz, dB, ...).
24 Alternatively, the values can also be provided with a unit, e.g. ``"1.5 GHz"``
25 or ``"1.5GHz"``. Return values are always numerical.
26
27 .. code:: python
28
29 # Getting the current center frequency
30 fsl.freq_center
31
32 9000000000.0
33
34 .. code:: python
35
36 # Changing it to 10 MHz by providing the numerical value
37 fsl.freq_center = 10e6
38
39 .. code:: python
40
41 # Verifying:
42 fsl.freq_center
43
44 10000000.0
45
46 .. code:: python
47
48 # Changing it to 9 GHz by providing a string and verifying the result
49 fsl.freq_center = '9GHz'
50 fsl.freq_center
51
52 9000000000.0
53
54 .. code:: python
55
56 # Setting the span to maximum
57 fsl.freq_span = '7 GHz'
58
59 Reading a trace
60 ---------------
61
62 We will read the current trace
63
64 .. code:: python
65
66 x, y = fsl.read_trace()
67
68 Markers
69 -------
70
71 Markers are implemented as their own class. You can create them like
72 this:
73
74 .. code:: python
75
76 m1 = fsl.create_marker()
77
78 Set peak exursion:
79
80 .. code:: python
81
82 m1.peak_excursion = 3
83
84 Set marker to a specific position:
85
86 .. code:: python
87
88 m1.x = 10e9
89
90 Find the next peak to the left and get the level:
91
92 .. code:: python
93
94 m1.to_next_peak('left')
95 m1.y
96
97 -34.9349060059
98
99 Delta markers
100 ~~~~~~~~~~~~~
101
102 Delta markers can be created by setting the appropriate keyword.
103
104 .. code:: python
105
106 d2 = fsl.create_marker(is_delta_marker=True)
107 d2.name
108
109 'DELT2'
110
111 Example program
112 ---------------
113
114 Here is an example of a simple script for recording the peak of a signal.
115
116 .. code:: python
117
118 m1 = fsl.create_marker() # create marker 1
119
120 # Set standard settings, set to full span
121 fsl.continuous_sweep = False
122 fsl.freq_span = '18 GHz'
123 fsl.res_bandwidth = "AUTO"
124 fsl.video_bandwidth = "AUTO"
125 fsl.sweep_time = "AUTO"
126
127 # Perform a sweep on full span, set the marker to the peak and some to that marker
128 fsl.single_sweep()
129 m1.to_peak()
130 m1.zoom('20 MHz')
131
132 # take data from the zoomed-in region
133 fsl.single_sweep()
134 x, y = fsl.read_trace()
135
136 .. autoclass:: pymeasure.instruments.rohdeschwarz.fsl.FSL
137 :members:
138 :show-inheritance: