Skip to content

[WIP] Ats9360 with channels#816

Closed
jenshnielsen wants to merge 256 commits intomicrosoft:masterfrom
jenshnielsen:ATS9360Channels
Closed

[WIP] Ats9360 with channels#816
jenshnielsen wants to merge 256 commits intomicrosoft:masterfrom
jenshnielsen:ATS9360Channels

Conversation

@jenshnielsen
Copy link
Collaborator

@jenshnielsen jenshnielsen commented Oct 25, 2017

Driver for ATS9360 and new controller that supports capturing from both physical channels as well as with and without software demodulation. The controller works using the new channels api. Per default it does not define any channels but you can setup channels that will return data in any 0d to 2d shape of buffers, records and samples and with and without sorfware demodulation

@nataliejpg It would be great if you can have a look at the notebook in https://github.com/jenshnielsen/Qcodes/blob/9a3822fb56134c7f2693306f068e95cdab23e58c/docs/examples/driver_examples/Qcodes%20example%20with%20Alazar%20ATS9360.ipynb
to see if it does what you want.

@damazter

This contains some changes to the existing driver in
ATS.py
ATS9870.py

These are mainly:

  • Changes to casting of a few parameters passed to functions. i.e. a cast of the address in AlazarPostAsyncBuffer to ctypes.cast(buf.addr, ctypes.c_void_p) I found that this was
    needed to get the code to actually run on some machines (As far as I can tell it depends on the windows version)
  • Cleanup to the Ctypes calling to simplify a bit avoiding to create numpy arrays of one element
  • Handle cards with non 8 bit resolution
  • Add aux_io_mode and aux_io_param

I would like your input on these before we merge this. I do not have a 9870 card to test with at the moment.

nataliejpg and others added 30 commits August 4, 2016 15:23
…rrectly and new eg notebook (needs cleaning up)
Copy link
Contributor

@damazter damazter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will continue later with reviewing of the other files

raise Exception("Unsupported OS")

# TODO (W) make the board id more general such that more than one card
# per system configurations are supported
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it the case that multiple boards are already supported?

# as up to date since it's not being pushed to
# the instrument at any time and is never used
if clock_source == 'EXTERNAL_CLOCK_10MHz_REF':
sample_rate = self.external_sample_rate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't the parameters external_sample_rate and sample_rate be merged into a single parameter? I don;t see the need for two separate parameters

ctypes.c_uint32,
ctypes.c_uint32,
ctypes.c_uint32,
ctypes.c_uint32]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this line do?

if self.channel_selection._get_byte() == 3:
number_of_channels = 2
else:
number_of_channels = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should probably be generalised to more than 2 channels at some point

buffer_recycling = (self.buffers_per_acquisition._get_byte() >
self.allocated_buffers._get_byte())
done_setup = time.clock()
while (buffers_completed < self.buffers_per_acquisition._get_byte()):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the outer brackets here are not PEP8 compatible right?

logger.info("Capture took {}".format(capture_time))
logger.info("abort took {}".format(abort_time))
logger.info("handling took {}".format(handling_time))
logger.info("free mem took {}".format(free_mem_time))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be sensible to add an option to disable all this timing debug info, we don't always want to delay our measurements by printing this stuff

else:
args_out.append(arg)

logger.debug("calling dll func {} with args: \n {}".format(func_name, args_out))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this line delay the code? if so, we might want to disable it

self._set(value)

def get(self):
def get_raw(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this not just get?
get_raw seems to imply some byte code or something, which it does not do.

value='AUX_IN_AUXILIARY',
byte_to_value_dict={0: 'AUX_OUT_TRIGGER',
1: 'AUX_IN_TRIGGER_ENABLE',
13: 'AUX_IN_AUXILIARY'})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 13 a valid value? we could not find it in the manual

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the 9360 it is but maybe that we have to overwrite this in that class

value='NONE',
byte_to_value_dict={0: 'NONE',
1: 'TRIG_SLOPE_POSITIVE',
2: 'TRIG_SLOPE_NEGATIVE'})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is label missing here?

@jenshnielsen
Copy link
Collaborator Author

Not relevant anymore, The controllers are in qdev-wrappers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants