| 1 |
# |
| 2 |
# This file is part of the PyMeasure package. |
| 3 |
# |
| 4 |
# Copyright (c) 2013-2024 PyMeasure Developers |
| 5 |
# |
| 6 |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 |
# of this software and associated documentation files (the "Software"), to deal |
| 8 |
# in the Software without restriction, including without limitation the rights |
| 9 |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 |
# copies of the Software, and to permit persons to whom the Software is |
| 11 |
# furnished to do so, subject to the following conditions: |
| 12 |
# |
| 13 |
# The above copyright notice and this permission notice shall be included in |
| 14 |
# all copies or substantial portions of the Software. |
| 15 |
# |
| 16 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 |
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 |
# THE SOFTWARE. |
| 23 |
# |
| 24 |
|
| 25 |
from pymeasure.instruments.validators import strict_discrete_set, \ |
| 26 |
truncated_discrete_set, truncated_range |
| 27 |
from pymeasure.instruments import Instrument, SCPIUnknownMixin |
| 28 |
|
| 29 |
|
| 30 |
class SR860(SCPIUnknownMixin, Instrument): |
| 31 |
|
| 32 |
SENSITIVITIES = [ |
| 33 |
1e-9, 2e-9, 5e-9, 10e-9, 20e-9, 50e-9, 100e-9, 200e-9, |
| 34 |
500e-9, 1e-6, 2e-6, 5e-6, 10e-6, 20e-6, 50e-6, 100e-6, |
| 35 |
200e-6, 500e-6, 1e-3, 2e-3, 5e-3, 10e-3, 20e-3, |
| 36 |
50e-3, 100e-3, 200e-3, 500e-3, 1 |
| 37 |
] |
| 38 |
TIME_CONSTANTS = [ |
| 39 |
1e-6, 3e-6, 10e-6, 30e-6, 100e-6, 300e-6, 1e-3, 3e-3, 10e-3, |
| 40 |
30e-3, 100e-3, 300e-3, 1, 3, 10, 30, 100, 300, 1e3, |
| 41 |
3e3, 10e3, 30e3 |
| 42 |
] |
| 43 |
ON_OFF_VALUES = ['0', '1'] |
| 44 |
SCREEN_LAYOUT_VALUES = ['0', '1', '2', '3', '4', '5'] |
| 45 |
EXPANSION_VALUES = ['0', '1', '2,'] |
| 46 |
CHANNEL_VALUES = ['OCH1', 'OCH2'] |
| 47 |
OUTPUT_VALUES = ['XY', 'RTH'] |
| 48 |
INPUT_TIMEBASE = ['AUTO', 'IN'] |
| 49 |
INPUT_DCMODE = ['COM', 'DIF', 'common', 'difference'] |
| 50 |
INPUT_REFERENCESOURCE = ['INT', 'EXT', 'DUAL', 'CHOP'] |
| 51 |
INPUT_REFERENCETRIGGERMODE = ['SIN', 'POS', 'NEG', 'POSTTL', 'NEGTTL'] |
| 52 |
INPUT_REFERENCEEXTERNALINPUT = ['50OHMS', '1MEG'] |
| 53 |
INPUT_SIGNAL_INPUT = ['VOLT', 'CURR', 'voltage', 'current'] |
| 54 |
INPUT_VOLTAGE_MODE = ['A', 'A-B'] |
| 55 |
INPUT_COUPLING = ['AC', 'DC'] |
| 56 |
INPUT_SHIELDS = ['Float', 'Ground'] |
| 57 |
INPUT_RANGE = ['1V', '300M', '100M', '30M', '10M'] |
| 58 |
INPUT_GAIN = ['1MEG', '100MEG'] |
| 59 |
INPUT_FILTER = ['Off', 'On'] |
| 60 |
LIST_PARAMETER = ['i=', '0=Xoutput', '1=Youtput', '2=Routput', 'Thetaoutput', '4=Aux IN1', |
| 61 |
'5=Aux IN2', '6=Aux IN3', '7=Aux IN4', '8=Xnoise', '9=Ynoise', |
| 62 |
'10=AUXOut1', '11=AuxOut2', '12=Phase', '13=Sine Out amplitude', |
| 63 |
'14=DCLevel', '15I=nt.referenceFreq', '16=Ext.referenceFreq'] |
| 64 |
LIST_HORIZONTAL_TIME_DIV = ['0=0.5s', '1=1s', '2=2s', '3=5s', '4=10s', '5=30s', '6=1min', |
| 65 |
'7=2min', '8=5min', '9=10min', '10=30min', '11=1hour', '12=2hour', |
| 66 |
'13=6hour', '14=12hour', '15=1day', '16=2days'] |
| 67 |
|
| 68 |
x = Instrument.measurement("OUTP? 0", |
| 69 |
""" Reads the X value in Volts """ |
| 70 |
) |
| 71 |
y = Instrument.measurement("OUTP? 1", |
| 72 |
""" Reads the Y value in Volts """ |
| 73 |
) |
| 74 |
magnitude = Instrument.measurement("OUTP? 2", |
| 75 |
""" Reads the magnitude in Volts. """ |
| 76 |
) |
| 77 |
theta = Instrument.measurement("OUTP? 3", |
| 78 |
""" Reads the theta value in degrees. """ |
| 79 |
) |
| 80 |
phase = Instrument.control( |
| 81 |
"PHAS?", "PHAS %0.7f", |
| 82 |
""" A floating point property that represents the lock-in phase |
| 83 |
in degrees. This property can be set. """, |
| 84 |
validator=truncated_range, |
| 85 |
values=[-360, 360] |
| 86 |
) |
| 87 |
frequency = Instrument.control( |
| 88 |
"FREQ?", "FREQ %0.6e", |
| 89 |
""" A floating point property that represents the lock-in frequency |
| 90 |
in Hz. This property can be set. """, |
| 91 |
validator=truncated_range, |
| 92 |
values=[0.001, 500000] |
| 93 |
) |
| 94 |
internalfrequency = Instrument.control( |
| 95 |
"FREQINT?", "FREQINT %0.6e", |
| 96 |
"""A floating property that represents the internal lock-in frequency in Hz |
| 97 |
This property can be set.""", |
| 98 |
validator=truncated_range, |
| 99 |
values=[0.001, 500000] |
| 100 |
) |
| 101 |
harmonic = Instrument.control( |
| 102 |
"HARM?", "Harm %d", |
| 103 |
"""An integer property that controls the harmonic that is measured. |
| 104 |
Allowed values are 1 to 99. Can be set.""", |
| 105 |
validator=strict_discrete_set, |
| 106 |
values=range(1, 99) |
| 107 |
) |
| 108 |
harmonicdual = Instrument.control( |
| 109 |
"HARMDUAL?", "HARMDUAL %d", |
| 110 |
"""An integer property that controls the harmonic in dual reference mode that is measured. |
| 111 |
Allowed values are 1 to 99. Can be set.""", |
| 112 |
validator=strict_discrete_set, |
| 113 |
values=range(1, 99) |
| 114 |
) |
| 115 |
sine_voltage = Instrument.control( |
| 116 |
"SLVL?", "SLVL %0.9e", |
| 117 |
"""A floating point property that represents the reference sine-wave |
| 118 |
voltage in Volts. This property can be set.""", |
| 119 |
validator=truncated_range, |
| 120 |
values=[1e-9, 2] |
| 121 |
) |
| 122 |
|
| 123 |
timebase = Instrument.control( |
| 124 |
"TBMODE?", "TBMODE %d", |
| 125 |
"""Sets the external 10 MHZ timebase to auto(i=0) or internal(i=1).""", |
| 126 |
validator=strict_discrete_set, |
| 127 |
values=[0, 1], |
| 128 |
map_values=True |
| 129 |
) |
| 130 |
dcmode = Instrument.control( |
| 131 |
"REFM?", "REFM %d", |
| 132 |
"""A string property that represents the sine out dc mode. |
| 133 |
This property can be set. Allowed values are:{}""".format(INPUT_DCMODE), |
| 134 |
validator=strict_discrete_set, |
| 135 |
values=INPUT_DCMODE, |
| 136 |
map_values=True |
| 137 |
) |
| 138 |
reference_source = Instrument.control( |
| 139 |
"RSRC?", "RSRC %d", |
| 140 |
"""A string property that represents the reference source. |
| 141 |
This property can be set. Allowed values are:{}""".format(INPUT_REFERENCESOURCE), |
| 142 |
validator=strict_discrete_set, |
| 143 |
values=INPUT_REFERENCESOURCE, |
| 144 |
map_values=True |
| 145 |
) |
| 146 |
reference_triggermode = Instrument.control( |
| 147 |
"RTRG?", "RTRG %d", |
| 148 |
"""A string property that represents the external reference trigger mode. |
| 149 |
This property can be set. Allowed values are:{}""".format(INPUT_REFERENCETRIGGERMODE), |
| 150 |
validator=strict_discrete_set, |
| 151 |
values=INPUT_REFERENCETRIGGERMODE, |
| 152 |
map_values=True |
| 153 |
) |
| 154 |
reference_externalinput = Instrument.control( |
| 155 |
"REFZ?", "REFZ&d", |
| 156 |
"""A string property that represents the external reference input. |
| 157 |
This property can be set. Allowed values are:{}""".format(INPUT_REFERENCEEXTERNALINPUT), |
| 158 |
validator=strict_discrete_set, |
| 159 |
values=INPUT_REFERENCEEXTERNALINPUT, |
| 160 |
map_values=True |
| 161 |
) |
| 162 |
input_signal = Instrument.control( |
| 163 |
"IVMD?", "IVMD %d", |
| 164 |
"""A string property that represents the signal input. |
| 165 |
This property can be set. Allowed values are:{}""".format(INPUT_SIGNAL_INPUT), |
| 166 |
validator=strict_discrete_set, |
| 167 |
values=INPUT_SIGNAL_INPUT, |
| 168 |
map_values=True |
| 169 |
) |
| 170 |
input_voltage_mode = Instrument.control( |
| 171 |
"ISRC?", "ISRC %d", |
| 172 |
"""A string property that represents the voltage input mode. |
| 173 |
This property can be set. Allowed values are:{}""".format(INPUT_VOLTAGE_MODE), |
| 174 |
validator=strict_discrete_set, |
| 175 |
values=INPUT_VOLTAGE_MODE, |
| 176 |
map_values=True |
| 177 |
) |
| 178 |
input_coupling = Instrument.control( |
| 179 |
"ICPL?", "ICPL %d", |
| 180 |
"""A string property that represents the input coupling. |
| 181 |
This property can be set. Allowed values are:{}""".format(INPUT_COUPLING), |
| 182 |
validator=strict_discrete_set, |
| 183 |
values=INPUT_COUPLING, |
| 184 |
map_values=True |
| 185 |
) |
| 186 |
input_shields = Instrument.control( |
| 187 |
"IGND?", "IGND %d", |
| 188 |
"""A string property that represents the input shield grounding. |
| 189 |
This property can be set. Allowed values are:{}""".format(INPUT_SHIELDS), |
| 190 |
validator=strict_discrete_set, |
| 191 |
values=INPUT_SHIELDS, |
| 192 |
map_values=True |
| 193 |
) |
| 194 |
input_range = Instrument.control( |
| 195 |
"IRNG?", "IRNG %d", |
| 196 |
"""A string property that represents the input range. |
| 197 |
This property can be set. Allowed values are:{}""".format(INPUT_RANGE), |
| 198 |
validator=strict_discrete_set, |
| 199 |
values=INPUT_RANGE, |
| 200 |
map_values=True |
| 201 |
) |
| 202 |
input_current_gain = Instrument.control( |
| 203 |
"ICUR?", "ICUR %d", |
| 204 |
"""A string property that represents the current input gain. |
| 205 |
This property can be set. Allowed values are:{}""".format(INPUT_GAIN), |
| 206 |
validator=strict_discrete_set, |
| 207 |
values=INPUT_GAIN, |
| 208 |
map_values=True |
| 209 |
) |
| 210 |
sensitvity = Instrument.control( |
| 211 |
"SCAL?", "SCAL %d", |
| 212 |
""" A floating point property that controls the sensitivity in Volts, |
| 213 |
which can take discrete values from 2 nV to 1 V. Values are truncated |
| 214 |
to the next highest level if they are not exact. """, |
| 215 |
validator=truncated_discrete_set, |
| 216 |
values=SENSITIVITIES, |
| 217 |
map_values=True |
| 218 |
) |
| 219 |
time_constant = Instrument.control( |
| 220 |
"OFLT?", "OFLT %d", |
| 221 |
""" A floating point property that controls the time constant |
| 222 |
in seconds, which can take discrete values from 10 microseconds |
| 223 |
to 30,000 seconds. Values are truncated to the next highest |
| 224 |
level if they are not exact. """, |
| 225 |
validator=truncated_discrete_set, |
| 226 |
values=TIME_CONSTANTS, |
| 227 |
map_values=True |
| 228 |
) |
| 229 |
filter_slope = Instrument.control( |
| 230 |
"OFSL?", "OFSL %d", |
| 231 |
"""A integer property that sets the filter slope to 6 dB/oct(i=0), 12 DB/oct(i=1), |
| 232 |
18 dB/oct(i=2), 24 dB/oct(i=3).""", |
| 233 |
validator=strict_discrete_set, |
| 234 |
values=range(0, 3) |
| 235 |
) |
| 236 |
filer_synchronous = Instrument.control( |
| 237 |
"SYNC?", "SYNC %d", |
| 238 |
"""A string property that represents the synchronous filter. |
| 239 |
This property can be set. Allowed values are:{}""".format(INPUT_FILTER), |
| 240 |
validator=strict_discrete_set, |
| 241 |
values=INPUT_FILTER, |
| 242 |
map_values=True |
| 243 |
) |
| 244 |
filter_advanced = Instrument.control( |
| 245 |
"ADVFILT?", "ADVFIL %d", |
| 246 |
"""A string property that represents the advanced filter. |
| 247 |
This property can be set. Allowed values are:{}""".format(INPUT_FILTER), |
| 248 |
validator=strict_discrete_set, |
| 249 |
values=INPUT_FILTER, |
| 250 |
map_values=True |
| 251 |
) |
| 252 |
frequencypreset1 = Instrument.control( |
| 253 |
"PSTF? 0", "PSTF 0, %0.6e", |
| 254 |
"""A floating point property that represents the preset frequency for the F1 preset button. |
| 255 |
This property can be set.""", |
| 256 |
validator=truncated_range, |
| 257 |
values=[0.001, 500000] |
| 258 |
) |
| 259 |
frequencypreset2 = Instrument.control( |
| 260 |
"PSTF? 1", "PSTF 1, %0.6e", |
| 261 |
"""A floating point property that represents the preset frequency for the F2 preset button. |
| 262 |
This property can be set.""", |
| 263 |
validator=truncated_range, |
| 264 |
values=[0.001, 500000] |
| 265 |
) |
| 266 |
frequencypreset3 = Instrument.control( |
| 267 |
"PSTF? 2", "PSTF2, %0.6e", |
| 268 |
"""A floating point property that represents the preset frequency for the F3 preset button. |
| 269 |
This property can be set.""", |
| 270 |
validator=truncated_range, |
| 271 |
values=[0.001, 500000] |
| 272 |
) |
| 273 |
frequencypreset4 = Instrument.control( |
| 274 |
"PSTF? 3", "PSTF3, %0.6e", |
| 275 |
"""A floating point property that represents the preset frequency for the F4 preset button. |
| 276 |
This property can be set.""", |
| 277 |
validator=truncated_range, |
| 278 |
values=[0.001, 500000] |
| 279 |
) |
| 280 |
sine_amplitudepreset1 = Instrument.control( |
| 281 |
"PSTA? 0", "PSTA0, %0.9e", |
| 282 |
"""Floating point property representing the preset sine out amplitude, for the A1 preset button. |
| 283 |
This property can be set.""", # noqa: E501 |
| 284 |
validator=truncated_range, |
| 285 |
values=[1e-9, 2] |
| 286 |
) |
| 287 |
sine_amplitudepreset2 = Instrument.control( |
| 288 |
"PSTA? 1", "PSTA1, %0.9e", |
| 289 |
"""Floating point property representing the preset sine out amplitude, for the A2 preset button. |
| 290 |
This property can be set.""", # noqa: E501 |
| 291 |
validator=truncated_range, |
| 292 |
values=[1e-9, 2] |
| 293 |
) |
| 294 |
sine_amplitudepreset3 = Instrument.control( |
| 295 |
"PSTA? 2", "PSTA2, %0.9e", |
| 296 |
"""Floating point property representing the preset sine out amplitude, for the A3 preset button. |
| 297 |
This property can be set.""", # noqa: E501 |
| 298 |
validator=truncated_range, |
| 299 |
values=[1e-9, 2] |
| 300 |
) |
| 301 |
sine_amplitudepreset4 = Instrument.control( |
| 302 |
"PSTA? 3", "PSTA 3, %0.9e", |
| 303 |
"""Floating point property representing the preset sine out amplitude, for the A3 preset button. |
| 304 |
This property can be set.""", # noqa: E501 |
| 305 |
validator=truncated_range, |
| 306 |
values=[1e-9, 2] |
| 307 |
) |
| 308 |
sine_dclevelpreset1 = Instrument.control( |
| 309 |
"PSTL? 0", "PSTL 0, %0.3e", |
| 310 |
"""A floating point property that represents the preset sine out dc level for the L1 button. |
| 311 |
This property can be set.""", |
| 312 |
validator=truncated_range, |
| 313 |
values=[-5, 5] |
| 314 |
) |
| 315 |
sine_dclevelpreset2 = Instrument.control( |
| 316 |
"PSTL? 1", "PSTL 1, %0.3e", |
| 317 |
"""A floating point property that represents the preset sine out dc level for the L2 button. |
| 318 |
This property can be set.""", |
| 319 |
validator=truncated_range, |
| 320 |
values=[-5, 5] |
| 321 |
) |
| 322 |
sine_dclevelpreset3 = Instrument.control( |
| 323 |
"PSTL? 2", "PSTL 2, %0.3e", |
| 324 |
"""A floating point property that represents the preset sine out dc level for the L3 button. |
| 325 |
This property can be set.""", |
| 326 |
validator=truncated_range, |
| 327 |
values=[-5, 5] |
| 328 |
) |
| 329 |
sine_dclevelpreset4 = Instrument.control( |
| 330 |
"PSTL? 3", "PSTL3, %0.3e", |
| 331 |
"""A floating point property that represents the preset sine out dc level for the L4 button. |
| 332 |
This property can be set.""", |
| 333 |
validator=truncated_range, |
| 334 |
values=[-5, 5] |
| 335 |
) |
| 336 |
|
| 337 |
aux_out_1 = Instrument.control( |
| 338 |
"AUXV? 0", "AUXV 0, %f", |
| 339 |
""" A floating point property that controls the output of Aux output 1 in |
| 340 |
Volts, taking values between -10.5 V and +10.5 V. |
| 341 |
This property can be set.""", |
| 342 |
validator=truncated_range, |
| 343 |
values=[-10.5, 10.5] |
| 344 |
) |
| 345 |
# For consistency with other lock-in instrument classes |
| 346 |
dac1 = aux_out_1 |
| 347 |
|
| 348 |
aux_out_2 = Instrument.control( |
| 349 |
"AUXV? 1", "AUXV 1, %f", |
| 350 |
""" A floating point property that controls the output of Aux output 2 in |
| 351 |
Volts, taking values between -10.5 V and +10.5 V. |
| 352 |
This property can be set.""", |
| 353 |
validator=truncated_range, |
| 354 |
values=[-10.5, 10.5] |
| 355 |
) |
| 356 |
# For consistency with other lock-in instrument classes |
| 357 |
dac2 = aux_out_2 |
| 358 |
|
| 359 |
aux_out_3 = Instrument.control( |
| 360 |
"AUXV? 2", "AUXV 2, %f", |
| 361 |
""" A floating point property that controls the output of Aux output 3 in |
| 362 |
Volts, taking values between -10.5 V and +10.5 V. |
| 363 |
This property can be set.""", |
| 364 |
validator=truncated_range, |
| 365 |
values=[-10.5, 10.5] |
| 366 |
) |
| 367 |
# For consistency with other lock-in instrument classes |
| 368 |
dac3 = aux_out_3 |
| 369 |
|
| 370 |
aux_out_4 = Instrument.control( |
| 371 |
"AUXV? 3", "AUXV 3, %f", |
| 372 |
""" A floating point property that controls the output of Aux output 4 in |
| 373 |
Volts, taking values between -10.5 V and +10.5 V. |
| 374 |
This property can be set.""", |
| 375 |
validator=truncated_range, |
| 376 |
values=[-10.5, 10.5] |
| 377 |
) |
| 378 |
# For consistency with other lock-in instrument classes |
| 379 |
dac4 = aux_out_4 |
| 380 |
|
| 381 |
aux_in_1 = Instrument.measurement( |
| 382 |
"OAUX? 0", |
| 383 |
""" Reads the Aux input 1 value in Volts with 1/3 mV resolution. """ |
| 384 |
) |
| 385 |
# For consistency with other lock-in instrument classes |
| 386 |
adc1 = aux_in_1 |
| 387 |
|
| 388 |
aux_in_2 = Instrument.measurement( |
| 389 |
"OAUX? 1", |
| 390 |
""" Reads the Aux input 2 value in Volts with 1/3 mV resolution. """ |
| 391 |
) |
| 392 |
# For consistency with other lock-in instrument classes |
| 393 |
adc2 = aux_in_2 |
| 394 |
|
| 395 |
aux_in_3 = Instrument.measurement( |
| 396 |
"OAUX? 2", |
| 397 |
""" Reads the Aux input 3 value in Volts with 1/3 mV resolution. """ |
| 398 |
) |
| 399 |
# For consistency with other lock-in instrument classes |
| 400 |
adc3 = aux_in_3 |
| 401 |
|
| 402 |
aux_in_4 = Instrument.measurement( |
| 403 |
"OAUX? 3", |
| 404 |
""" Reads the Aux input 4 value in Volts with 1/3 mV resolution. """ |
| 405 |
) |
| 406 |
# For consistency with other lock-in instrument classes |
| 407 |
adc4 = aux_in_4 |
| 408 |
|
| 409 |
def snap(self, val1="X", val2="Y", val3=None): |
| 410 |
"""retrieve 2 or 3 parameters at once |
| 411 |
parameters can be chosen by index, or enumeration as follows: |
| 412 |
|
| 413 |
+--------+-------------+------------------------+ |
| 414 |
| index | enumeration | parameter | |
| 415 |
+========+=============+========================+ |
| 416 |
| 0 | X | X output | |
| 417 |
+--------+-------------+------------------------+ |
| 418 |
| 1 | Y | Y output | |
| 419 |
+--------+-------------+------------------------+ |
| 420 |
| 2 | R | R output | |
| 421 |
+--------+-------------+------------------------+ |
| 422 |
| 3 | THeta | θ output | |
| 423 |
+--------+-------------+------------------------+ |
| 424 |
| 4 | IN1 | Aux In1 | |
| 425 |
+--------+-------------+------------------------+ |
| 426 |
| 5 | IN2 | Aux In2 | |
| 427 |
+--------+-------------+------------------------+ |
| 428 |
| 6 | IN3 | Aux In3 | |
| 429 |
+--------+-------------+------------------------+ |
| 430 |
| 7 | IN4 | Aux In4 | |
| 431 |
+--------+-------------+------------------------+ |
| 432 |
| 8 | XNOise | Xnoise | |
| 433 |
+--------+-------------+------------------------+ |
| 434 |
| 9 | YNOise | Ynoise | |
| 435 |
+--------+-------------+------------------------+ |
| 436 |
| 10 | OUT1 | Aux Out1 | |
| 437 |
+--------+-------------+------------------------+ |
| 438 |
| 11 | OUT2 | Aux Out2 | |
| 439 |
+--------+-------------+------------------------+ |
| 440 |
| 12 | PHAse | Reference Phase | |
| 441 |
+--------+-------------+------------------------+ |
| 442 |
| 13 | SAMp | Sine Out Amplitude | |
| 443 |
+--------+-------------+------------------------+ |
| 444 |
| 14 | LEVel | DC Level | |
| 445 |
+--------+-------------+------------------------+ |
| 446 |
| 15 | FInt | Int. Ref. Frequency | |
| 447 |
+--------+-------------+------------------------+ |
| 448 |
| 16 | FExt | Ext. Ref. Frequency | |
| 449 |
+--------+-------------+------------------------+ |
| 450 |
|
| 451 |
:param val1: parameter enumeration/index |
| 452 |
:param val2: parameter enumeration/index |
| 453 |
:param val3: parameter enumeration/index (optional) |
| 454 |
|
| 455 |
Defaults: |
| 456 |
val1 = "X" |
| 457 |
val2 = "Y" |
| 458 |
val3 = None |
| 459 |
""" |
| 460 |
if val3 is None: |
| 461 |
return self.values( |
| 462 |
command=f"SNAP? {val1}, {val2}", |
| 463 |
separator=",", |
| 464 |
cast=float, |
| 465 |
) |
| 466 |
else: |
| 467 |
return self.values( |
| 468 |
command=f"SNAP? {val1}, {val2}, {val3}", |
| 469 |
separator=",", |
| 470 |
cast=float, |
| 471 |
) |
| 472 |
|
| 473 |
gettimebase = Instrument.measurement( |
| 474 |
"TBSTAT?", |
| 475 |
"""Returns the current 10 MHz timebase source.""" |
| 476 |
) |
| 477 |
extfreqency = Instrument.measurement( |
| 478 |
"FREQEXT?", |
| 479 |
"""Returns the external frequency in Hz.""" |
| 480 |
) |
| 481 |
detectedfrequency = Instrument.measurement( |
| 482 |
"FREQDET?", |
| 483 |
"""Returns the actual detected frequency in HZ.""" |
| 484 |
) |
| 485 |
get_signal_strength_indicator = Instrument.measurement( |
| 486 |
"ILVL?", |
| 487 |
"""Returns the signal strength indicator.""" |
| 488 |
) |
| 489 |
get_noise_bandwidth = Instrument.measurement( |
| 490 |
"ENBW?", |
| 491 |
"""Returns the equivalent noise bandwidth, in hertz.""" |
| 492 |
) |
| 493 |
# Display Commands |
| 494 |
front_panel = Instrument.control( |
| 495 |
"DBLK?", "DBLK %i", |
| 496 |
"""Turns the front panel blanking on(i=0) or off(i=1).""", |
| 497 |
validator=strict_discrete_set, |
| 498 |
values=ON_OFF_VALUES, |
| 499 |
map_values=True |
| 500 |
) |
| 501 |
screen_layout = Instrument.control( |
| 502 |
"DLAY?", "DLAY %i", |
| 503 |
"""A integer property that Sets the screen layout to trend(i=0), full strip chart |
| 504 |
history(i=1), half strip chart history(i=2), full FFT(i=3), half FFT(i=4) or big |
| 505 |
numerical(i=5).""", |
| 506 |
validator=strict_discrete_set, |
| 507 |
values=SCREEN_LAYOUT_VALUES, |
| 508 |
map_values=True |
| 509 |
) |
| 510 |
|
| 511 |
def screenshot(self): |
| 512 |
"""Take screenshot on device |
| 513 |
The DCAP command saves a screenshot to a USB memory stick. |
| 514 |
This command is the same as pressing the [Screen Shot] key. |
| 515 |
A USB memory stick must be present in the front panel USB port. |
| 516 |
""" |
| 517 |
self.write("DCAP") |
| 518 |
|
| 519 |
parameter_DAT1 = Instrument.control( |
| 520 |
"CDSP? 0", "CDSP 0, %i", |
| 521 |
"""A integer property that assigns a parameter to data channel 1(green). |
| 522 |
This parameters can be set. Allowed values are:{}""".format(LIST_PARAMETER), |
| 523 |
validator=strict_discrete_set, |
| 524 |
values=range(0, 16) |
| 525 |
) |
| 526 |
parameter_DAT2 = Instrument.control( |
| 527 |
"CDSP? 1", "CDSP 1, %i", |
| 528 |
"""A integer property that assigns a parameter to data channel 2(blue). |
| 529 |
This parameters can be set. Allowed values are:{}""".format(LIST_PARAMETER), |
| 530 |
validator=strict_discrete_set, |
| 531 |
values=range(0, 16) |
| 532 |
) |
| 533 |
parameter_DAT3 = Instrument.control( |
| 534 |
"CDSP? 2", "CDSP 2, %i", |
| 535 |
"""A integer property that assigns a parameter to data channel 3(yellow). |
| 536 |
This parameters can be set. Allowed values are:{}""".format(LIST_PARAMETER), |
| 537 |
validator=strict_discrete_set, |
| 538 |
values=range(0, 16) |
| 539 |
) |
| 540 |
parameter_DAT4 = Instrument.control( |
| 541 |
"CDSP? 3", "CDSP 3, %i", |
| 542 |
"""A integer property that assigns a parameter to data channel 3(orange). |
| 543 |
This parameters can be set. Allowed values are:{}""".format(LIST_PARAMETER), |
| 544 |
validator=strict_discrete_set, |
| 545 |
values=range(0, 16) |
| 546 |
) |
| 547 |
strip_chart_dat1 = Instrument.control( |
| 548 |
"CGRF? 0", "CGRF 0, %i", |
| 549 |
"""A integer property that turns the strip chart graph of data channel 1 off(i=0) or on(i=1). |
| 550 |
""", # noqa: E501 |
| 551 |
validator=strict_discrete_set, |
| 552 |
values=ON_OFF_VALUES, |
| 553 |
map_values=True |
| 554 |
) |
| 555 |
strip_chart_dat2 = Instrument.control( |
| 556 |
"CGRF? 1", "CGRF 1, %i", |
| 557 |
"""A integer property that turns the strip chart graph of data channel 2 off(i=0) or on(i=1). |
| 558 |
""", # noqa: E501 |
| 559 |
validator=strict_discrete_set, |
| 560 |
values=ON_OFF_VALUES, |
| 561 |
map_values=True |
| 562 |
) |
| 563 |
strip_chart_dat3 = Instrument.control( |
| 564 |
"CGRF? 2", "CGRF 2, %i", |
| 565 |
"""A integer property that turns the strip chart graph of data channel 1 off(i=0) or on(i=1). |
| 566 |
""", # noqa: E501 |
| 567 |
validator=strict_discrete_set, |
| 568 |
values=ON_OFF_VALUES, |
| 569 |
map_values=True |
| 570 |
) |
| 571 |
strip_chart_dat4 = Instrument.control( |
| 572 |
"CGRF? 3", "CGRF 3, %i", |
| 573 |
"""A integer property that turns the strip chart graph of data channel 4 off(i=0) or on(i=1). |
| 574 |
""", # noqa: E501 |
| 575 |
validator=strict_discrete_set, |
| 576 |
values=ON_OFF_VALUES, |
| 577 |
map_values=True |
| 578 |
) |
| 579 |
# Strip Chart commands |
| 580 |
horizontal_time_div = Instrument.control( |
| 581 |
"GSPD?", "GSDP %i", |
| 582 |
"""A integer property for the horizontal time/div according to the following table:{} |
| 583 |
""".format(LIST_HORIZONTAL_TIME_DIV), |
| 584 |
validator=strict_discrete_set, |
| 585 |
values=range(0, 16) |
| 586 |
) |
| 587 |
|
| 588 |
def __init__(self, adapter, name="Stanford Research Systems SR860 Lock-in amplifier", |
| 589 |
**kwargs): |
| 590 |
super().__init__( |
| 591 |
adapter, |
| 592 |
name, |
| 593 |
**kwargs |
| 594 |
) |