Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion pydevices/HtsDevices/acq2106_435sc.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ class _ACQ2106_435SC(acq2106_435st._ACQ2106_435ST):
]

def init(self):
uut = self.getUUT()

freq = int(self.freq.data())

clock_div = 0
if freq == 40000:
clock_div = 1
elif freq == 20000:
clock_div = 2
elif freq == 10000:
clock_div = 4

# For now, the frequency must be a clean division of 40000
# This could change when D-Taqc's Peter Milne works out his arbitrary frequency 'plan' files
if clock_div == 0:
raise MDSplus.DevBAD_PARAMETER(
"FREQ must be 40000, 20000, or 10000, not %d" % (freq,))

self.slots = super(_ACQ2106_435SC, self).getSlots()

for card in self.slots:
Expand All @@ -98,7 +116,11 @@ def init(self):

if self.debug:
print("GAINs Committed for site %s" % (card,))


# Set the clock division in order to generate the desired frequency
# The computed frequency will be (40000 / CLKDIV)
uut.s1.CLKDIV = clock_div

# Here, the argument to the init of the superclass:
# - init(True) => use resampling function:
# makeSegmentResampled(begin, end, dim, b, resampled, res_factor)
Expand Down