Skip to content

Commit 273c42d

Browse files
calculate max freq
1 parent e0fe6ee commit 273c42d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

labscript_devices/AD9959DDSSweeper/blacs_tabs.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@
1313

1414
from blacs.device_base_class import DeviceTab
1515

16+
1617
class AD9959DDSSweeperTab(DeviceTab):
1718
def initialise_GUI(self):
19+
device = self.settings['connection_table'].find_by_name(self.device_name)
20+
21+
ref_clk_freq = device.properties['ref_clock_frequency']
22+
pll_mult = device.properties['pll_mult']
23+
self.com_port = device.properties['com_port']
24+
25+
max_freq = 0.5 * (ref_clk_freq * pll_mult)
1826
# Capabilities
1927
self.base_units = {'freq':'Hz', 'amp':'Arb', 'phase':'Degrees'}
2028
self.base_min = {'freq':0.0, 'amp':0, 'phase':0}
21-
self.base_max = {'freq':250.0*10.0**6, 'amp':1, 'phase':360}
29+
self.base_max = {'freq':max_freq, 'amp':1, 'phase':360}
2230
self.base_step = {'freq':10**6, 'amp':1/1023., 'phase':1}
2331
self.base_decimals = {'freq':1, 'amp':4, 'phase':3}
2432
self.num_DDS = 4
@@ -38,10 +46,6 @@ def initialise_GUI(self):
3846
dds_widgets, _, _ = self.auto_create_widgets()
3947
self.auto_place_widgets(('DDS Outputs', dds_widgets))
4048

41-
device = self.settings['connection_table'].find_by_name(self.device_name)
42-
43-
self.com_port = device.properties['com_port']
44-
4549
self.supports_remote_value_check(False)
4650
self.supports_smart_programming(True)
4751

0 commit comments

Comments
 (0)