Skip to content

Commit

Permalink
Merge pull request #1461 from VandersypenQutech/feat/m4i_pretrigger
Browse files Browse the repository at this point in the history
add option for pretrigger memsize to channel readout
  • Loading branch information
astafan8 authored Feb 13, 2019
2 parents bec01dc + 4f2e6ab commit 07c20db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qcodes/instrument_drivers/Spectrum/M4i.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def convert_to_voltage(self, data, input_range):
return data * input_range / resolution

def initialize_channels(self, channels=None, mV_range=1000, input_path=0,
termination=0, coupling=0, compensation=None, memsize=2**12):
termination=0, coupling=0, compensation=None, memsize=2**12, pretrigger_memsize = 16):
""" Setup channels of the digitizer for simple readout using Parameters
The channels can be read out using the Parmeters `channel_0`, `channel_1`, ...
Expand All @@ -621,9 +621,12 @@ def initialize_channels(self, channels=None, mV_range=1000, input_path=0,
mV_range, input_path, termination, coupling, compensation: passed
to the set_channel_settings function
memsize (int): memory size to use for simple channel readout
pretrigger_memsize (int): Pretrigger memory size to use. The default
value used is 16, which is the smallest value possible.
"""
allchannels = 0
self._channel_memsize = memsize
self._channel_pretrigger_memsize = pretrigger_memsize
self.data_memory_size(memsize)
if channels is None:
channels = range(4)
Expand Down Expand Up @@ -655,7 +658,7 @@ def _read_channel(self, channel, memsize=None):
"""
if memsize is None:
memsize = self._channel_memsize
posttrigger_size = 16 * int((memsize / 2) // 16)
posttrigger_size = memsize - self._channel_pretrigger_memsize
mV_range = getattr(self, 'range_channel_%d' % channel).get()
cx = self._channel_mask()
self.enable_channels(cx)
Expand Down

0 comments on commit 07c20db

Please sign in to comment.