qcodes_contrib_drivers.drivers.Advantech package

Submodules

qcodes_contrib_drivers.drivers.Advantech.PCIE_1751 module

exception qcodes_contrib_drivers.drivers.Advantech.PCIE_1751.DAQNaviException[source]

Bases: Exception

Exception raised if one of the Advantech’s DAQNavi library’s functions encounters an error.

exception qcodes_contrib_drivers.drivers.Advantech.PCIE_1751.DAQNaviWarning[source]

Bases: Warning

Warning raised if one of the Advantech’s DAQNavi library’s functions encounters a warning condition.

class qcodes_contrib_drivers.drivers.Advantech.PCIE_1751.Advantech_PCIE_1751(*args: Any, **kwargs: Any)[source]

Bases: Instrument

Driver for DIO card from Advantech. The card has six 8255 PPI mode C DI/O ports, each containing 8 pins, that can be configured for either input or output in groups of four.

The Advantech drivers have to be installed so that biodaq.dll can be accessed. This QCodes driver uses python’s C foreign function interface cffi to call the necessary functions from the dynamically linked library. Automatically loads the declaration of the library from the _bdaqctrl.h file, that can be generated by running only the C preprocessor on the header included with Advantech drivers:

gcc -D_BDAQ_C_INTERFACE -E bdaqctrl.h > _bdaqctrl.h

Before running the above command, WIN32 and _WIN32 should be undefined at the start of the bdaqctrl.h and #include <stdlib.h> should be commented out.

Current version of this driver implements only instant digital input and output. Buffered input and output, interrupts and counters are not implemented.

Tested with driver version 3.1.10.0 and ddl version 3.1.12.1.

check(errorcode)[source]

Checks the errorcode and raises an Exception if error occurred.

close()[source]

Irreversibly stop this instrument and free its resources.

Subclasses should override this if they have other specific resources to close.

get_idn()[source]

Parse a standard VISA *IDN? response into an ID dict.

Even though this is the VISA standard, it applies to various other types as well, such as IPInstruments, so it is included here in the Instrument base class.

Override this if your instrument does not support *IDN? or returns a nonstandard IDN string. This string is supposed to be a comma-separated list of vendor, model, serial, and firmware, but semicolon and colon are also common separators so we accept them here as well.

Returns:

A dict containing vendor, model, serial, and firmware.

port_count()[source]

Returns the number of ports on the device. Each port contains 8 input or output pins.

read_pin(port, pin)[source]

Reads and returns the value pin pin of port port.

read_port(i, n=1)[source]

Reads and returns the values of ports i, …, i+n-1. For n=1 returns a single integer which encodes the 8 bit values, for n>1 returns a list of integers.

write_pin(port, pin, value)[source]

Sets pin pin of port port to 1 if value != 0, and to 0 otherwise.

write_port(i, value)[source]

Writes values to output ports. If value is an integer, writes its binary representation to the pins of port i. If value is a list of integers, writes the binary representations of their values to the pins of ports i, …, i+len(value)-1 respectively.

ERRORMSG = {0: 'The operation is completed successfully.', 2684354560: 'The interrupt resource is not available.', 2684354561: 'The parameter is out of the range.', 2684354562: 'The property value is out of range.', 2684354563: 'The property value is not supported.', 2684354564: 'The property value conflicts with the current state.', 2684354565: 'The value range of all channels in a group should be same, such as 4~20mA of PCI-1724.', 3758096384: "The handle is NULL or its type doesn't match the required operation.", 3758096385: 'The parameter value is out of range.', 3758096386: 'The parameter value is not supported.', 3758096387: 'The parameter value format is not the expected.', 3758096388: 'Not enough memory is available to complete the operation.', 3758096389: 'The data buffer is null.', 3758096390: 'The data buffer is too small for the operation.', 3758096391: 'The data length exceeded the limitation.', 3758096392: 'The required function is not supported.', 3758096393: 'The required event is not supported.', 3758096394: 'The required property is not supported.', 3758096395: 'The required property is read-only.', 3758096396: 'The specified property value conflicts with the current state.', 3758096397: 'The specified property value is out of range.', 3758096398: 'The specified property value is not supported.', 3758096399: "The handle hasn't own the privilege of the operation the user wanted.", 3758096400: 'The required privilege is not available because someone else had own it.', 3758096401: 'The driver of specified device was not found.', 3758096402: 'The driver version of the specified device mismatched.', 3758096403: 'The loaded driver count exceeded the limitation.', 3758096404: 'The device is not opened.', 3758096405: 'The required device does not exist.', 3758096406: 'The required device is unrecognized by driver.', 3758096407: 'The configuration data of the specified device is lost or unavailable.', 3758096408: "The function is not initialized and can't be started.", 3758096409: 'The function is busy.', 3758096410: 'The interrupt resource is not available.', 3758096411: 'The DMA channel is not available.', 3758096412: 'Time out when reading/writing the device.', 3758096413: 'The given signature does not match with the device current one.', 3758096414: 'The function cannot be executed while the buffered AI is running.', 3758096415: 'The value range is not available in single-ended mode.', 3758161919: 'Undefined error.'}

Module contents