@@ -119,6 +119,7 @@ def val_parser(parser: type, inputstring: str) -> float | int:
119119 vals = vals .Numbers (0 , 360 ),
120120 )
121121 """Parameter phase"""
122+
122123 self .amplitude_unit : Parameter = self .add_parameter (
123124 "amplitude_unit" ,
124125 label = f"Channel { channum } amplitude unit" ,
@@ -148,6 +149,7 @@ def val_parser(parser: type, inputstring: str) -> float | int:
148149 get_parser = float ,
149150 )
150151 """Parameter offset"""
152+
151153 self .output : Parameter = self .add_parameter (
152154 "output" ,
153155 label = f"Channel { channum } output state" ,
@@ -174,10 +176,21 @@ def val_parser(parser: type, inputstring: str) -> float | int:
174176 set_cmd = f"SOURce{ channum } :FUNCtion:PULSE:WIDTh {{}}" ,
175177 get_cmd = f"SOURce{ channum } :FUNCtion:PULSE:WIDTh?" ,
176178 get_parser = float ,
177- unit = "S " ,
179+ unit = "s " ,
178180 )
179181 """Parameter pulse_width"""
180182
183+ self .edges : Parameter = self .add_parameter (
184+ "edges" ,
185+ label = f"Channel { channum } edges width" ,
186+ set_cmd = f"SOURce{ channum } :FUNCtion:PULSe:TRANsition {{}}" ,
187+ get_cmd = f"SOURce{ channum } :FUNCtion:PULSe:TRANsition?" ,
188+ get_parser = float ,
189+ unit = "s" ,
190+ vals = vals .MultiType (vals .Numbers (), vals .Enum ("MIN" , "MAX" )),
191+ )
192+ """Sets the transition times for the leading and trailing edges of the pulse."""
193+
181194 # TRIGGER MENU
182195 self .trigger_source : Parameter = self .add_parameter (
183196 "trigger_source" ,
@@ -298,7 +311,7 @@ def val_parser(parser: type, inputstring: str) -> float | int:
298311
299312 self .burst_int_period : Parameter = self .add_parameter (
300313 "burst_int_period" ,
301- label = ( f"Channel { channum } burst internal period" ) ,
314+ label = f"Channel { channum } burst internal period" ,
302315 set_cmd = f"SOURce{ channum } :BURSt:INTernal:PERiod {{}}" ,
303316 get_cmd = f"SOURce{ channum } :BURSt:INTernal:PERiod?" ,
304317 unit = "s" ,
@@ -312,6 +325,68 @@ def val_parser(parser: type, inputstring: str) -> float | int:
312325 )
313326 """The burst period is the time between the starts of consecutive bursts when trigger is immediate."""
314327
328+ self .output_load : Parameter = self .add_parameter (
329+ "output_load" ,
330+ label = f"Channel { channum } output load" ,
331+ set_cmd = f"OUTPut{ channum } :LOAD {{}}" ,
332+ get_cmd = f"OUTPut{ channum } :LOAD?" ,
333+ get_parser = partial (val_parser , float ),
334+ unit = "ohms" ,
335+ vals = vals .MultiType (vals .Numbers (1 , 10000 ), vals .Enum ("INF" , "MIN" , "MAX" )),
336+ )
337+ """Sets expected output termination. Should equal the load impedance attached to the output."""
338+
339+ self .auto_range : Parameter = self .add_parameter (
340+ "auto_range" ,
341+ label = f"Channel { channum } range mode" ,
342+ set_cmd = f"SOURce{ channum } :VOLTage:RANGe:AUTO {{}}" ,
343+ get_cmd = f"SOURce{ channum } :VOLTage:RANGe:AUTO?" ,
344+ val_mapping = {"ON" : 1 , "OFF" : 0 },
345+ vals = vals .Enum ("ON" , "OFF" ),
346+ )
347+ """Disables or enables voltage autoranging for all functions."""
348+
349+ # Arbitrary waveforms
350+ if self ._parent .model [2 ] in [
351+ "5" ,
352+ "6" ,
353+ ]: # Older models do not support all arbitrary options
354+ max_srate = self ._parent ._max_srate [self .model ]
355+ self .srate : Parameter = self .add_parameter (
356+ "srate" ,
357+ label = f"Channel { channum } sample rate" ,
358+ set_cmd = f"SOURce{ channum } :FUNCtion:ARBitrary:SRATe {{}}" ,
359+ get_cmd = f"SOURce{ channum } :FUNCtion:ARBitrary:SRATe?" ,
360+ get_parser = float ,
361+ unit = "Sa/s" ,
362+ vals = vals .MultiType (
363+ vals .Numbers (1e-6 , max_srate ), vals .Enum ("MIN" , "MAX" , "DEF" )
364+ ),
365+ )
366+ """Sets the sample rate for the arbitrary waveform."""
367+
368+ self .add_function (
369+ "load_arb" ,
370+ call_cmd = f"SOURce{ channum } :DATA:ARBitrary {{}}, {{}}" ,
371+ args = [vals .Strings (), vals .Arrays ()],
372+ arg_parser = lambda sig_name , arr : (sig_name , "," .join (map (str , arr ))),
373+ )
374+ """Downloads integer values representing floating point values into waveform volatile memory."""
375+ # TODO: add DAC (Digital-to-Analog Converter) support.
376+
377+ self .add_function (
378+ "set_arb" ,
379+ call_cmd = f"SOURce{ channum } :FUNCtion:ARBitrary {{}}" ,
380+ args = [vals .Strings ()],
381+ )
382+ """Selects an arbitrary waveform that has previously been loaded into volatile memory."""
383+
384+ self .add_function (
385+ "clear_arb" ,
386+ call_cmd = f"SOURce{ channum } :DATA:VOLatile:CLEar" ,
387+ )
388+ """Clears waveform memory and reloads the default waveform."""
389+
315390
316391OutputChannel = Keysight33xxxOutputChannel
317392
@@ -402,23 +477,44 @@ def __init__(
402477 no_of_channels = {
403478 "33210A" : 1 ,
404479 "33250A" : 1 ,
480+ "33510B" : 2 ,
405481 "33511B" : 1 ,
406482 "33512B" : 2 ,
483+ "33521B" : 1 ,
407484 "33522B" : 2 ,
408485 "33611A" : 1 ,
486+ "33612A" : 2 ,
487+ "33621A" : 1 ,
409488 "33622A" : 2 ,
410- "33510B" : 2 ,
411489 }
412490
413491 self ._max_freqs = {
414492 "33210A" : 10e6 ,
493+ "33250A" : 80e6 ,
494+ "33510B" : 20e6 ,
415495 "33511B" : 20e6 ,
416496 "33512B" : 20e6 ,
417- "33250A " : 80e6 ,
497+ "33521B " : 30e6 ,
418498 "33522B" : 30e6 ,
419499 "33611A" : 80e6 ,
500+ "33612A" : 80e6 ,
501+ "33621A" : 120e6 ,
420502 "33622A" : 120e6 ,
421- "33510B" : 20e6 ,
503+ }
504+
505+ # Refer to instruments User's guides
506+ self ._max_srate = {
507+ "33210A" : 50e6 ,
508+ "33250A" : 200e6 ,
509+ "33510B" : 160e6 ,
510+ "33511B" : 160e6 ,
511+ "33512B" : 160e6 ,
512+ "33521B" : 250e6 ,
513+ "33522B" : 250e6 ,
514+ "33611A" : 660e6 ,
515+ "33612A" : 660e6 ,
516+ "33621A" : 1e9 ,
517+ "33622A" : 1e9 ,
422518 }
423519
424520 self .num_channels = no_of_channels [self .model ]
0 commit comments