Debian Codegraph @

pymeasure/instruments/rohdeschwarz/sfm.py

raw
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 import logging
26 from pymeasure.instruments import Instrument, SCPIMixin
27 from pymeasure.instruments.validators import strict_discrete_set, strict_range
28
29 log = logging.getLogger(__name__)
30 log.addHandler(logging.NullHandler())
31
32
33 class Sound_Channel:
34 """
35 Class object for the two sound channels
36
37 refer also to chapter 3.6.6.7 of the user manual
38 """
39 modulation_degree = Instrument.control(
40 "AUD:DEGR?",
41 "AUD:DEGR %g",
42 """ A float property that controls the modulation depth for the audio signal
43 (Note: only for the use of AM in Standard L)
44
45 valid range: 0 .. 1 (100%)
46 """,
47 validator=strict_range,
48 values=[0, 1],
49 )
50
51 deviation = Instrument.control(
52 "AUD:DEV?",
53 "AUD:DEV %d",
54 """ A int property that controls deviation of the selected audio signal
55
56 valid range: 0 .. 110 kHz
57 """,
58 validator=strict_range,
59 values=[0, 1.1E5],
60 )
61
62 frequency = Instrument.control(
63 "AUD:FREQ?",
64 "AUD:FREQ %d",
65 """ A int property that controls the frequency of the internal sound generator
66
67 valid range: 300 Hz .. 15 kHz
68 """,
69 validator=strict_range,
70 values=[300, 1.5E4],
71 )
72
73 use_external_source = Instrument.control(
74 "FREQ:SOUR?",
75 "FREQ:SOUR %s",
76 """ A bool property for the audio source selection
77
78 ====== =======
79 Value Meaning
80 ====== =======
81 False Internal audio generator(s)
82 True External signal source
83 ====== =======
84
85 """,
86 validator=strict_discrete_set,
87 values={False: "INT", True: "EXT"},
88 map_values=True,
89 )
90
91 modulation_enabled = Instrument.control(
92 "AUD:FREQ:STAT?",
93 "AUD:FREQ:STAT %s",
94 """ A bool property that controls the audio modulation status
95
96 ====== =======
97 Value Meaning
98 ====== =======
99 False modulation disabled
100 True modulation enabled
101 ====== =======
102
103 """,
104 validator=strict_discrete_set,
105 values={False: 0, True: 1},
106 map_values=True,
107 )
108
109 carrier_frequency = Instrument.control(
110 "CARR:FREQ?",
111 "CARR:FREQ %g",
112 """ A float property that controls the frequency of the sound carrier
113
114 valid range: 32 .. 46 MHz
115
116 """,
117 validator=strict_range,
118 values=[38.75E6, 52.75E6],
119 )
120
121 carrier_level = Instrument.control(
122 "CARR:LEV?",
123 "CARR:LEV %g",
124 """ A float property that controls the level of the audio carrier in dB
125 relative to the vision carrier (0dB)
126
127 valid range: -34 .. -6 dB
128 """,
129 validator=strict_range,
130 values=[-34, 6],
131 )
132
133 carrier_enabled = Instrument.control(
134 "CARR:STAT?",
135 "CARR:STAT %s",
136 """ A bool property that controls if the audio carrier is switched on or off
137 """,
138 validator=strict_discrete_set,
139 values={False: 0, True: 1},
140 map_values=True,
141 )
142
143 preemphasis_time = Instrument.control(
144 "PRE:MODE?",
145 "PRE:MODE %s",
146 """ A int property that controls if the mode of the preemphasis for the audio signal
147
148 ====== =======
149 Value Meaning
150 ====== =======
151 50 50 us preemphasis
152 75 75 us preemphasis
153 ====== =======
154
155 """,
156 validator=strict_discrete_set,
157 values={50: "US50", 75: "US75"},
158 map_values=True,
159 )
160
161 preemphasis_enabled = Instrument.control(
162 "PRE:STAT?",
163 "PRE:STAT %s",
164 """ A bool property that controls if the preemphasis for the audio is switched on or off
165 """,
166 validator=strict_discrete_set,
167 values={False: 0, True: 1},
168 map_values=True,
169 )
170
171 def __init__(self, instrument, number):
172 self.instrument = instrument
173 self.number = number
174
175 def values(self, command, **kwargs):
176 """ Reads a set of values from the instrument through the adapter,
177 passing on any keyword arguments.
178 """
179 return self.instrument.values("SOUR:TEL:MOD:SOUN%d:%s" % (
180 self.number, command), **kwargs)
181
182 def ask(self, command):
183 self.instrument.ask("SOUR:TEL:MOD:SOUN:%d:%s" % (self.number, command))
184
185 def write(self, command):
186 self.instrument.write("SOUR:TEL:MOD:SOUN:%d:%s" % (self.number, command))
187
188 def read(self):
189 self.instrument.read()
190
191
192 class SFM(SCPIMixin, Instrument):
193 """ Represents the Rohde&Schwarz SFM TV test transmitter
194 interface for interacting with the instrument.
195
196 .. Note::
197 The current implementation only works with the first system in this unit.
198
199 Further source extension for system 2-6 would be required.
200
201 The intermodulation subsystem is also not yet implemented.
202
203 """
204
205 def __init__(self, adapter, name="Rohde&Schwarz SFM", **kwargs):
206 super().__init__(
207 adapter,
208 name,
209 **kwargs
210 )
211 self.sound1 = Sound_Channel(self, 1)
212 self.sound2 = Sound_Channel(self, 2)
213
214 def calibration(self, number=1, subsystem=None):
215 """
216 Function to either calibrate the whole modulator, when subsystem parameter is omitted,
217 or calibrate a subsystem of the modulator.
218
219 Valid subsystem selections: "NICam, VISion, SOUNd1, SOUNd2, CODer"
220
221 """
222 if subsystem is None:
223 self.write("CAL:MOD%d" % (number))
224 else:
225 self.write(
226 "CAL:MOD%d:%s" % (
227 number,
228 strict_discrete_set(subsystem,
229 ["NIC", "NICAM", "VIS", "VISION", "SOUN1",
230 "SOUND1", "SOUN2", "SOUND2", "COD", "CODER"])
231 )
232 )
233
234 # INST (Manual 3.6.4)
235 system_number = Instrument.control(
236 "INST:SEL?",
237 "INST:SEL:%s",
238 """A int property for the selected systems (if more than 1 available)
239
240 * Minimum 1
241 * Maximum 6
242
243 """,
244 validator=strict_discrete_set,
245 values={1: "SYS1", 2: "SYS2", 3: "SYS3", 4: "SYS4", 5: "SYS5", 6: "SYS6"},
246 map_values=True,
247 check_set_errors=True,
248 )
249
250 R75_out = Instrument.control(
251 "ROUT:CHAN:OUTP:IMP?",
252 "ROUT:CHAN:OUTP:IMP %s",
253 """ A bool property that controls the use of the 75R output (if installed)
254
255 ====== =======
256 Value Meaning
257 ====== =======
258 False 50R output active (N)
259 True 75R output active (BNC)
260 ====== =======
261
262 refer also to chapter 3.6.5 of the manual
263 """,
264 validator=strict_discrete_set,
265 values={False: "LOW", True: "HIGH"},
266 map_values=True,
267 )
268
269 ext_ref_base_unit = Instrument.control(
270 "ROUT:REF:CLOCK:BAS?",
271 "ROUT:REF:CLOCK:BAS %s",
272 """ A bool property for the external reference for the basic unit
273
274 ====== =======
275 Value Meaning
276 ====== =======
277 False Internal 10 MHz is used
278 True External 10 MHz is used
279 ====== =======
280
281 """,
282 validator=strict_discrete_set,
283 values={False: "INT", True: "EXT"},
284 map_values=True,
285 )
286
287 ext_ref_extension = Instrument.control(
288 "ROUT:REF:CLOCK:EXT?",
289 "ROUT:REF:CLOCK:EXT %s",
290 """ A bool property for the external reference for the extension frame
291
292 ====== =======
293 Value Meaning
294 ====== =======
295 False Internal 10 MHz is used
296 True External 10 MHz is used
297 ====== =======
298 """,
299 validator=strict_discrete_set,
300 values={False: "INT", True: "EXT"},
301 map_values=True,
302 )
303
304 ext_vid_connector = Instrument.control(
305 "ROUT:TEL:VID:EXT?",
306 "ROUT:TEL:VID:EXT %s",
307 """A string property controlling which connector is used as the input of the video source
308
309 Possible selections are:
310
311 ====== =======
312 Value Meaning
313 ====== =======
314 HIGH Front connector - Hi-Z
315 LOW Front connector - 75R
316 REAR1 Rear connector 1
317 REAR2 Rear connector 2
318 AUTO Automatic assignment
319 ====== =======
320 """,
321 validator=strict_discrete_set,
322 values=["HIGH", "LOW", "REAR1", "REAR2", "AUTO"],
323 )
324
325 channel_table = Instrument.control(
326 "SOUR:FREQ:CHAN:TABL ?",
327 "SOUR:FREQ:CHAN:TABL %s",
328 """A string property controlling which channel table is used
329
330 Possible selections are:
331
332 ====== =======
333 Value Meaning
334 ====== =======
335 DEF Default channel table
336 USR1 User table No. 1
337 USR2 User table No. 2
338 USR3 User table No. 3
339 USR4 User table No. 4
340 USR5 User table No. 5
341 ====== =======
342
343 refer also to chapter 3.6.6.1 of the manual
344 """,
345 validator=strict_discrete_set,
346 values=["DEF", "USR1", "USR2", "USR3", "USR4", "USR5"],
347 )
348
349 normal_channel = Instrument.control(
350 "SOUR:FREQ:CHAN:NORM ?",
351 "SOUR:FREQ:CHAN:NORM %d",
352 """A int property controlling the current selected regular/normal channel number
353 valid selections are based on the country settings.
354 """,
355 )
356
357 special_channel = Instrument.control(
358 "SOUR:FREQ:CHAN:SPEC ?",
359 "SOUR:FREQ:CHAN:SPEC %d",
360 """A int property controlling the current selected special channel number
361 valid selections are based on the country settings.
362 """,
363 )
364
365 def channel_up_relative(self):
366 """
367 Increases the output frequency to the next higher channel/special channel
368 based on the current country settings
369 """
370 Instrument.write(self, "SOUR:CHAN:REL UP")
371
372 def channel_down_relative(self):
373 """
374 Decreases the output frequency to the next low channel/special channel
375 based on the current country settings
376 """
377 Instrument.write(self, "SOUR:CHAN:REL DOWN")
378
379 channel_sweep_start = Instrument.control(
380 "SOUR:FREQ:CHAN:STAR?",
381 "SOUR:FREQ:CHAN:STAR %g",
382 """A float property controlling the start frequency for channel sweep in Hz
383
384 * Minimum 5 MHz
385 * Maximum 1 GHz
386 """,
387 validator=strict_range,
388 values=[5E6, 1E9]
389 )
390
391 channel_sweep_stop = Instrument.control(
392 "SOUR:FREQ:CHAN:STOP?",
393 "SOUR:FREQ:CHAN:STOP %g",
394 """A float property controlling the start frequency for channel sweep in Hz
395
396 * Minimum 5 MHz
397 * Maximum 1 GHz
398 """,
399 validator=strict_range,
400 values=[5E6, 1E9]
401 )
402
403 channel_sweep_step = Instrument.control(
404 "SOUR:FREQ:CHAN:STEP?",
405 "SOUR:FREQ:CHAN:STEP %g",
406 """A float property controlling the start frequency for channel sweep in Hz
407
408 * Minimum 5 MHz
409 * Maximum 1 GHz
410 """,
411 validator=strict_range,
412 values=[5E6, 1E9]
413 )
414
415 cw_frequency = Instrument.control(
416 "SOUR:FREQ:CW?",
417 "SOUR:FREQ:CW %g",
418 """A float property controlling the CW-frequency in Hz
419
420 * Minimum 5 MHz
421 * Maximum 1 GHz
422 """,
423 validator=strict_range,
424 values=[5E6, 1E9]
425 )
426
427 frequency = Instrument.control(
428 "SOUR:FREQ:FIXED?",
429 "SOUR:FREQ:FIXED %g",
430 """A float property controlling the frequency in Hz
431
432 * Minimum 5 MHz
433 * Maximum 1 GHz
434 """,
435 validator=strict_range,
436 values=[5E6, 1E9]
437 )
438
439 frequency_mode = Instrument.control(
440 "SOUR:FREQ:MODE?",
441 "SOUR:FREQ:MODE %s",
442 """A string property controlling which the unit is used in
443
444 Possible selections are:
445
446 ====== =======
447 Value Meaning
448 ====== =======
449 CW Continuous wave mode
450 FIXED fixed frequency mode
451 CHSW Channel sweep
452 RFSW Frequency sweep
453 ====== =======
454
455 .. Note::
456 selecting the sweep mode, will start the sweep imemdiately!
457
458 """,
459 validator=strict_discrete_set,
460 values=["CW", "FIXED", "CHSW", "RFSW"],
461 )
462
463 high_frequency_resolution = Instrument.control(
464 "SOUR:FREQ:RES?",
465 "SOUR:FREQ:RES %s",
466 """ A property that controls the frequency resolution,
467
468 Possible selections are:
469
470 ====== =======
471 Value Meaning
472 ====== =======
473 False Low resolution (1000Hz)
474 True High resolution (1Hz)
475 ====== =======
476
477 """,
478 validator=strict_discrete_set,
479 values={False: "LOW", True: "HIGH"},
480 map_values=True,
481 )
482
483 rf_sweep_center = Instrument.control(
484 "SOUR:FREQ:CENTER?",
485 "SOUR:FREQ:CENTER %g",
486 """A float property controlling the center frequency for sweep in Hz
487
488 * Minimum 5 MHz
489 * Maximum 1 GHz
490 """,
491 validator=strict_range,
492 values=[5E6, 1E9]
493 )
494
495 rf_sweep_start = Instrument.control(
496 "SOUR:FREQ:STAR?",
497 "SOUR:FREQ:STAR %g",
498 """A float property controlling the start frequency for sweep in Hz
499
500 * Minimum 5 MHz
501 * Maximum 1 GHz
502 """,
503 validator=strict_range,
504 values=[5E6, 1E9]
505 )
506
507 rf_sweep_stop = Instrument.control(
508 "SOUR:FREQ:STOP?",
509 "SOUR:FREQ:STOP %g",
510 """A float property controlling the stop frequency for sweep in Hz
511
512 * Minimum 5 MHz
513 * Maximum 1 GHz
514 """,
515 validator=strict_range,
516 values=[5E6, 1E9]
517 )
518
519 rf_sweep_step = Instrument.control(
520 "SOUR:FREQ:STEP?",
521 "SOUR:FREQ:STEP %g",
522 """A float property controlling the stepwidth for sweep in Hz,
523
524 * Minimum 1 kHz
525 * Maximum 1 GHz
526 """,
527 validator=strict_range,
528 values=[1E3, 1E9]
529 )
530
531 rf_sweep_span = Instrument.control(
532 "SOUR:FREQ:SPAN?",
533 "SOUR:FREQ:SPAN %g",
534 """A float property controlling the sweep span in Hz,
535
536 * Minimum 1 kHz
537 * Maximum 1 GHz
538 """,
539 validator=strict_range,
540 values=[1E3, 1E9]
541 )
542
543 level = Instrument.control(
544 "SOUR:POW:LEV?",
545 "SOUR:POW:LEV %g DBM",
546 """A float property controlling the output level in dBm,
547
548 * Minimum -99dBm
549 * Maximum 10dBm (depending on output mode)
550
551 refer also to chapter 3.6.6.2 of the manual
552 """,
553 validator=strict_range,
554 values=[-99, 10],
555 )
556
557 level_mode = Instrument.control(
558 "SOUR:POW:LEV:MODE?",
559 "SOUR:POW:LEV:MODE %s",
560 """A string property controlling the output attenuator and linearity mode
561
562 Possible selections are:
563
564 ====== ==================== =================
565 Value Meaning max. output level
566 ====== ==================== =================
567 NORM Normal mode +6 dBm
568 LOWN low noise mode +10 dBm
569 CONT continuous mode +10 dBm
570 LOWD low distortion mode +0 dBm
571 ====== ==================== =================
572
573 Contiuous mode allows up to 14 dB of level setting without use of the mechanical attenuator.
574 """,
575 validator=strict_discrete_set,
576 values=["NORM", "LOWN", "CONT", "LOWD"]
577 )
578
579 rf_out_enabled = Instrument.control(
580 "SOUR:POW:STAT?",
581 "SOUR:POW:STATE %s",
582 """ A bool property that controls the status of the RF-output
583
584 """,
585 validator=strict_discrete_set,
586 values={False: 0, True: 1},
587 map_values=True,
588 )
589
590 def coder_adjust(self):
591 """
592 Starts the automatic setting of the differential deviation
593
594 refer also to chapter 3.6.6.4 of the manual
595
596 """
597 self.write("SOUR:TEL:MOD:COD:ADJ")
598
599 coder_id_frequency = Instrument.control(
600 "SOUR:TEL:MOD:COD:IDENT:FREQ?",
601 "SOUR:TEL:MOD:COD:IDENT:FREQ %d",
602 """ A int property that controls the frequency of the identification of the coder
603
604 valid range 0 .. 200 Hz
605 """,
606 validator=strict_range,
607 values=[0, 200],
608 )
609
610 coder_modulation_degree = Instrument.control(
611 "SOUR:TEL:MOD:COD:MOD:DEGR?",
612 "SOUR:TEL:MOD:COD:MOD:DEGR %g",
613 """ A float property that controls the modulation degree of the identification of the coder
614
615 valid range: 0 .. 0.9
616 """,
617 validator=strict_range,
618 values=[0, 0.9],
619 )
620
621 coder_pilot_frequency = Instrument.control(
622 "SOUR:TEL:MOD:COD:PIL:FREQ?",
623 "SOUR:TEL:MOD:COD:PIL:FREQ %d",
624 """ A int property that controls the pilot frequency of the coder
625
626 valid range: 40 .. 60 kHz
627 """,
628 validator=strict_range,
629 values=[5E4, 6E4],
630 )
631
632 coder_pilot_deviation = Instrument.control(
633 "SOUR:TEL:MOD:COD:PIL:FREQ:DEV?",
634 "SOUR:TEL:MOD:COD:PIL:FREQ:DEV %d",
635 """ A int property that controls deviation of the pilot frequency of the coder
636
637 valid range: 1 .. 4 kHz
638 """,
639 validator=strict_range,
640 values=[1E3, 4E3],
641 )
642
643 external_modulation_power = Instrument.control(
644 "SOUR:TEL:MOD:EXT:POW?",
645 "SOUR:TEL:MOD:EXT:POW %d",
646 """ A int property that controls the setting for the external modulator output power
647
648 valid range: -7..0 dBm
649
650 refer also to chapter 3.6.6.5 of the manual
651 """,
652 validator=strict_range,
653 values=[-7, 0],
654 )
655
656 external_modulation_frequency = Instrument.control(
657 "SOUR:TEL:MOD:EXT:FREQ?",
658 "SOUR:TEL:MOD:EXT:FREQ %d",
659 """ A int property that controls the setting for the external modulator frequency
660
661 valid range: 32 .. 46 MHz
662 """,
663 validator=strict_range,
664 values=[32e6, 46e6],
665 )
666
667 nicam_mode = Instrument.control(
668 "SOUR:TEL:MOD:NIC:AUD:MODE?",
669 "SOUR:TEL:MOD:NIC:AUD:MODE %s",
670 """ A string property that controls the signal type to be sent via NICAM
671
672 Possible values are:
673
674 ====== =======
675 Value Meaning
676 ====== =======
677 MON Mono sound + NICAM data
678 STER Stereo sound
679 DUAL Dual channel sound
680 DATA NICAM data only
681 ====== =======
682
683 refer also to chapter 3.6.6.6 of the manual
684
685 """,
686 validator=strict_discrete_set,
687 values=["MON", "STER", "DUAL", "DATA"],
688 )
689
690 nicam_audio_frequency = Instrument.control(
691 "SOUR:TEL:MOD:NIC:AUD:FREQ?",
692 "SOUR:TEL:MOD:NIC:AUD:FREQ %d",
693 """ A int property that controls the frequency of the internal sound generator
694
695 valid range: 0 Hz .. 15 kHz
696 """,
697 validator=strict_range,
698 values=[0, 1.5E4],
699 )
700
701 nicam_preemphasis_enabled = Instrument.control(
702 "SOUR:TEL:MOD:NIC:AUD:PRE?",
703 "SOUR:TEL:MOD:NIC:AUD:PRE %d",
704 """ A bool property that controls the status of the J17 preemphasis
705
706 """,
707 validator=strict_discrete_set,
708 values={False: 0, True: 1},
709 map_values=True,
710 )
711
712 nicam_audio_volume = Instrument.control(
713 "SOUR:TEL:MOD:NIC:AUD:VOL?",
714 "SOUR:TEL:MOD:NIC:AUD:VOL %g",
715 """ A float property that controls the audio volume in the NICAM modulator in dB
716
717 valid range: 0..60 dB
718
719 """,
720 validator=strict_range,
721 values=[0, 60],
722 )
723
724 nicam_data = Instrument.control(
725 "SOUR:TEL:MOD:NIC:AUD:DATA?",
726 "SOUR:TEL:MOD:NIC:AUD:DATA %d",
727 """ A int property that controls the data in the NICAM modulator
728
729 valid range: 0 .. 2047
730 """,
731 validator=strict_range,
732 values=[0, 2047],
733 cast=int
734 )
735
736 nicam_additional_bits = Instrument.control(
737 "SOUR:TEL:MOD:NIC:AUD:ADD?",
738 "SOUR:TEL:MOD:NIC:AUD:ADD %d",
739 """ A int property that controls the additional data in the NICAM modulator
740
741 valid range: 0 .. 2047
742 """,
743 validator=strict_range,
744 values=[0, 2047],
745 )
746
747 nicam_control_bits = Instrument.control(
748 "SOUR:TEL:MOD:NIC:AUD:CONT?",
749 "SOUR:TEL:MOD:NIC:AUD:CONT %d",
750 """ A int property that controls the additional data in the NICAM modulator
751
752 valid range: 0 .. 3
753 """,
754 validator=strict_range,
755 values=[0, 3],
756 )
757
758 nicam_bit_error_rate = Instrument.control(
759 "SOUR:TEL:MOD:NIC:BIT?",
760 "SOUR:TEL:MOD:NIC:BIT %g",
761 """ A float property that controls the artificial bit error rate.
762
763 valid range: 1.2E-7 .. 2E-3
764 """,
765 validator=strict_range,
766 values=[1.2E-7, 2E-3],
767 )
768
769 nicam_bit_error_enabled = Instrument.control(
770 "SOUR:TEL:MOD:NIC:BIT:STAT?",
771 "SOUR:TEL:MOD:NIC:BIT:STAT %d",
772 """ A bool property that controls the status of an artificial bit error rate to be applied
773
774 """,
775 validator=strict_discrete_set,
776 values={False: 0, True: 1},
777 map_values=True,
778 )
779
780 nicam_carrier_frequency = Instrument.control(
781 "SOUR:TEL:MOD:NIC:CARR:FREQ?",
782 "SOUR:TEL:MOD:NIC:CARR:FREQ %g",
783 """ A float property that controls the frequency of the NICAM carrier
784
785 valid range: 33.05 MHz +/- 0.2 Mhz
786
787 """,
788 validator=strict_range,
789 values=[32.85E6, 33.25E6],
790 )
791
792 nicam_intercarrier_frequency = Instrument.control(
793 "SOUR:TEL:MOD:NIC:INT:FREQ?",
794 "SOUR:TEL:MOD:NIC:INT:FREQ %g",
795 """ A float property that controls the inter-carrier frequency of the NICAM carrier
796
797 valid range: 5 .. 9 MHz
798 """,
799 validator=strict_range,
800 values=[5E6, 9E6],
801 )
802
803 nicam_carrier_level = Instrument.control(
804 "SOUR:TEL:MOD:NIC:CARR:LEV?",
805 "SOUR:TEL:MOD:NIC:CARR:LEV %g",
806 """ A float property that controls the value of the NICAM carrier
807
808 valid range: -40 .. -13 dB
809 """,
810 validator=strict_range,
811 values=[-40, 13],
812 )
813
814 nicam_carrier_enabled = Instrument.control(
815 "SOUR:TEL:MOD:NIC:CARR:STAT?",
816 "SOUR:TEL:MOD:NIC:CARR:STAT %s",
817 """ A bool property that controls if the NICAM carrier is switched on or off
818 """,
819 validator=strict_discrete_set,
820 values={False: 0, True: 1},
821 map_values=True,
822 )
823
824 nicam_IQ_inverted = Instrument.control(
825 "SOUR:TEL:MOD:NIC:MODE?",
826 "SOUR:TEL:MOD:NIC:MODE %s",
827 """ A bool property that controls if the NICAM IQ signals are inverted or not
828
829 ====== =======
830 Value Meaning
831 ====== =======
832 False normal (IQ)
833 True inverted (QI)
834 ====== =======
835
836 """,
837 validator=strict_discrete_set,
838 values={False: "IQ", True: "QI"},
839 map_values=True,
840 )
841
842 nicam_source = Instrument.control(
843 "SOUR:TEL:MOD:NIC:SOUR?",
844 "SOUR:TEL:MOD:NIC:SOUR %s",
845 """ A string property that controls the signal source for NICAM
846
847 Possible values are:
848
849 ====== =======
850 Value Meaning
851 ====== =======
852 INT Internal audio generator(s)
853 EXT External audio source
854 CW Continuous wave signal
855 RAND Random data stream
856 TEST Test signal
857 ====== =======
858
859 """,
860 validator=strict_discrete_set,
861 values=["INT", "EXT", "CW", "RAND", "TEST"],
862 )
863
864 nicam_test_signal = Instrument.control(
865 "SOUR:TEL:MOD:NIC:TEST?",
866 "SOUR:TEL:MOD:NIC:TEST %s",
867 """ A int property that controls the selection of the test signal applied
868
869 ====== =======
870 Value Meaning
871 ====== =======
872 1 Test signal 1 (91 kHz square wave, I&Q 90deg apart)
873 2 Test signal 2 (45.5 kHz square wave, I&Q 90deg apart)
874 3 Test signal 3 (182 kHz sine wave, I&Q in phase)
875 ====== =======
876
877 """,
878 validator=strict_discrete_set,
879 values={1: "TST1", 2: "TST2", 3: "TST3"},
880 map_values=True,
881 )
882
883 external_modulation_source = Instrument.control(
884 "SOUR:MOD:SOUR?",
885 "SOUR:MOD:SOUR %s",
886 """ A bool property for the modulation source selection
887
888 refer also to chapter 3.6.6.8 of the manual
889 """,
890 validator=strict_discrete_set,
891 values={False: "INT", True: "EXT"},
892 map_values=True,
893 )
894
895 modulation_enabled = Instrument.control(
896 "SOUR:MOD:STAT?",
897 "SOUR:MOD:STAT %s",
898 """ A bool property that controls the modulation status
899 """,
900 validator=strict_discrete_set,
901 values={False: 0, True: 1},
902 map_values=True,
903 )
904
905 vision_carrier_enabled = Instrument.control(
906 "SOUR:TEL:MOD:VIS:CARR:STAT?",
907 "SOUR:TEL:MOD:VIS:CARR:STAT %s",
908 """ A bool property that controls the vision carrier status
909
910 refer also to chapter 3.6.6.9 of the manual
911
912 """,
913 validator=strict_discrete_set,
914 values={False: 0, True: 1},
915 map_values=True,
916 )
917
918 vision_carrier_frequency = Instrument.control(
919 "SOUR:TEL:MOD:VIS:CARR:FREQ?",
920 "SOUR:TEL:MOD:VIS:CARR:FREQ %g",
921 """ A float property that controls the frequency of the vision carrier
922
923 valid range: 32 .. 46 MHz
924 """,
925 validator=strict_range,
926 values=[32E6, 46E6],
927 )
928
929 vision_average_enabled = Instrument.control(
930 "SOUR:TEL:MOD:VIS:AVER:STAT?",
931 "SOUR:TEL:MOD:VIS:AVER:STAT %s",
932 """ A bool property that controls the average mode for the vision system
933 """,
934 validator=strict_discrete_set,
935 values={False: 0, True: 1},
936 map_values=True,
937 )
938
939 vision_balance = Instrument.control(
940 "SOUR:TEL:MOD:VIS:BAL?",
941 "SOUR:TEL:MOD:VIS:BAL %g",
942 """ A float property that controls the balance of the vision modulator
943
944 valid range: -0.5 .. 0.5
945 """,
946 validator=strict_range,
947 values=[-0.5, 0.5],
948 )
949
950 vision_clamping_average = Instrument.control(
951 "SOUR:TEL:MOD:VIS:CLAM:AVER?",
952 "SOUR:TEL:MOD:VIS:CLAM:AVER %g",
953 """ A float property that controls the operation point of the vision modulator
954
955 valid range: -0.5 .. 0.5
956 """,
957 validator=strict_range,
958 values=[-0.5, 0.5],
959 )
960
961 vision_clamping_enabled = Instrument.control(
962 "SOUR:TEL:MOD:VIS:CLAM:STAT?",
963 "SOUR:TEL:MOD:VIS:CLAM:STAT %s",
964 """ A bool property that controls the clamping behavior of the vision modulator
965
966 """,
967 validator=strict_discrete_set,
968 values={False: 0, True: 1},
969 map_values=True,
970 )
971
972 vision_clamping_mode = Instrument.control(
973 "SOUR:TEL:MOD:VIS:CLAM:TYPE?",
974 "SOUR:TEL:MOD:VIS:CLAM:TYPE %s",
975 """ A string property that controls the clamping mode of the vision modulator
976
977 Possible selections are HARD or SOFT
978 """,
979 validator=strict_discrete_set,
980 values=["HARD", "SOFT"],
981 )
982
983 vision_precorrection_enabled = Instrument.control(
984 "SOUR:TEL:MOD:VIS:PREC?",
985 "SOUR:TEL:MOD:VIS:PREC %s",
986 """ A bool property that controls the precorrection behavior of the vision modulator
987 """,
988 validator=strict_discrete_set,
989 values={False: 0, True: 1},
990 map_values=True,
991 )
992
993 vision_residual_carrier_level = Instrument.control(
994 "SOUR:TEL:MOD:VIS:RES?",
995 "SOUR:TEL:MOD:VIS:RES %g",
996 """ A float property that controls the value of the residual carrier
997
998 valid range: 0 .. 0.3 (30%)
999 """,
1000 validator=strict_range,
1001 values=[0, 0.3],
1002 )
1003
1004 vision_videosignal_enabled = Instrument.control(
1005 "SOUR:TEL:MOD:VIS:VID?",
1006 "SOUR:TEL:MOD:VIS:VID %s",
1007 """ A bool property that controls if the video signal is switched on or off
1008
1009 """,
1010 validator=strict_discrete_set,
1011 values={False: 0, True: 1},
1012 map_values=True,
1013 )
1014
1015 vision_sideband_filter_enabled = Instrument.control(
1016 "SOUR:TEL:MOD:VIS:VSBF?",
1017 "SOUR:TEL:MOD:VIS:VSBF %s",
1018 """ A bool property that controls the use of the VSBF (vestigal sideband filter)
1019 in the vision modulator
1020 """,
1021 validator=strict_discrete_set,
1022 values={False: 0, True: 1},
1023 map_values=True,
1024 )
1025
1026 lower_sideband_enabled = Instrument.control(
1027 "SOUR:TEL:SID?",
1028 "SOUR:TEL:SID %s",
1029 """ A bool property that controls the use of the lower sideband
1030
1031 refer also to chapter 3.6.6.10 of the manual
1032 """,
1033 validator=strict_discrete_set,
1034 values={False: "UPP", True: "LOW"},
1035 map_values=True,
1036 )
1037
1038 sound_mode = Instrument.control(
1039 "SOUR:TEL:SOUN?",
1040 "SOUR:TEL:SOUN %s",
1041 """ A string property that controls the type of audio signal
1042
1043 Possible values are:
1044
1045 ====== =======
1046 Value Meaning
1047 ====== =======
1048 MONO MOnoaural sound
1049 PIL pilot-carrier + mono
1050 BTSC BTSC + mono
1051 STER Stereo sound
1052 DUAL Dual channel sound
1053 NIC NICAM + Mono
1054 ====== =======
1055
1056 """,
1057 validator=strict_discrete_set,
1058 values=["MONO", "PIL", "BTSC", "STER", "DUAL", "NIC"],
1059 )
1060
1061 TV_standard = Instrument.control(
1062 "SOUR:TEL:STAN?",
1063 "SOUR:TEL:STAN %s",
1064 """ A string property that controls the type of video standard
1065
1066 Possible values are:
1067
1068 ====== ====== ======
1069 Value Lines System
1070 ====== ====== ======
1071 BG 625 PAL
1072 DK 625 SECAM
1073 I 625 PAL
1074 K1 625 SECAM
1075 L 625 SECAM
1076 M 525 NTSC
1077 N 625 NTSC
1078 ====== ====== ======
1079
1080 Please confirm with the manual about the details for these settings.
1081 """,
1082 validator=strict_discrete_set,
1083 values=["BG", "DK", "I", "K1", "L", "M", "N"],
1084 )
1085
1086 TV_country = Instrument.control(
1087 "SOUR:TEL:STAN:COUN?",
1088 "SOUR:TEL:STAN:COUN %s",
1089 """ A string property that controls the country specifics of the
1090 video/sound system to be used
1091
1092 Possible values are:
1093
1094 ====== =======
1095 Value Meaning
1096 ====== =======
1097 BG_G BG General
1098 DK_G DK General
1099 I_G I General
1100 L_G L General
1101 GERM Germany
1102 BELG Belgium
1103 NETH Netherlands
1104 FIN Finland
1105 AUST Australia
1106 BG_T BG Th
1107 DENM Denmark
1108 NORW Norway
1109 SWED Sweden
1110 GUS Russia
1111 POL1 Poland
1112 POL2 Poland
1113 HUNG Hungary
1114 CHEC Czech Republic
1115 CHINA1 China
1116 CHINA2 China
1117 GRE Great Britain
1118 SAFR South Africa
1119 FRAN France
1120 USA United States
1121 KOR Korea
1122 JAP Japan
1123 CAN Canada
1124 SAM South America
1125 ====== =======
1126
1127 Please confirm with the manual about the details for these settings.
1128 """,
1129 validator=strict_discrete_set,
1130 values=["BG_G", "DK_G", "I_G", "L_G", "GERM", "BELG", "NETH",
1131 "FIN", "AUST", "BG_T", "DENM", "NORW", "SWED", "GUS", "POL1", "POL2",
1132 "HUNG", "CHEC", "CHINA1", "CHINA2", "GRE", "SAFR", "FRAN", "USA",
1133 "KOR", "JAP", "CAN", "SAM"],
1134 )
1135
1136 output_voltage = Instrument.control(
1137 "SOUR:VOLT:LEV?",
1138 "SOUR:VOLT:LEV %g",
1139 """A float property controlling the output level in Volt,
1140
1141 Minimum 2.50891e-6, Maximum 0.707068 (depending on output mode)
1142 refer also to chapter 3.6.6.12 of the manual
1143 """,
1144 validator=strict_range,
1145 values=[2.508910e-6, 0.7070168],
1146 )
1147
1148 event_reg = Instrument.measurement(
1149 "STAT:OPER:EVEN?",
1150 """
1151 Content of the event register of the Status Operation Register
1152 refer also to chapter 3.6.7 of the manual
1153 """,
1154 cast=int,
1155 )
1156
1157 status_reg = Instrument.measurement(
1158 "STAT:OPER:COND?",
1159 """
1160 Content of the condition register of the Status Operation Register
1161 """,
1162 cast=int,
1163 )
1164
1165 operation_enable_reg = Instrument.control(
1166 "STAT:OPER:ENAB?",
1167 "STAT:OPER:ENAB %d",
1168 """
1169 Content of the enable register of the Status Operation Register
1170
1171 Valid range: 0...32767
1172 """,
1173 cast=int,
1174 validator=strict_range,
1175 values=[0, 32767]
1176 )
1177
1178 def status_preset(self):
1179 """ partly resets the SCPI status reporting structures
1180 """
1181 self.write("STAT:PRES")
1182
1183 questionable_event_reg = Instrument.measurement(
1184 "STAT:QUES:EVEN?",
1185 """
1186 Content of the event register of the Status Questionable Operation Register
1187 """,
1188 cast=int,
1189 )
1190
1191 questionanble_status_reg = Instrument.measurement(
1192 "STAT:QUES:COND?",
1193 """
1194 Content of the condition register of the Status Questionable Operation Register
1195 """,
1196 cast=int,
1197 )
1198
1199 questionable_operation_enable_reg = Instrument.control(
1200 "STAT:QUES:ENAB?",
1201 "STAT:QUES:ENAB %d",
1202 """
1203 Content of the enable register of the Status Questionable Operation Register
1204
1205 Valid range 0...32767
1206 """,
1207 cast=int,
1208 validator=strict_range,
1209 values=[0, 32767]
1210 )
1211
1212 beeper_enabled = Instrument.control(
1213 "SYST:BEEP:STATE?",
1214 "SYST:BEEP:STATE %s",
1215 """ A bool property that controls the beeper status,
1216
1217 refer also to chapter 3.6.8 of the manual
1218 """,
1219 validator=strict_discrete_set,
1220 values={False: 0, True: 1},
1221 map_values=True,
1222 )
1223
1224 status_info_shown = Instrument.control(
1225 "SYST:DISP:UPDATE:STATE?",
1226 "SYST:DISP:UPDATE:STATE %s",
1227 """ A bool property that controls if the display shows information during remote control
1228
1229 """,
1230 validator=strict_discrete_set,
1231 values={False: 0, True: 1},
1232 map_values=True,
1233 )
1234
1235 gpib_address = Instrument.control(
1236 "SYST:COMM:GPIB:ADDR?",
1237 "SYST:COMM:GPIB:ADDR %d",
1238 """ A int property that controls the GPIB address of the unit
1239
1240 valid range: 0..30
1241 """,
1242 validator=strict_range,
1243 values=[0, 30],
1244 )
1245
1246 remote_interfaces = Instrument.control(
1247 "SYST:COM:REM?",
1248 "SYST:COM:REM %s",
1249 """A string property controlling the selection of interfaces for remote control
1250
1251 Possible selections are:
1252
1253 ====== =======
1254 Value Meaning
1255 ====== =======
1256 OFF no remote control
1257 GPIB GPIB only enabled
1258 SER RS232 only enabled
1259 BOTH GPIB & RS232 enabled
1260 ====== =======
1261
1262 """,
1263 validator=strict_discrete_set,
1264 values=["OFF", "GPIB", "SER", "BOTH"]
1265 )
1266
1267 serial_baud = Instrument.control(
1268 "SYST:COMM:SER:BAUD?",
1269 "SYST:COMM:SER:BAUD %g",
1270 """ A int property that controls the serial communication speed ,
1271
1272 Possible values are: 110,300,600,1200,4800,9600,19200
1273 """,
1274 validator=strict_discrete_set,
1275 values=[110, 300, 600, 1200, 4800, 9600, 19200],
1276 )
1277
1278 serial_bits = Instrument.control(
1279 "SYST:COMM:SER:BITS?",
1280 "SYST:COMM:SER:BITS %g",
1281 """ A int property that controls the number of bits used in serial communication
1282
1283 Possible values are: 7 or 8
1284 """,
1285 validator=strict_discrete_set,
1286 values=[7, 8],
1287 )
1288
1289 serial_flowcontrol = Instrument.control(
1290 "SYST:COMM:SER:PACE?",
1291 "SYST:COMM:SER:PACE %s",
1292 """ A string property that controls the serial handshake type used in serial communication
1293
1294 Possible values are:
1295
1296 ====== =======
1297 Value Meaning
1298 ====== =======
1299 NONE no flow-control/handshake
1300 XON XON/XOFF flow-control
1301 ACK hardware handshake with RTS&CTS
1302 ====== =======
1303
1304 """,
1305 validator=strict_discrete_set,
1306 values=["NONE", "XON", "ACK"],
1307 )
1308
1309 serial_parity = Instrument.control(
1310 "SYST:COMM:SER:PAR?",
1311 "SYST:COMM:SER:PAR %s",
1312 """ A string property that controls the parity type used for serial communication
1313
1314 Possible values are:
1315
1316 ====== =======
1317 Value Meaning
1318 ====== =======
1319 NONE no parity
1320 EVEN even parity
1321 ODD odd parity
1322 ONE parity bit fixed to 1
1323 ZERO parity bit fixed to 0
1324 ====== =======
1325
1326 """,
1327 validator=strict_discrete_set,
1328 values=["NONE", "EVEN", "ODD", "ONE", "ZERO"],
1329 )
1330
1331 serial_stopbits = Instrument.control(
1332 "SYST:COMM:SER:SBIT?",
1333 "SYST:COMM:SER:SBIT %g",
1334 """ A int property that controls the number of stop-bits used in serial communication,
1335
1336 Possible values are: 1 or 2
1337 """,
1338 validator=strict_discrete_set,
1339 values=[1, 2],
1340 )
1341
1342 date = Instrument.measurement(
1343 "SYST:DATE?",
1344 """
1345 A list property for the date of the RTC in the unit
1346 """,
1347 )
1348
1349 time = Instrument.measurement(
1350 "SYST:TIME?",
1351 """
1352 A list property for the time of the RTC in the unit
1353 """,
1354 )
1355
1356 basic_info = Instrument.measurement(
1357 "SYST:INF:BAS?",
1358 """
1359 A String property containing information about the hardware modules installed in the unit
1360 """,
1361 )
1362
1363 subsystem_info = Instrument.measurement(
1364 "SYST:INF:SUBS?",
1365 """
1366 A String property containing information about the system configuration
1367 """,
1368 )
1369
1370 scale_volt = Instrument.control(
1371 "UNIT:VOLT?",
1372 "UNIT:VOLT %s",
1373 """ A string property that controls the unit to be used for voltage entries on the unit
1374
1375 Possible values are:
1376 AV,FV, PV, NV, UV, MV, V, KV, MAV, GV, TV, PEV, EV,
1377 DBAV, DBFV, DBPV, DBNV, DBUV, DBMV, DBV, DBKV, DBMAv, DBGV, DBTV, DBPEv, DBEV
1378
1379 refer also to chapter 3.6.9 of the manual
1380 """,
1381 validator=strict_discrete_set,
1382 values=["AV", "FV", "PV", "NV", "UV", "MV", "V", "KV", "MAV", "GV",
1383 "TV", "PEV", "EV", "DBAV", "DBFV", "DBPV", "DBNV", "DBUV",
1384 "DBMV", "DBV", "DBKV", "DBMAv", "DBGV", "DBTV", "DBPEv", "DBEV"],
1385 )