Hello, we are neuroscientists studying the sense of smell. We are long time users of your boards esp USB-DIO-96 which we have embedded in devices that we use to control solenoid valves that select amongst many possible odours to deliver.

We built some simple control software using your linux style API on top of libusb that has been running for years (api code is dated 2009) via some software called Igor Pro. We now need to switch control software to a new Python based system running on Windows 10.

So finally my questions,

1. Do you happen to have any Python samples likely either against your regular DLL via ctypes and/or via pyusb or py-libusb etc?

We only use a pretty small subset of your API including

  • AIO_Init
  • AIO_Usb_GetDevices
  • AIO_UsbValidateDeviceIndex
  • AIO_Usb_DIO_ReadAll
  • AIO_Usb_WriteAll
  • getDevHandle

We also wrote a couple of custom functions which accept an already initialised libusb handle for speed rather than intialising every time. I'm not sure if you now have this kind of functionality built in.

AIO_Usb_WriteAllH AIO_Usb_DIO_ReadTriggerH

2. In porting our/mac linux code using this AcessIO_LinuxUsbAPI to Windows is there anything we should look out for?

//	      AcessIO_LinuxUsbAPI 
//  
//  Release 1.0
//
//  Description:   
//   Linux Implementation of the Access/IO USB SW API Interface which
//   enables applications to interface with ACCES/IO devices which use
//   a USB Interface to communicate with a host computer. 
//
//   There is a similar API for Windows. The implementation of the APIs
//   is not the same
//
//  Author	:  Jeff Price
//  History	:  11/06/2009	created

3. if I do need to compile a new DLL (to access via anaconda python with ctypes) that has a small amount of custom C code on top of your library, what compiler etc setup would you recommend?

For reference our code is here:

https://github.com/jefferislab/ODDXOP

# main entry point https://github.com/jefferislab/ODDXOP/blob/master/XFUNC3.c

# extensions to your API https://github.com/jefferislab/ODDXOP/blob/master/aioUsbExts.c

# your API https://github.com/jefferislab/ODDXOP/blob/master/Xcode/aioUsbApi.c

With many thanks for your input,

Greg Jefferis, Cambridge, UK.

Response 1

:

Hi Gregory,

We do not yet offer Python as an officially supported language (that is, a language for which we provide working sample programs for the majority of our products).

However, we are in the process of adding Python to our list of supported languages.

You can grab a ctypes wrapper for the Windows AIOUSB.dll here: https://accesio.com/files/AIOUSB.py

There will be minor edits necessary to this file; specifically, make sure the DLL is being loaded from a valid location.

If you run into any issues just let me know and I'll provide what assistance I can.

Sincerely, John Hentges JHentges@accesio.com Director of Digital Design and Software Engineering

Response 2

Hi Gregory,

AIO_Init(), and libusb itself, are not used in Windows.

Our Windows API Library (AIOUSB.dll) doesn't support libusb, and instead uses CyUSB.sys (or CyUSB3.sys) as its driver component.

Sincerely, John Hentges JHentges@accesio.com Director of Digital Design and Software Engineering

—–Original message—– From: Dr Gregory Jefferis jefferis@mrc-lmb.cam.ac.uk Sent: 06/21/2021 09:37:56

Dear John,

Many thanks for you message. I very much appreciate your quick response.

The AIOUSB.py sample file you linked will be very useful. Two questions

1. Is AIO_Init() still necessary? I see it is not wrapped.

2. Do you have any thoughts about whether it will be possible to get / work with an initialised lib_usb handle on the python side? In the past reusing handles make things run much faster.

Thank you again,

Greg.


Log In