diff --git a/labscript_devices/NI_DAQmx/blacs_tabs.py b/labscript_devices/NI_DAQmx/blacs_tabs.py index 527d765f..247b5ebc 100644 --- a/labscript_devices/NI_DAQmx/blacs_tabs.py +++ b/labscript_devices/NI_DAQmx/blacs_tabs.py @@ -17,6 +17,7 @@ from blacs.device_base_class import DeviceTab from .utils import split_conn_AO, split_conn_DO from . import models +import warnings class NI_DAQmxTab(DeviceTab): @@ -41,6 +42,17 @@ def initialise_GUI(self): num_AO = properties['num_AO'] num_AI = properties['num_AI'] + try: + AI_chans = properties['AI_chans'] + except KeyError: + # new code being run on older model specification file + # assume legacy behavior, warn user to update + AI_chans = [f'ai{i:d}' for i in range(num_AI)] + msg = """Connection table was compiled with old model specifications for {0}. + Please recompile the connection table. + """ + warnings.warn(dedent(msg.format(properties['MAX_name'])), FutureWarning) + ports = properties['ports'] num_CI = properties['num_CI'] @@ -187,8 +199,11 @@ def initialise_GUI(self): { 'MAX_name': self.MAX_name, 'num_AI': num_AI, + 'AI_chans': AI_chans, + 'AI_term': properties['AI_term'], 'AI_range': properties['AI_range'], 'AI_start_delay': properties['AI_start_delay'], + 'AI_start_delay_ticks': properties['AI_start_delay_ticks'], 'clock_terminal': clock_terminal, }, ) diff --git a/labscript_devices/NI_DAQmx/blacs_workers.py b/labscript_devices/NI_DAQmx/blacs_workers.py index 7e12047f..61dff2fc 100644 --- a/labscript_devices/NI_DAQmx/blacs_workers.py +++ b/labscript_devices/NI_DAQmx/blacs_workers.py @@ -408,7 +408,7 @@ def init(self): # Hard coded for now. Perhaps we will add functionality to enable # and disable inputs in manual mode, and adjust the rate: - self.manual_mode_chans = ['ai%d' % i for i in range(self.num_AI)] + self.manual_mode_chans = self.AI_chans self.manual_mode_rate = 1000 # An event for knowing when the wait durations are known, so that we may use @@ -471,11 +471,20 @@ def start_task(self, chans, rate): self.read_array = np.zeros((num_samples, len(chans)), dtype=np.float64) self.task = Task() + if self.AI_term == 'RSE': + term = DAQmx_Val_RSE + elif self.AI_term == 'NRSE': + term = DAQmx_Val_NRSE + elif self.AI_term == 'Diff': + term = DAQmx_Val_Diff + elif self.AI_term == 'PseudoDiff': + term = DAQmx_Val_PseudoDiff + for chan in chans: self.task.CreateAIVoltageChan( self.MAX_name + '/' + chan, "", - DAQmx_Val_RSE, + term, self.AI_range[0], self.AI_range[1], DAQmx_Val_Volts, @@ -527,6 +536,9 @@ def transition_to_buffered(self, device_name, h5file, initial_values, fresh): self.buffered_chans = sorted(set(chans), key=split_conn_AI) self.h5_file = h5file self.buffered_rate = device_properties['acquisition_rate'] + if device_properties['start_delay_ticks']: + # delay is defined in sample clock ticks, calculate in sec and save for later + self.AI_start_delay = self.AI_start_delay_ticks*self.buffered_rate self.acquired_data = [] # Stop the manual mode task and start the buffered mode task: self.stop_task() diff --git a/labscript_devices/NI_DAQmx/labscript_devices.py b/labscript_devices/NI_DAQmx/labscript_devices.py index dd5107d4..7efeb88d 100644 --- a/labscript_devices/NI_DAQmx/labscript_devices.py +++ b/labscript_devices/NI_DAQmx/labscript_devices.py @@ -11,7 +11,7 @@ # # ##################################################################### -__version__ = '1.0.0' +__version__ = '1.1.0' from labscript import ( @@ -30,6 +30,7 @@ from labscript_utils import dedent from .utils import split_conn_DO, split_conn_AO, split_conn_AI import numpy as np +import warnings _ints = {8: np.uint8, 16: np.uint16, 32: np.uint32, 64: np.uint64} @@ -59,6 +60,9 @@ class NI_DAQmx(IntermediateDevice): "clock_mirror_terminal", "AI_range", "AI_start_delay", + "AI_start_delay_ticks", + "AI_term", + "AI_chans", "AO_range", "max_AI_multi_chan_rate", "max_AI_single_chan_rate", @@ -72,11 +76,12 @@ class NI_DAQmx(IntermediateDevice): "supports_buffered_AO", "supports_buffered_DO", "supports_semiperiod_measurement", + "supports_simultaneous_AI_sampling", "clock_limit", "wait_monitor_minimum_pulse_width", "wait_monitor_supports_wait_completed_events", ], - "device_properties": ["acquisition_rate"], + "device_properties": ["acquisition_rate","start_delay_ticks"], } ) def __init__( @@ -90,7 +95,11 @@ def __init__( clock_mirror_terminal=None, acquisition_rate=None, AI_range=None, + AI_range_Diff=None, AI_start_delay=0, + AI_start_delay_ticks=None, + AI_term='RSE', + AI_term_cfg=None, AO_range=None, max_AI_multi_chan_rate=None, max_AI_single_chan_rate=None, @@ -104,6 +113,7 @@ def __init__( supports_buffered_AO=False, supports_buffered_DO=False, supports_semiperiod_measurement=False, + supports_simultaneous_AI_sampling=False, **kwargs ): """Generic class for NI_DAQmx devices. @@ -125,8 +135,20 @@ def __init__( acquisiton_rate (float, optional): Default sample rate of inputs. AI_range (iterable, optional): A `[Vmin, Vmax]` pair that sets the analog input voltage range for all analog inputs. + AI_range_Diff (iterable, optional): A `[Vmin, Vmax]` pair that sets the analog + input voltage range for all analog inputs when using Differential termination. AI_start_delay (float, optional): Time in seconds between start of an analog input task starting and the first sample. + AI_start_delay_ticks (int, optional): Time in sample clock periods between + start of an analog input task starting and the first sample. To use + this method, `AI_start_delay` must be set to `None`. This is necessary + for DAQs that employ delta ADCs. + AI_term (str, optional): Configures the analog input termination for all + analog inputs. Must be supported by the device. Supported options are + `'RSE'`, `'NRSE'` `'Diff'`, and '`PseudoDiff'`. + AI_term_cfg (dict, optional): Dictionary of analog input channels and their + supported terminations. Best to use `get_capabilities.py` to introspect + these. AO_range (iterable, optional): A `[Vmin, Vmax]` pair that sets the analog output voltage range for all analog outputs. max_AI_multi_chan_rate (float, optional): Max supported analog input @@ -148,7 +170,7 @@ def __init__( buffered output supports_buffered_DO (bool, optional): True if digital outputs support buffered output - supports_semiperiod_measurement (bool, optional): True if deviec supports + supports_semiperiod_measurement (bool, optional): True if device supports semi-period measurements """ @@ -192,12 +214,39 @@ def __init__( self.max_DO_sample_rate = max_DO_sample_rate self.min_semiperiod_measurement = min_semiperiod_measurement self.num_AI = num_AI + # special handling for AI termination configurations + self.AI_term = AI_term + if AI_term_cfg == None: + # assume legacy configuration if none provided + AI_term_cfg = {f'ai{i:d}': ['RSE'] for i in range(num_AI)} + # warn user to update their local model specs + msg = """Model specifications for {} needs to be updated. + Please run the `get_capabilites.py` and `generate_subclasses.py` + scripts or define the `AI_Term_Cfg` kwarg for your device. + """ + warnings.warn(dedent(msg.format(self.description)), FutureWarning) + self.AI_chans = [key for key,val in AI_term_cfg.items() if self.AI_term in val] + if not len(self.AI_chans): + msg = """AI termination {0} not supported by this device.""" + raise LabscriptError(dedent(msg.format(AI_term))) + if AI_term == 'Diff': + self.AI_range = AI_range_Diff + if AI_start_delay is None: + if AI_start_delay_ticks is not None: + # Tell blacs_worker to use AI_start_delay_ticks to define delay + self.start_delay_ticks = True + else: + raise LabscriptError("You have specified `AI_start_delay = None` but have not provided `AI_start_delay_ticks`.") + else: + # Tells blacs_worker to use AI_start_delay to define delay + self.start_delay_ticks = False self.num_AO = num_AO self.num_CI = num_CI self.ports = ports if ports is not None else {} self.supports_buffered_AO = supports_buffered_AO self.supports_buffered_DO = supports_buffered_DO self.supports_semiperiod_measurement = supports_semiperiod_measurement + self.supports_simultaneous_AI_sampling = supports_simultaneous_AI_sampling if self.supports_buffered_DO and self.supports_buffered_AO: self.clock_limit = min(self.max_DO_sample_rate, self.max_AO_sample_rate) @@ -291,8 +340,7 @@ def add_device(self, device): buffered output""" raise ValueError(dedent(msg) % port_str) elif isinstance(device, AnalogIn): - ai_num = split_conn_AI(device.connection) - if ai_num >= self.num_AI: + if device.connection not in self.AI_chans: msg = """Cannot add analog input with connection string '%s' to device with num_AI=%d""" raise ValueError(dedent(msg) % (device.connection, self.num_AI)) @@ -352,7 +400,9 @@ def _check_AI_not_too_fast(self, AI_table): # Either no AI in use, or already checked against single channel rate in # __init__. return - if self.acquisition_rate <= self.max_AI_multi_chan_rate / n: + if self.supports_simultaneous_AI_sampling and self.acquisition_rate <= self.max_AI_multi_chan_rate: + return + elif self.acquisition_rate <= self.max_AI_multi_chan_rate / n: return msg = """Requested acqusition_rate %f for device %s with %d analog input channels in use is too fast. Device supports a rate of %f per channel when diff --git a/labscript_devices/NI_DAQmx/models/NI_PCI_6251.py b/labscript_devices/NI_DAQmx/models/NI_PCI_6251.py index e7587717..6d29fa8b 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PCI_6251.py +++ b/labscript_devices/NI_DAQmx/models/NI_PCI_6251.py @@ -25,7 +25,27 @@ #: CAPABILITIES = { 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], 'AI_start_delay': 2.5e-07, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'NRSE', 'Diff'], + 'ai1': ['RSE', 'NRSE', 'Diff'], + 'ai10': ['RSE', 'NRSE'], + 'ai11': ['RSE', 'NRSE'], + 'ai12': ['RSE', 'NRSE'], + 'ai13': ['RSE', 'NRSE'], + 'ai14': ['RSE', 'NRSE'], + 'ai15': ['RSE', 'NRSE'], + 'ai2': ['RSE', 'NRSE', 'Diff'], + 'ai3': ['RSE', 'NRSE', 'Diff'], + 'ai4': ['RSE', 'NRSE', 'Diff'], + 'ai5': ['RSE', 'NRSE', 'Diff'], + 'ai6': ['RSE', 'NRSE', 'Diff'], + 'ai7': ['RSE', 'NRSE', 'Diff'], + 'ai8': ['RSE', 'NRSE'], + 'ai9': ['RSE', 'NRSE'], + }, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': 1000000.0, 'max_AI_single_chan_rate': 1250000.0, @@ -43,6 +63,7 @@ 'supports_buffered_AO': True, 'supports_buffered_DO': True, 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': False, } diff --git a/labscript_devices/NI_DAQmx/models/NI_PCI_6534.py b/labscript_devices/NI_DAQmx/models/NI_PCI_6534.py index c0b7f9f0..e0d15dec 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PCI_6534.py +++ b/labscript_devices/NI_DAQmx/models/NI_PCI_6534.py @@ -25,6 +25,7 @@ #: CAPABILITIES = { 'AI_range': None, + 'AI_range_Diff': None, 'AI_start_delay': None, 'AO_range': None, 'max_AI_multi_chan_rate': None, diff --git a/labscript_devices/NI_DAQmx/models/NI_PCI_6713.py b/labscript_devices/NI_DAQmx/models/NI_PCI_6713.py index 99361845..bf85ebc5 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PCI_6713.py +++ b/labscript_devices/NI_DAQmx/models/NI_PCI_6713.py @@ -25,6 +25,7 @@ #: CAPABILITIES = { 'AI_range': None, + 'AI_range_Diff': None, 'AI_start_delay': None, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': None, diff --git a/labscript_devices/NI_DAQmx/models/NI_PCI_6733.py b/labscript_devices/NI_DAQmx/models/NI_PCI_6733.py index 234e3f09..7a64e3de 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PCI_6733.py +++ b/labscript_devices/NI_DAQmx/models/NI_PCI_6733.py @@ -25,6 +25,7 @@ #: CAPABILITIES = { 'AI_range': None, + 'AI_range_Diff': None, 'AI_start_delay': None, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': None, diff --git a/labscript_devices/NI_DAQmx/models/NI_PCI_DIO_32HS.py b/labscript_devices/NI_DAQmx/models/NI_PCI_DIO_32HS.py index 6f297f36..be69c201 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PCI_DIO_32HS.py +++ b/labscript_devices/NI_DAQmx/models/NI_PCI_DIO_32HS.py @@ -25,6 +25,7 @@ #: CAPABILITIES = { 'AI_range': None, + 'AI_range_Diff': None, 'AI_start_delay': None, 'AO_range': None, 'max_AI_multi_chan_rate': None, diff --git a/labscript_devices/NI_DAQmx/models/NI_PCIe_6343.py b/labscript_devices/NI_DAQmx/models/NI_PCIe_6343.py new file mode 100644 index 00000000..599f505c --- /dev/null +++ b/labscript_devices/NI_DAQmx/models/NI_PCIe_6343.py @@ -0,0 +1,94 @@ +##################################################################### +# # +# /NI_DAQmx/models/_subclass_template.py # +# # +# Copyright 2018, Christopher Billington # +# # +# This file is part of the module labscript_devices, in the # +# labscript suite (see http://labscriptsuite.org), and is # +# licensed under the Simplified BSD License. See the license.txt # +# file in the root of the project for the full license. # +# # +##################################################################### + +##################################################################### +# WARNING # +# # +# This file is auto-generated, any modifications may be # +# overwritten. See README.txt in this folder for details # +# # +##################################################################### + + +from labscript_devices.NI_DAQmx.labscript_devices import NI_DAQmx + +#: +CAPABILITIES = { + 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], + 'AI_start_delay': 7e-08, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'NRSE', 'Diff'], + 'ai1': ['RSE', 'NRSE', 'Diff'], + 'ai10': ['RSE', 'NRSE'], + 'ai11': ['RSE', 'NRSE'], + 'ai12': ['RSE', 'NRSE'], + 'ai13': ['RSE', 'NRSE'], + 'ai14': ['RSE', 'NRSE'], + 'ai15': ['RSE', 'NRSE'], + 'ai16': ['RSE', 'NRSE', 'Diff'], + 'ai17': ['RSE', 'NRSE', 'Diff'], + 'ai18': ['RSE', 'NRSE', 'Diff'], + 'ai19': ['RSE', 'NRSE', 'Diff'], + 'ai2': ['RSE', 'NRSE', 'Diff'], + 'ai20': ['RSE', 'NRSE', 'Diff'], + 'ai21': ['RSE', 'NRSE', 'Diff'], + 'ai22': ['RSE', 'NRSE', 'Diff'], + 'ai23': ['RSE', 'NRSE', 'Diff'], + 'ai24': ['RSE', 'NRSE'], + 'ai25': ['RSE', 'NRSE'], + 'ai26': ['RSE', 'NRSE'], + 'ai27': ['RSE', 'NRSE'], + 'ai28': ['RSE', 'NRSE'], + 'ai29': ['RSE', 'NRSE'], + 'ai3': ['RSE', 'NRSE', 'Diff'], + 'ai30': ['RSE', 'NRSE'], + 'ai31': ['RSE', 'NRSE'], + 'ai4': ['RSE', 'NRSE', 'Diff'], + 'ai5': ['RSE', 'NRSE', 'Diff'], + 'ai6': ['RSE', 'NRSE', 'Diff'], + 'ai7': ['RSE', 'NRSE', 'Diff'], + 'ai8': ['RSE', 'NRSE'], + 'ai9': ['RSE', 'NRSE'], + }, + 'AO_range': [-10.0, 10.0], + 'max_AI_multi_chan_rate': 500000.0, + 'max_AI_single_chan_rate': 500000.0, + 'max_AO_sample_rate': 917431.1926605505, + 'max_DO_sample_rate': 1000000.0, + 'min_semiperiod_measurement': 1e-07, + 'num_AI': 32, + 'num_AO': 4, + 'num_CI': 4, + 'ports': { + 'port0': {'num_lines': 32, 'supports_buffered': True}, + 'port1': {'num_lines': 8, 'supports_buffered': False}, + 'port2': {'num_lines': 8, 'supports_buffered': False}, + }, + 'supports_buffered_AO': True, + 'supports_buffered_DO': True, + 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': False, +} + + +class NI_PCIe_6343(NI_DAQmx): + description = 'NI-PCIe-6343' + + def __init__(self, *args, **kwargs): + """Class for NI-PCIe-6343""" + # Any provided kwargs take precedent over capabilities + combined_kwargs = CAPABILITIES.copy() + combined_kwargs.update(kwargs) + NI_DAQmx.__init__(self, *args, **combined_kwargs) diff --git a/labscript_devices/NI_DAQmx/models/NI_PCIe_6363.py b/labscript_devices/NI_DAQmx/models/NI_PCIe_6363.py index 8155ce02..d3c746ab 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PCIe_6363.py +++ b/labscript_devices/NI_DAQmx/models/NI_PCIe_6363.py @@ -25,7 +25,43 @@ #: CAPABILITIES = { 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], 'AI_start_delay': 7e-08, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'NRSE', 'Diff'], + 'ai1': ['RSE', 'NRSE', 'Diff'], + 'ai10': ['RSE', 'NRSE'], + 'ai11': ['RSE', 'NRSE'], + 'ai12': ['RSE', 'NRSE'], + 'ai13': ['RSE', 'NRSE'], + 'ai14': ['RSE', 'NRSE'], + 'ai15': ['RSE', 'NRSE'], + 'ai16': ['RSE', 'NRSE', 'Diff'], + 'ai17': ['RSE', 'NRSE', 'Diff'], + 'ai18': ['RSE', 'NRSE', 'Diff'], + 'ai19': ['RSE', 'NRSE', 'Diff'], + 'ai2': ['RSE', 'NRSE', 'Diff'], + 'ai20': ['RSE', 'NRSE', 'Diff'], + 'ai21': ['RSE', 'NRSE', 'Diff'], + 'ai22': ['RSE', 'NRSE', 'Diff'], + 'ai23': ['RSE', 'NRSE', 'Diff'], + 'ai24': ['RSE', 'NRSE'], + 'ai25': ['RSE', 'NRSE'], + 'ai26': ['RSE', 'NRSE'], + 'ai27': ['RSE', 'NRSE'], + 'ai28': ['RSE', 'NRSE'], + 'ai29': ['RSE', 'NRSE'], + 'ai3': ['RSE', 'NRSE', 'Diff'], + 'ai30': ['RSE', 'NRSE'], + 'ai31': ['RSE', 'NRSE'], + 'ai4': ['RSE', 'NRSE', 'Diff'], + 'ai5': ['RSE', 'NRSE', 'Diff'], + 'ai6': ['RSE', 'NRSE', 'Diff'], + 'ai7': ['RSE', 'NRSE', 'Diff'], + 'ai8': ['RSE', 'NRSE'], + 'ai9': ['RSE', 'NRSE'], + }, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': 1000000.0, 'max_AI_single_chan_rate': 2000000.0, @@ -43,6 +79,7 @@ 'supports_buffered_AO': True, 'supports_buffered_DO': True, 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': False, } diff --git a/labscript_devices/NI_DAQmx/models/NI_PCIe_6738.py b/labscript_devices/NI_DAQmx/models/NI_PCIe_6738.py index fb592d21..970ff1c9 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PCIe_6738.py +++ b/labscript_devices/NI_DAQmx/models/NI_PCIe_6738.py @@ -25,6 +25,7 @@ #: CAPABILITIES = { 'AI_range': None, + 'AI_range_Diff': None, 'AI_start_delay': None, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': None, diff --git a/labscript_devices/NI_DAQmx/models/NI_PXI_6733.py b/labscript_devices/NI_DAQmx/models/NI_PXI_6733.py index 74ff7215..a98a7dec 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PXI_6733.py +++ b/labscript_devices/NI_DAQmx/models/NI_PXI_6733.py @@ -25,6 +25,7 @@ #: CAPABILITIES = { 'AI_range': None, + 'AI_range_Diff': None, 'AI_start_delay': None, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': None, diff --git a/labscript_devices/NI_DAQmx/models/NI_PXIe_4499.py b/labscript_devices/NI_DAQmx/models/NI_PXIe_4499.py new file mode 100644 index 00000000..7160bdeb --- /dev/null +++ b/labscript_devices/NI_DAQmx/models/NI_PXIe_4499.py @@ -0,0 +1,75 @@ +##################################################################### +# # +# /NI_DAQmx/models/_subclass_template.py # +# # +# Copyright 2018, Christopher Billington # +# # +# This file is part of the module labscript_devices, in the # +# labscript suite (see http://labscriptsuite.org), and is # +# licensed under the Simplified BSD License. See the license.txt # +# file in the root of the project for the full license. # +# # +##################################################################### + +##################################################################### +# WARNING # +# # +# This file is auto-generated, any modifications may be # +# overwritten. See README.txt in this folder for details # +# # +##################################################################### + + +from labscript_devices.NI_DAQmx.labscript_devices import NI_DAQmx + +#: +CAPABILITIES = { + 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], + 'AI_start_delay': None, + 'AI_start_delay_ticks': 64, + 'AI_term': 'PseudoDiff', + 'AI_term_cfg': { + 'ai0': ['PseudoDiff'], + 'ai1': ['PseudoDiff'], + 'ai10': ['PseudoDiff'], + 'ai11': ['PseudoDiff'], + 'ai12': ['PseudoDiff'], + 'ai13': ['PseudoDiff'], + 'ai14': ['PseudoDiff'], + 'ai15': ['PseudoDiff'], + 'ai2': ['PseudoDiff'], + 'ai3': ['PseudoDiff'], + 'ai4': ['PseudoDiff'], + 'ai5': ['PseudoDiff'], + 'ai6': ['PseudoDiff'], + 'ai7': ['PseudoDiff'], + 'ai8': ['PseudoDiff'], + 'ai9': ['PseudoDiff'], + }, + 'AO_range': None, + 'max_AI_multi_chan_rate': 204800.0, + 'max_AI_single_chan_rate': 204800.0, + 'max_AO_sample_rate': None, + 'max_DO_sample_rate': None, + 'min_semiperiod_measurement': None, + 'num_AI': 16, + 'num_AO': 0, + 'num_CI': 0, + 'ports': {}, + 'supports_buffered_AO': False, + 'supports_buffered_DO': False, + 'supports_semiperiod_measurement': False, + 'supports_simultaneous_AI_sampling': True, +} + + +class NI_PXIe_4499(NI_DAQmx): + description = 'NI-PXIe-4499' + + def __init__(self, *args, **kwargs): + """Class for NI-PXIe-4499""" + # Any provided kwargs take precedent over capabilities + combined_kwargs = CAPABILITIES.copy() + combined_kwargs.update(kwargs) + NI_DAQmx.__init__(self, *args, **combined_kwargs) diff --git a/labscript_devices/NI_DAQmx/models/NI_PXIe_6361.py b/labscript_devices/NI_DAQmx/models/NI_PXIe_6361.py index 7b88180a..1b33db33 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PXIe_6361.py +++ b/labscript_devices/NI_DAQmx/models/NI_PXIe_6361.py @@ -25,7 +25,27 @@ #: CAPABILITIES = { 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], 'AI_start_delay': 7e-08, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'NRSE', 'Diff'], + 'ai1': ['RSE', 'NRSE', 'Diff'], + 'ai10': ['RSE', 'NRSE'], + 'ai11': ['RSE', 'NRSE'], + 'ai12': ['RSE', 'NRSE'], + 'ai13': ['RSE', 'NRSE'], + 'ai14': ['RSE', 'NRSE'], + 'ai15': ['RSE', 'NRSE'], + 'ai2': ['RSE', 'NRSE', 'Diff'], + 'ai3': ['RSE', 'NRSE', 'Diff'], + 'ai4': ['RSE', 'NRSE', 'Diff'], + 'ai5': ['RSE', 'NRSE', 'Diff'], + 'ai6': ['RSE', 'NRSE', 'Diff'], + 'ai7': ['RSE', 'NRSE', 'Diff'], + 'ai8': ['RSE', 'NRSE'], + 'ai9': ['RSE', 'NRSE'], + }, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': 1000000.0, 'max_AI_single_chan_rate': 2000000.0, @@ -43,6 +63,7 @@ 'supports_buffered_AO': True, 'supports_buffered_DO': True, 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': False, } diff --git a/labscript_devices/NI_DAQmx/models/NI_PXIe_6363.py b/labscript_devices/NI_DAQmx/models/NI_PXIe_6363.py new file mode 100644 index 00000000..1624350a --- /dev/null +++ b/labscript_devices/NI_DAQmx/models/NI_PXIe_6363.py @@ -0,0 +1,94 @@ +##################################################################### +# # +# /NI_DAQmx/models/_subclass_template.py # +# # +# Copyright 2018, Christopher Billington # +# # +# This file is part of the module labscript_devices, in the # +# labscript suite (see http://labscriptsuite.org), and is # +# licensed under the Simplified BSD License. See the license.txt # +# file in the root of the project for the full license. # +# # +##################################################################### + +##################################################################### +# WARNING # +# # +# This file is auto-generated, any modifications may be # +# overwritten. See README.txt in this folder for details # +# # +##################################################################### + + +from labscript_devices.NI_DAQmx.labscript_devices import NI_DAQmx + +#: +CAPABILITIES = { + 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], + 'AI_start_delay': 7e-08, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'NRSE', 'Diff'], + 'ai1': ['RSE', 'NRSE', 'Diff'], + 'ai10': ['RSE', 'NRSE'], + 'ai11': ['RSE', 'NRSE'], + 'ai12': ['RSE', 'NRSE'], + 'ai13': ['RSE', 'NRSE'], + 'ai14': ['RSE', 'NRSE'], + 'ai15': ['RSE', 'NRSE'], + 'ai16': ['RSE', 'NRSE', 'Diff'], + 'ai17': ['RSE', 'NRSE', 'Diff'], + 'ai18': ['RSE', 'NRSE', 'Diff'], + 'ai19': ['RSE', 'NRSE', 'Diff'], + 'ai2': ['RSE', 'NRSE', 'Diff'], + 'ai20': ['RSE', 'NRSE', 'Diff'], + 'ai21': ['RSE', 'NRSE', 'Diff'], + 'ai22': ['RSE', 'NRSE', 'Diff'], + 'ai23': ['RSE', 'NRSE', 'Diff'], + 'ai24': ['RSE', 'NRSE'], + 'ai25': ['RSE', 'NRSE'], + 'ai26': ['RSE', 'NRSE'], + 'ai27': ['RSE', 'NRSE'], + 'ai28': ['RSE', 'NRSE'], + 'ai29': ['RSE', 'NRSE'], + 'ai3': ['RSE', 'NRSE', 'Diff'], + 'ai30': ['RSE', 'NRSE'], + 'ai31': ['RSE', 'NRSE'], + 'ai4': ['RSE', 'NRSE', 'Diff'], + 'ai5': ['RSE', 'NRSE', 'Diff'], + 'ai6': ['RSE', 'NRSE', 'Diff'], + 'ai7': ['RSE', 'NRSE', 'Diff'], + 'ai8': ['RSE', 'NRSE'], + 'ai9': ['RSE', 'NRSE'], + }, + 'AO_range': [-10.0, 10.0], + 'max_AI_multi_chan_rate': 1000000.0, + 'max_AI_single_chan_rate': 2000000.0, + 'max_AO_sample_rate': 2857142.8571428573, + 'max_DO_sample_rate': 10000000.0, + 'min_semiperiod_measurement': 1e-07, + 'num_AI': 32, + 'num_AO': 4, + 'num_CI': 4, + 'ports': { + 'port0': {'num_lines': 32, 'supports_buffered': True}, + 'port1': {'num_lines': 8, 'supports_buffered': False}, + 'port2': {'num_lines': 8, 'supports_buffered': False}, + }, + 'supports_buffered_AO': True, + 'supports_buffered_DO': True, + 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': False, +} + + +class NI_PXIe_6363(NI_DAQmx): + description = 'NI-PXIe-6363' + + def __init__(self, *args, **kwargs): + """Class for NI-PXIe-6363""" + # Any provided kwargs take precedent over capabilities + combined_kwargs = CAPABILITIES.copy() + combined_kwargs.update(kwargs) + NI_DAQmx.__init__(self, *args, **combined_kwargs) diff --git a/labscript_devices/NI_DAQmx/models/NI_PXIe_6535.py b/labscript_devices/NI_DAQmx/models/NI_PXIe_6535.py index a71a4322..192ba41d 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PXIe_6535.py +++ b/labscript_devices/NI_DAQmx/models/NI_PXIe_6535.py @@ -25,6 +25,7 @@ #: CAPABILITIES = { 'AI_range': None, + 'AI_range_Diff': None, 'AI_start_delay': None, 'AO_range': None, 'max_AI_multi_chan_rate': None, diff --git a/labscript_devices/NI_DAQmx/models/NI_PXIe_6738.py b/labscript_devices/NI_DAQmx/models/NI_PXIe_6738.py index 10b93ec5..713d1faf 100644 --- a/labscript_devices/NI_DAQmx/models/NI_PXIe_6738.py +++ b/labscript_devices/NI_DAQmx/models/NI_PXIe_6738.py @@ -25,6 +25,7 @@ #: CAPABILITIES = { 'AI_range': None, + 'AI_range_Diff': None, 'AI_start_delay': None, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': None, diff --git a/labscript_devices/NI_DAQmx/models/NI_USB_6008.py b/labscript_devices/NI_DAQmx/models/NI_USB_6008.py index 4a0b4714..c49532fc 100644 --- a/labscript_devices/NI_DAQmx/models/NI_USB_6008.py +++ b/labscript_devices/NI_DAQmx/models/NI_USB_6008.py @@ -25,7 +25,19 @@ #: CAPABILITIES = { 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-20.0, 20.0], 'AI_start_delay': 8.333333333333334e-08, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'Diff'], + 'ai1': ['RSE', 'Diff'], + 'ai2': ['RSE', 'Diff'], + 'ai3': ['RSE', 'Diff'], + 'ai4': ['RSE'], + 'ai5': ['RSE'], + 'ai6': ['RSE'], + 'ai7': ['RSE'], + }, 'AO_range': [0.0, 5.0], 'max_AI_multi_chan_rate': 10000.0, 'max_AI_single_chan_rate': 10000.0, @@ -42,6 +54,7 @@ 'supports_buffered_AO': False, 'supports_buffered_DO': False, 'supports_semiperiod_measurement': False, + 'supports_simultaneous_AI_sampling': False, } diff --git a/labscript_devices/NI_DAQmx/models/NI_USB_6229.py b/labscript_devices/NI_DAQmx/models/NI_USB_6229.py index b17bf1b5..8ab86756 100644 --- a/labscript_devices/NI_DAQmx/models/NI_USB_6229.py +++ b/labscript_devices/NI_DAQmx/models/NI_USB_6229.py @@ -25,7 +25,43 @@ #: CAPABILITIES = { 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], 'AI_start_delay': 2.5e-07, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'NRSE', 'Diff'], + 'ai1': ['RSE', 'NRSE', 'Diff'], + 'ai10': ['RSE', 'NRSE'], + 'ai11': ['RSE', 'NRSE'], + 'ai12': ['RSE', 'NRSE'], + 'ai13': ['RSE', 'NRSE'], + 'ai14': ['RSE', 'NRSE'], + 'ai15': ['RSE', 'NRSE'], + 'ai16': ['RSE', 'NRSE', 'Diff'], + 'ai17': ['RSE', 'NRSE', 'Diff'], + 'ai18': ['RSE', 'NRSE', 'Diff'], + 'ai19': ['RSE', 'NRSE', 'Diff'], + 'ai2': ['RSE', 'NRSE', 'Diff'], + 'ai20': ['RSE', 'NRSE', 'Diff'], + 'ai21': ['RSE', 'NRSE', 'Diff'], + 'ai22': ['RSE', 'NRSE', 'Diff'], + 'ai23': ['RSE', 'NRSE', 'Diff'], + 'ai24': ['RSE', 'NRSE'], + 'ai25': ['RSE', 'NRSE'], + 'ai26': ['RSE', 'NRSE'], + 'ai27': ['RSE', 'NRSE'], + 'ai28': ['RSE', 'NRSE'], + 'ai29': ['RSE', 'NRSE'], + 'ai3': ['RSE', 'NRSE', 'Diff'], + 'ai30': ['RSE', 'NRSE'], + 'ai31': ['RSE', 'NRSE'], + 'ai4': ['RSE', 'NRSE', 'Diff'], + 'ai5': ['RSE', 'NRSE', 'Diff'], + 'ai6': ['RSE', 'NRSE', 'Diff'], + 'ai7': ['RSE', 'NRSE', 'Diff'], + 'ai8': ['RSE', 'NRSE'], + 'ai9': ['RSE', 'NRSE'], + }, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': 250000.0, 'max_AI_single_chan_rate': 250000.0, @@ -43,6 +79,7 @@ 'supports_buffered_AO': True, 'supports_buffered_DO': True, 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': False, } diff --git a/labscript_devices/NI_DAQmx/models/NI_USB_6343.py b/labscript_devices/NI_DAQmx/models/NI_USB_6343.py index 1d38e471..7279fac2 100644 --- a/labscript_devices/NI_DAQmx/models/NI_USB_6343.py +++ b/labscript_devices/NI_DAQmx/models/NI_USB_6343.py @@ -25,7 +25,43 @@ #: CAPABILITIES = { 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], 'AI_start_delay': 7e-08, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'NRSE', 'Diff'], + 'ai1': ['RSE', 'NRSE', 'Diff'], + 'ai10': ['RSE', 'NRSE'], + 'ai11': ['RSE', 'NRSE'], + 'ai12': ['RSE', 'NRSE'], + 'ai13': ['RSE', 'NRSE'], + 'ai14': ['RSE', 'NRSE'], + 'ai15': ['RSE', 'NRSE'], + 'ai16': ['RSE', 'NRSE', 'Diff'], + 'ai17': ['RSE', 'NRSE', 'Diff'], + 'ai18': ['RSE', 'NRSE', 'Diff'], + 'ai19': ['RSE', 'NRSE', 'Diff'], + 'ai2': ['RSE', 'NRSE', 'Diff'], + 'ai20': ['RSE', 'NRSE', 'Diff'], + 'ai21': ['RSE', 'NRSE', 'Diff'], + 'ai22': ['RSE', 'NRSE', 'Diff'], + 'ai23': ['RSE', 'NRSE', 'Diff'], + 'ai24': ['RSE', 'NRSE'], + 'ai25': ['RSE', 'NRSE'], + 'ai26': ['RSE', 'NRSE'], + 'ai27': ['RSE', 'NRSE'], + 'ai28': ['RSE', 'NRSE'], + 'ai29': ['RSE', 'NRSE'], + 'ai3': ['RSE', 'NRSE', 'Diff'], + 'ai30': ['RSE', 'NRSE'], + 'ai31': ['RSE', 'NRSE'], + 'ai4': ['RSE', 'NRSE', 'Diff'], + 'ai5': ['RSE', 'NRSE', 'Diff'], + 'ai6': ['RSE', 'NRSE', 'Diff'], + 'ai7': ['RSE', 'NRSE', 'Diff'], + 'ai8': ['RSE', 'NRSE'], + 'ai9': ['RSE', 'NRSE'], + }, 'AO_range': [-10.0, 10.0], 'max_AI_multi_chan_rate': 500000.0, 'max_AI_single_chan_rate': 500000.0, @@ -43,6 +79,7 @@ 'supports_buffered_AO': True, 'supports_buffered_DO': True, 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': False, } diff --git a/labscript_devices/NI_DAQmx/models/NI_USB_6363.py b/labscript_devices/NI_DAQmx/models/NI_USB_6363.py new file mode 100644 index 00000000..45ae6cbf --- /dev/null +++ b/labscript_devices/NI_DAQmx/models/NI_USB_6363.py @@ -0,0 +1,94 @@ +##################################################################### +# # +# /NI_DAQmx/models/_subclass_template.py # +# # +# Copyright 2018, Christopher Billington # +# # +# This file is part of the module labscript_devices, in the # +# labscript suite (see http://labscriptsuite.org), and is # +# licensed under the Simplified BSD License. See the license.txt # +# file in the root of the project for the full license. # +# # +##################################################################### + +##################################################################### +# WARNING # +# # +# This file is auto-generated, any modifications may be # +# overwritten. See README.txt in this folder for details # +# # +##################################################################### + + +from labscript_devices.NI_DAQmx.labscript_devices import NI_DAQmx + +#: +CAPABILITIES = { + 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], + 'AI_start_delay': 7e-08, + 'AI_term': 'RSE', + 'AI_term_cfg': { + 'ai0': ['RSE', 'NRSE', 'Diff'], + 'ai1': ['RSE', 'NRSE', 'Diff'], + 'ai10': ['RSE', 'NRSE'], + 'ai11': ['RSE', 'NRSE'], + 'ai12': ['RSE', 'NRSE'], + 'ai13': ['RSE', 'NRSE'], + 'ai14': ['RSE', 'NRSE'], + 'ai15': ['RSE', 'NRSE'], + 'ai16': ['RSE', 'NRSE', 'Diff'], + 'ai17': ['RSE', 'NRSE', 'Diff'], + 'ai18': ['RSE', 'NRSE', 'Diff'], + 'ai19': ['RSE', 'NRSE', 'Diff'], + 'ai2': ['RSE', 'NRSE', 'Diff'], + 'ai20': ['RSE', 'NRSE', 'Diff'], + 'ai21': ['RSE', 'NRSE', 'Diff'], + 'ai22': ['RSE', 'NRSE', 'Diff'], + 'ai23': ['RSE', 'NRSE', 'Diff'], + 'ai24': ['RSE', 'NRSE'], + 'ai25': ['RSE', 'NRSE'], + 'ai26': ['RSE', 'NRSE'], + 'ai27': ['RSE', 'NRSE'], + 'ai28': ['RSE', 'NRSE'], + 'ai29': ['RSE', 'NRSE'], + 'ai3': ['RSE', 'NRSE', 'Diff'], + 'ai30': ['RSE', 'NRSE'], + 'ai31': ['RSE', 'NRSE'], + 'ai4': ['RSE', 'NRSE', 'Diff'], + 'ai5': ['RSE', 'NRSE', 'Diff'], + 'ai6': ['RSE', 'NRSE', 'Diff'], + 'ai7': ['RSE', 'NRSE', 'Diff'], + 'ai8': ['RSE', 'NRSE'], + 'ai9': ['RSE', 'NRSE'], + }, + 'AO_range': [-10.0, 10.0], + 'max_AI_multi_chan_rate': 1000000.0, + 'max_AI_single_chan_rate': 2000000.0, + 'max_AO_sample_rate': 2857142.8571428573, + 'max_DO_sample_rate': 10000000.0, + 'min_semiperiod_measurement': 1e-07, + 'num_AI': 32, + 'num_AO': 4, + 'num_CI': 4, + 'ports': { + 'port0': {'num_lines': 32, 'supports_buffered': True}, + 'port1': {'num_lines': 8, 'supports_buffered': False}, + 'port2': {'num_lines': 8, 'supports_buffered': False}, + }, + 'supports_buffered_AO': True, + 'supports_buffered_DO': True, + 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': False, +} + + +class NI_USB_6363(NI_DAQmx): + description = 'NI-USB-6363' + + def __init__(self, *args, **kwargs): + """Class for NI-USB-6363""" + # Any provided kwargs take precedent over capabilities + combined_kwargs = CAPABILITIES.copy() + combined_kwargs.update(kwargs) + NI_DAQmx.__init__(self, *args, **combined_kwargs) diff --git a/labscript_devices/NI_DAQmx/models/NI_USB_6366.py b/labscript_devices/NI_DAQmx/models/NI_USB_6366.py new file mode 100644 index 00000000..8ed566ff --- /dev/null +++ b/labscript_devices/NI_DAQmx/models/NI_USB_6366.py @@ -0,0 +1,70 @@ +##################################################################### +# # +# /NI_DAQmx/models/_subclass_template.py # +# # +# Copyright 2018, Christopher Billington # +# # +# This file is part of the module labscript_devices, in the # +# labscript suite (see http://labscriptsuite.org), and is # +# licensed under the Simplified BSD License. See the license.txt # +# file in the root of the project for the full license. # +# # +##################################################################### + +##################################################################### +# WARNING # +# # +# This file is auto-generated, any modifications may be # +# overwritten. See README.txt in this folder for details # +# # +##################################################################### + + +from labscript_devices.NI_DAQmx.labscript_devices import NI_DAQmx + +#: +CAPABILITIES = { + 'AI_range': [-10.0, 10.0], + 'AI_range_Diff': [-10.0, 10.0], + 'AI_start_delay': 4e-08, + 'AI_term': 'Diff', + 'AI_term_cfg': { + 'ai0': ['Diff'], + 'ai1': ['Diff'], + 'ai2': ['Diff'], + 'ai3': ['Diff'], + 'ai4': ['Diff'], + 'ai5': ['Diff'], + 'ai6': ['Diff'], + 'ai7': ['Diff'], + }, + 'AO_range': [-10.0, 10.0], + 'max_AI_multi_chan_rate': 2000000.0, + 'max_AI_single_chan_rate': 2000000.0, + 'max_AO_sample_rate': 3333333.3333333335, + 'max_DO_sample_rate': 10000000.0, + 'min_semiperiod_measurement': 1e-07, + 'num_AI': 8, + 'num_AO': 2, + 'num_CI': 4, + 'ports': { + 'port0': {'num_lines': 8, 'supports_buffered': True}, + 'port1': {'num_lines': 8, 'supports_buffered': False}, + 'port2': {'num_lines': 8, 'supports_buffered': False}, + }, + 'supports_buffered_AO': True, + 'supports_buffered_DO': True, + 'supports_semiperiod_measurement': True, + 'supports_simultaneous_AI_sampling': True, +} + + +class NI_USB_6366(NI_DAQmx): + description = 'NI-USB-6366' + + def __init__(self, *args, **kwargs): + """Class for NI-USB-6366""" + # Any provided kwargs take precedent over capabilities + combined_kwargs = CAPABILITIES.copy() + combined_kwargs.update(kwargs) + NI_DAQmx.__init__(self, *args, **combined_kwargs) diff --git a/labscript_devices/NI_DAQmx/models/capabilities.json b/labscript_devices/NI_DAQmx/models/capabilities.json index 2f34c1ea..ee5d34ca 100644 --- a/labscript_devices/NI_DAQmx/models/capabilities.json +++ b/labscript_devices/NI_DAQmx/models/capabilities.json @@ -4,7 +4,86 @@ -10.0, 10.0 ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], "AI_start_delay": 2.5e-07, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "NRSE", + "Diff" + ], + "ai1": [ + "RSE", + "NRSE", + "Diff" + ], + "ai10": [ + "RSE", + "NRSE" + ], + "ai11": [ + "RSE", + "NRSE" + ], + "ai12": [ + "RSE", + "NRSE" + ], + "ai13": [ + "RSE", + "NRSE" + ], + "ai14": [ + "RSE", + "NRSE" + ], + "ai15": [ + "RSE", + "NRSE" + ], + "ai2": [ + "RSE", + "NRSE", + "Diff" + ], + "ai3": [ + "RSE", + "NRSE", + "Diff" + ], + "ai4": [ + "RSE", + "NRSE", + "Diff" + ], + "ai5": [ + "RSE", + "NRSE", + "Diff" + ], + "ai6": [ + "RSE", + "NRSE", + "Diff" + ], + "ai7": [ + "RSE", + "NRSE", + "Diff" + ], + "ai8": [ + "RSE", + "NRSE" + ], + "ai9": [ + "RSE", + "NRSE" + ] + }, "AO_range": [ -10.0, 10.0 @@ -33,10 +112,12 @@ }, "supports_buffered_AO": true, "supports_buffered_DO": true, - "supports_semiperiod_measurement": true + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": false }, "PCI-6534": { "AI_range": null, + "AI_range_Diff": null, "AI_start_delay": null, "AO_range": null, "max_AI_multi_chan_rate": null, @@ -79,6 +160,7 @@ }, "PCI-6713": { "AI_range": null, + "AI_range_Diff": null, "AI_start_delay": null, "AO_range": [ -10.0, @@ -104,6 +186,7 @@ }, "PCI-6733": { "AI_range": null, + "AI_range_Diff": null, "AI_start_delay": null, "AO_range": [ -10.0, @@ -129,6 +212,7 @@ }, "PCI-DIO-32HS": { "AI_range": null, + "AI_range_Diff": null, "AI_start_delay": null, "AO_range": null, "max_AI_multi_chan_rate": null, @@ -169,12 +253,351 @@ "supports_buffered_DO": true, "supports_semiperiod_measurement": false }, + "PCIe-6343": { + "AI_range": [ + -10.0, + 10.0 + ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], + "AI_start_delay": 7e-08, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "NRSE", + "Diff" + ], + "ai1": [ + "RSE", + "NRSE", + "Diff" + ], + "ai10": [ + "RSE", + "NRSE" + ], + "ai11": [ + "RSE", + "NRSE" + ], + "ai12": [ + "RSE", + "NRSE" + ], + "ai13": [ + "RSE", + "NRSE" + ], + "ai14": [ + "RSE", + "NRSE" + ], + "ai15": [ + "RSE", + "NRSE" + ], + "ai16": [ + "RSE", + "NRSE", + "Diff" + ], + "ai17": [ + "RSE", + "NRSE", + "Diff" + ], + "ai18": [ + "RSE", + "NRSE", + "Diff" + ], + "ai19": [ + "RSE", + "NRSE", + "Diff" + ], + "ai2": [ + "RSE", + "NRSE", + "Diff" + ], + "ai20": [ + "RSE", + "NRSE", + "Diff" + ], + "ai21": [ + "RSE", + "NRSE", + "Diff" + ], + "ai22": [ + "RSE", + "NRSE", + "Diff" + ], + "ai23": [ + "RSE", + "NRSE", + "Diff" + ], + "ai24": [ + "RSE", + "NRSE" + ], + "ai25": [ + "RSE", + "NRSE" + ], + "ai26": [ + "RSE", + "NRSE" + ], + "ai27": [ + "RSE", + "NRSE" + ], + "ai28": [ + "RSE", + "NRSE" + ], + "ai29": [ + "RSE", + "NRSE" + ], + "ai3": [ + "RSE", + "NRSE", + "Diff" + ], + "ai30": [ + "RSE", + "NRSE" + ], + "ai31": [ + "RSE", + "NRSE" + ], + "ai4": [ + "RSE", + "NRSE", + "Diff" + ], + "ai5": [ + "RSE", + "NRSE", + "Diff" + ], + "ai6": [ + "RSE", + "NRSE", + "Diff" + ], + "ai7": [ + "RSE", + "NRSE", + "Diff" + ], + "ai8": [ + "RSE", + "NRSE" + ], + "ai9": [ + "RSE", + "NRSE" + ] + }, + "AO_range": [ + -10.0, + 10.0 + ], + "max_AI_multi_chan_rate": 500000.0, + "max_AI_single_chan_rate": 500000.0, + "max_AO_sample_rate": 917431.1926605505, + "max_DO_sample_rate": 1000000.0, + "min_semiperiod_measurement": 1e-07, + "num_AI": 32, + "num_AO": 4, + "num_CI": 4, + "ports": { + "port0": { + "num_lines": 32, + "supports_buffered": true + }, + "port1": { + "num_lines": 8, + "supports_buffered": false + }, + "port2": { + "num_lines": 8, + "supports_buffered": false + } + }, + "supports_buffered_AO": true, + "supports_buffered_DO": true, + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": false + }, "PCIe-6363": { "AI_range": [ -10.0, 10.0 ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], "AI_start_delay": 7e-08, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "NRSE", + "Diff" + ], + "ai1": [ + "RSE", + "NRSE", + "Diff" + ], + "ai10": [ + "RSE", + "NRSE" + ], + "ai11": [ + "RSE", + "NRSE" + ], + "ai12": [ + "RSE", + "NRSE" + ], + "ai13": [ + "RSE", + "NRSE" + ], + "ai14": [ + "RSE", + "NRSE" + ], + "ai15": [ + "RSE", + "NRSE" + ], + "ai16": [ + "RSE", + "NRSE", + "Diff" + ], + "ai17": [ + "RSE", + "NRSE", + "Diff" + ], + "ai18": [ + "RSE", + "NRSE", + "Diff" + ], + "ai19": [ + "RSE", + "NRSE", + "Diff" + ], + "ai2": [ + "RSE", + "NRSE", + "Diff" + ], + "ai20": [ + "RSE", + "NRSE", + "Diff" + ], + "ai21": [ + "RSE", + "NRSE", + "Diff" + ], + "ai22": [ + "RSE", + "NRSE", + "Diff" + ], + "ai23": [ + "RSE", + "NRSE", + "Diff" + ], + "ai24": [ + "RSE", + "NRSE" + ], + "ai25": [ + "RSE", + "NRSE" + ], + "ai26": [ + "RSE", + "NRSE" + ], + "ai27": [ + "RSE", + "NRSE" + ], + "ai28": [ + "RSE", + "NRSE" + ], + "ai29": [ + "RSE", + "NRSE" + ], + "ai3": [ + "RSE", + "NRSE", + "Diff" + ], + "ai30": [ + "RSE", + "NRSE" + ], + "ai31": [ + "RSE", + "NRSE" + ], + "ai4": [ + "RSE", + "NRSE", + "Diff" + ], + "ai5": [ + "RSE", + "NRSE", + "Diff" + ], + "ai6": [ + "RSE", + "NRSE", + "Diff" + ], + "ai7": [ + "RSE", + "NRSE", + "Diff" + ], + "ai8": [ + "RSE", + "NRSE" + ], + "ai9": [ + "RSE", + "NRSE" + ] + }, "AO_range": [ -10.0, 10.0 @@ -203,10 +626,12 @@ }, "supports_buffered_AO": true, "supports_buffered_DO": true, - "supports_semiperiod_measurement": true + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": false }, "PCIe-6738": { "AI_range": null, + "AI_range_Diff": null, "AI_start_delay": null, "AO_range": [ -10.0, @@ -236,6 +661,7 @@ }, "PXI-6733": { "AI_range": null, + "AI_range_Diff": null, "AI_start_delay": null, "AO_range": [ -10.0, @@ -259,12 +685,168 @@ "supports_buffered_DO": true, "supports_semiperiod_measurement": true }, + "PXIe-4499": { + "AI_range": [ + -10.0, + 10.0 + ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], + "AI_start_delay": null, + "AI_start_delay_ticks": 64, + "AI_term": "PseudoDiff", + "AI_term_cfg": { + "ai0": [ + "PseudoDiff" + ], + "ai1": [ + "PseudoDiff" + ], + "ai10": [ + "PseudoDiff" + ], + "ai11": [ + "PseudoDiff" + ], + "ai12": [ + "PseudoDiff" + ], + "ai13": [ + "PseudoDiff" + ], + "ai14": [ + "PseudoDiff" + ], + "ai15": [ + "PseudoDiff" + ], + "ai2": [ + "PseudoDiff" + ], + "ai3": [ + "PseudoDiff" + ], + "ai4": [ + "PseudoDiff" + ], + "ai5": [ + "PseudoDiff" + ], + "ai6": [ + "PseudoDiff" + ], + "ai7": [ + "PseudoDiff" + ], + "ai8": [ + "PseudoDiff" + ], + "ai9": [ + "PseudoDiff" + ] + }, + "AO_range": null, + "max_AI_multi_chan_rate": 204800.0, + "max_AI_single_chan_rate": 204800.0, + "max_AO_sample_rate": null, + "max_DO_sample_rate": null, + "min_semiperiod_measurement": null, + "num_AI": 16, + "num_AO": 0, + "num_CI": 0, + "ports": {}, + "supports_buffered_AO": false, + "supports_buffered_DO": false, + "supports_semiperiod_measurement": false, + "supports_simultaneous_AI_sampling": true + }, "PXIe-6361": { "AI_range": [ -10.0, 10.0 ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], "AI_start_delay": 7e-08, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "NRSE", + "Diff" + ], + "ai1": [ + "RSE", + "NRSE", + "Diff" + ], + "ai10": [ + "RSE", + "NRSE" + ], + "ai11": [ + "RSE", + "NRSE" + ], + "ai12": [ + "RSE", + "NRSE" + ], + "ai13": [ + "RSE", + "NRSE" + ], + "ai14": [ + "RSE", + "NRSE" + ], + "ai15": [ + "RSE", + "NRSE" + ], + "ai2": [ + "RSE", + "NRSE", + "Diff" + ], + "ai3": [ + "RSE", + "NRSE", + "Diff" + ], + "ai4": [ + "RSE", + "NRSE", + "Diff" + ], + "ai5": [ + "RSE", + "NRSE", + "Diff" + ], + "ai6": [ + "RSE", + "NRSE", + "Diff" + ], + "ai7": [ + "RSE", + "NRSE", + "Diff" + ], + "ai8": [ + "RSE", + "NRSE" + ], + "ai9": [ + "RSE", + "NRSE" + ] + }, "AO_range": [ -10.0, 10.0 @@ -293,10 +875,200 @@ }, "supports_buffered_AO": true, "supports_buffered_DO": true, - "supports_semiperiod_measurement": true + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": false + }, + "PXIe-6363": { + "AI_range": [ + -10.0, + 10.0 + ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], + "AI_start_delay": 7e-08, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "NRSE", + "Diff" + ], + "ai1": [ + "RSE", + "NRSE", + "Diff" + ], + "ai10": [ + "RSE", + "NRSE" + ], + "ai11": [ + "RSE", + "NRSE" + ], + "ai12": [ + "RSE", + "NRSE" + ], + "ai13": [ + "RSE", + "NRSE" + ], + "ai14": [ + "RSE", + "NRSE" + ], + "ai15": [ + "RSE", + "NRSE" + ], + "ai16": [ + "RSE", + "NRSE", + "Diff" + ], + "ai17": [ + "RSE", + "NRSE", + "Diff" + ], + "ai18": [ + "RSE", + "NRSE", + "Diff" + ], + "ai19": [ + "RSE", + "NRSE", + "Diff" + ], + "ai2": [ + "RSE", + "NRSE", + "Diff" + ], + "ai20": [ + "RSE", + "NRSE", + "Diff" + ], + "ai21": [ + "RSE", + "NRSE", + "Diff" + ], + "ai22": [ + "RSE", + "NRSE", + "Diff" + ], + "ai23": [ + "RSE", + "NRSE", + "Diff" + ], + "ai24": [ + "RSE", + "NRSE" + ], + "ai25": [ + "RSE", + "NRSE" + ], + "ai26": [ + "RSE", + "NRSE" + ], + "ai27": [ + "RSE", + "NRSE" + ], + "ai28": [ + "RSE", + "NRSE" + ], + "ai29": [ + "RSE", + "NRSE" + ], + "ai3": [ + "RSE", + "NRSE", + "Diff" + ], + "ai30": [ + "RSE", + "NRSE" + ], + "ai31": [ + "RSE", + "NRSE" + ], + "ai4": [ + "RSE", + "NRSE", + "Diff" + ], + "ai5": [ + "RSE", + "NRSE", + "Diff" + ], + "ai6": [ + "RSE", + "NRSE", + "Diff" + ], + "ai7": [ + "RSE", + "NRSE", + "Diff" + ], + "ai8": [ + "RSE", + "NRSE" + ], + "ai9": [ + "RSE", + "NRSE" + ] + }, + "AO_range": [ + -10.0, + 10.0 + ], + "max_AI_multi_chan_rate": 1000000.0, + "max_AI_single_chan_rate": 2000000.0, + "max_AO_sample_rate": 2857142.8571428573, + "max_DO_sample_rate": 10000000.0, + "min_semiperiod_measurement": 1e-07, + "num_AI": 32, + "num_AO": 4, + "num_CI": 4, + "ports": { + "port0": { + "num_lines": 32, + "supports_buffered": true + }, + "port1": { + "num_lines": 8, + "supports_buffered": false + }, + "port2": { + "num_lines": 8, + "supports_buffered": false + } + }, + "supports_buffered_AO": true, + "supports_buffered_DO": true, + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": false }, "PXIe-6535": { "AI_range": null, + "AI_range_Diff": null, "AI_start_delay": null, "AO_range": null, "max_AI_multi_chan_rate": null, @@ -335,6 +1107,7 @@ }, "PXIe-6738": { "AI_range": null, + "AI_range_Diff": null, "AI_start_delay": null, "AO_range": [ -10.0, @@ -367,7 +1140,42 @@ -10.0, 10.0 ], + "AI_range_Diff": [ + -20.0, + 20.0 + ], "AI_start_delay": 8.333333333333334e-08, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "Diff" + ], + "ai1": [ + "RSE", + "Diff" + ], + "ai2": [ + "RSE", + "Diff" + ], + "ai3": [ + "RSE", + "Diff" + ], + "ai4": [ + "RSE" + ], + "ai5": [ + "RSE" + ], + "ai6": [ + "RSE" + ], + "ai7": [ + "RSE" + ] + }, "AO_range": [ 0.0, 5.0 @@ -392,14 +1200,166 @@ }, "supports_buffered_AO": false, "supports_buffered_DO": false, - "supports_semiperiod_measurement": false + "supports_semiperiod_measurement": false, + "supports_simultaneous_AI_sampling": false }, "USB-6229": { "AI_range": [ -10.0, 10.0 ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], "AI_start_delay": 2.5e-07, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "NRSE", + "Diff" + ], + "ai1": [ + "RSE", + "NRSE", + "Diff" + ], + "ai10": [ + "RSE", + "NRSE" + ], + "ai11": [ + "RSE", + "NRSE" + ], + "ai12": [ + "RSE", + "NRSE" + ], + "ai13": [ + "RSE", + "NRSE" + ], + "ai14": [ + "RSE", + "NRSE" + ], + "ai15": [ + "RSE", + "NRSE" + ], + "ai16": [ + "RSE", + "NRSE", + "Diff" + ], + "ai17": [ + "RSE", + "NRSE", + "Diff" + ], + "ai18": [ + "RSE", + "NRSE", + "Diff" + ], + "ai19": [ + "RSE", + "NRSE", + "Diff" + ], + "ai2": [ + "RSE", + "NRSE", + "Diff" + ], + "ai20": [ + "RSE", + "NRSE", + "Diff" + ], + "ai21": [ + "RSE", + "NRSE", + "Diff" + ], + "ai22": [ + "RSE", + "NRSE", + "Diff" + ], + "ai23": [ + "RSE", + "NRSE", + "Diff" + ], + "ai24": [ + "RSE", + "NRSE" + ], + "ai25": [ + "RSE", + "NRSE" + ], + "ai26": [ + "RSE", + "NRSE" + ], + "ai27": [ + "RSE", + "NRSE" + ], + "ai28": [ + "RSE", + "NRSE" + ], + "ai29": [ + "RSE", + "NRSE" + ], + "ai3": [ + "RSE", + "NRSE", + "Diff" + ], + "ai30": [ + "RSE", + "NRSE" + ], + "ai31": [ + "RSE", + "NRSE" + ], + "ai4": [ + "RSE", + "NRSE", + "Diff" + ], + "ai5": [ + "RSE", + "NRSE", + "Diff" + ], + "ai6": [ + "RSE", + "NRSE", + "Diff" + ], + "ai7": [ + "RSE", + "NRSE", + "Diff" + ], + "ai8": [ + "RSE", + "NRSE" + ], + "ai9": [ + "RSE", + "NRSE" + ] + }, "AO_range": [ -10.0, 10.0 @@ -428,14 +1388,166 @@ }, "supports_buffered_AO": true, "supports_buffered_DO": true, - "supports_semiperiod_measurement": true + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": false }, "USB-6343": { "AI_range": [ -10.0, 10.0 ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], "AI_start_delay": 7e-08, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "NRSE", + "Diff" + ], + "ai1": [ + "RSE", + "NRSE", + "Diff" + ], + "ai10": [ + "RSE", + "NRSE" + ], + "ai11": [ + "RSE", + "NRSE" + ], + "ai12": [ + "RSE", + "NRSE" + ], + "ai13": [ + "RSE", + "NRSE" + ], + "ai14": [ + "RSE", + "NRSE" + ], + "ai15": [ + "RSE", + "NRSE" + ], + "ai16": [ + "RSE", + "NRSE", + "Diff" + ], + "ai17": [ + "RSE", + "NRSE", + "Diff" + ], + "ai18": [ + "RSE", + "NRSE", + "Diff" + ], + "ai19": [ + "RSE", + "NRSE", + "Diff" + ], + "ai2": [ + "RSE", + "NRSE", + "Diff" + ], + "ai20": [ + "RSE", + "NRSE", + "Diff" + ], + "ai21": [ + "RSE", + "NRSE", + "Diff" + ], + "ai22": [ + "RSE", + "NRSE", + "Diff" + ], + "ai23": [ + "RSE", + "NRSE", + "Diff" + ], + "ai24": [ + "RSE", + "NRSE" + ], + "ai25": [ + "RSE", + "NRSE" + ], + "ai26": [ + "RSE", + "NRSE" + ], + "ai27": [ + "RSE", + "NRSE" + ], + "ai28": [ + "RSE", + "NRSE" + ], + "ai29": [ + "RSE", + "NRSE" + ], + "ai3": [ + "RSE", + "NRSE", + "Diff" + ], + "ai30": [ + "RSE", + "NRSE" + ], + "ai31": [ + "RSE", + "NRSE" + ], + "ai4": [ + "RSE", + "NRSE", + "Diff" + ], + "ai5": [ + "RSE", + "NRSE", + "Diff" + ], + "ai6": [ + "RSE", + "NRSE", + "Diff" + ], + "ai7": [ + "RSE", + "NRSE", + "Diff" + ], + "ai8": [ + "RSE", + "NRSE" + ], + "ai9": [ + "RSE", + "NRSE" + ] + }, "AO_range": [ -10.0, 10.0 @@ -464,6 +1576,263 @@ }, "supports_buffered_AO": true, "supports_buffered_DO": true, - "supports_semiperiod_measurement": true + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": false + }, + "USB-6363": { + "AI_range": [ + -10.0, + 10.0 + ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], + "AI_start_delay": 7e-08, + "AI_term": "RSE", + "AI_term_cfg": { + "ai0": [ + "RSE", + "NRSE", + "Diff" + ], + "ai1": [ + "RSE", + "NRSE", + "Diff" + ], + "ai10": [ + "RSE", + "NRSE" + ], + "ai11": [ + "RSE", + "NRSE" + ], + "ai12": [ + "RSE", + "NRSE" + ], + "ai13": [ + "RSE", + "NRSE" + ], + "ai14": [ + "RSE", + "NRSE" + ], + "ai15": [ + "RSE", + "NRSE" + ], + "ai16": [ + "RSE", + "NRSE", + "Diff" + ], + "ai17": [ + "RSE", + "NRSE", + "Diff" + ], + "ai18": [ + "RSE", + "NRSE", + "Diff" + ], + "ai19": [ + "RSE", + "NRSE", + "Diff" + ], + "ai2": [ + "RSE", + "NRSE", + "Diff" + ], + "ai20": [ + "RSE", + "NRSE", + "Diff" + ], + "ai21": [ + "RSE", + "NRSE", + "Diff" + ], + "ai22": [ + "RSE", + "NRSE", + "Diff" + ], + "ai23": [ + "RSE", + "NRSE", + "Diff" + ], + "ai24": [ + "RSE", + "NRSE" + ], + "ai25": [ + "RSE", + "NRSE" + ], + "ai26": [ + "RSE", + "NRSE" + ], + "ai27": [ + "RSE", + "NRSE" + ], + "ai28": [ + "RSE", + "NRSE" + ], + "ai29": [ + "RSE", + "NRSE" + ], + "ai3": [ + "RSE", + "NRSE", + "Diff" + ], + "ai30": [ + "RSE", + "NRSE" + ], + "ai31": [ + "RSE", + "NRSE" + ], + "ai4": [ + "RSE", + "NRSE", + "Diff" + ], + "ai5": [ + "RSE", + "NRSE", + "Diff" + ], + "ai6": [ + "RSE", + "NRSE", + "Diff" + ], + "ai7": [ + "RSE", + "NRSE", + "Diff" + ], + "ai8": [ + "RSE", + "NRSE" + ], + "ai9": [ + "RSE", + "NRSE" + ] + }, + "AO_range": [ + -10.0, + 10.0 + ], + "max_AI_multi_chan_rate": 1000000.0, + "max_AI_single_chan_rate": 2000000.0, + "max_AO_sample_rate": 2857142.8571428573, + "max_DO_sample_rate": 10000000.0, + "min_semiperiod_measurement": 1e-07, + "num_AI": 32, + "num_AO": 4, + "num_CI": 4, + "ports": { + "port0": { + "num_lines": 32, + "supports_buffered": true + }, + "port1": { + "num_lines": 8, + "supports_buffered": false + }, + "port2": { + "num_lines": 8, + "supports_buffered": false + } + }, + "supports_buffered_AO": true, + "supports_buffered_DO": true, + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": false + }, + "USB-6366": { + "AI_range": [ + -10.0, + 10.0 + ], + "AI_range_Diff": [ + -10.0, + 10.0 + ], + "AI_start_delay": 4e-08, + "AI_term": "Diff", + "AI_term_cfg": { + "ai0": [ + "Diff" + ], + "ai1": [ + "Diff" + ], + "ai2": [ + "Diff" + ], + "ai3": [ + "Diff" + ], + "ai4": [ + "Diff" + ], + "ai5": [ + "Diff" + ], + "ai6": [ + "Diff" + ], + "ai7": [ + "Diff" + ] + }, + "AO_range": [ + -10.0, + 10.0 + ], + "max_AI_multi_chan_rate": 2000000.0, + "max_AI_single_chan_rate": 2000000.0, + "max_AO_sample_rate": 3333333.3333333335, + "max_DO_sample_rate": 10000000.0, + "min_semiperiod_measurement": 1e-07, + "num_AI": 8, + "num_AO": 2, + "num_CI": 4, + "ports": { + "port0": { + "num_lines": 8, + "supports_buffered": true + }, + "port1": { + "num_lines": 8, + "supports_buffered": false + }, + "port2": { + "num_lines": 8, + "supports_buffered": false + } + }, + "supports_buffered_AO": true, + "supports_buffered_DO": true, + "supports_semiperiod_measurement": true, + "supports_simultaneous_AI_sampling": true } } \ No newline at end of file diff --git a/labscript_devices/NI_DAQmx/models/get_capabilities.py b/labscript_devices/NI_DAQmx/models/get_capabilities.py index acda3512..51fbe910 100644 --- a/labscript_devices/NI_DAQmx/models/get_capabilities.py +++ b/labscript_devices/NI_DAQmx/models/get_capabilities.py @@ -178,6 +178,8 @@ def wrapped2(name): DAQmxGetDevAIMaxMultiChanRate = float64_prop(PyDAQmx.DAQmxGetDevAIMaxMultiChanRate) DAQmxGetDevAOVoltageRngs = float64_array_prop(PyDAQmx.DAQmxGetDevAOVoltageRngs) DAQmxGetDevAIVoltageRngs = float64_array_prop(PyDAQmx.DAQmxGetDevAIVoltageRngs) +DAQmxGetPhysicalChanAITermCfgs = int32_prop(PyDAQmx.DAQmxGetPhysicalChanAITermCfgs) +DAQmxGetDevAISimultaneousSamplingSupported = bool_prop(PyDAQmx.DAQmxGetDevAISimultaneousSamplingSupported) def port_supports_buffered(device_name, port, clock_terminal=None): @@ -252,8 +254,15 @@ def AI_start_delay(device_name): Vmin, Vmax = DAQmxGetDevAIVoltageRngs(device_name)[0:2] num_samples = 1000 chan = device_name + '/ai0' + supp_types = DAQmxGetPhysicalChanAITermCfgs(chan) + if supp_types & c.DAQmx_Val_Bit_TermCfg_RSE: + input_type = c.DAQmx_Val_RSE + elif supp_types & c.DAQmx_Val_Bit_TermCfg_Diff: + input_type = c.DAQmx_Val_Diff + elif supp_types & c.DAQmx_Val_Bit_TermCfg_PseudoDIFF: + input_type = c.DAQmx_Val_PseudoDiff task.CreateAIVoltageChan( - chan, "", c.DAQmx_Val_RSE, Vmin, Vmax, c.DAQmx_Val_Volts, None + chan, "", input_type, Vmin, Vmax, c.DAQmx_Val_Volts, None ) task.CfgSampClkTiming( "", rate, c.DAQmx_Val_Rising, c.DAQmx_Val_ContSamps, num_samples @@ -264,8 +273,19 @@ def AI_start_delay(device_name): delay_from_sample_clock = float64() sample_timebase_rate = float64() - task.GetStartTrigDelay(start_trig_delay) - task.GetDelayFromSampClkDelay(delay_from_sample_clock) + try: + task.GetStartTrigDelay(start_trig_delay) + except PyDAQmx.DAQmxFunctions.AttributeNotSupportedInTaskContextError: + # device does not have a Start Trigger Delay property + # is likely a dynamic signal acquisition device with filter + # delays instead. + start_trig_delay.value = 0 + try: + task.GetDelayFromSampClkDelay(delay_from_sample_clock) + except PyDAQmx.DAQmxFunctions.AttributeNotSupportedInTaskContextError: + # seems simultaneous sampling devices do not have this property, + # so assume it is zero + delay_from_sample_clock.value = 0 task.GetSampClkTimebaseRate(sample_timebase_rate) task.ClearTask() @@ -275,12 +295,79 @@ def AI_start_delay(device_name): return total_delay_in_seconds +def AI_filter_delay(device_name): + """Determine the filter delay for dynamic signal acquistion devices. + + Returns the delay in clock cycles. Absolute delay will vary with sample rate. + + Args: + device_name (str): NI-MAX device name + + Returns: + int: Number of analog input delays ticks between task start and acquisition start. + """ + if 'PFI0' not in DAQmxGetDevTerminals(device_name): + return None + task = Task() + clock_terminal = '/' + device_name + '/PFI0' + rate = DAQmxGetDevAIMaxSingleChanRate(device_name) + Vmin, Vmax = DAQmxGetDevAIVoltageRngs(device_name)[0:2] + num_samples = 1000 + chan = device_name + '/ai0' + task.CreateAIVoltageChan( + chan, "", c.DAQmx_Val_PseudoDiff, Vmin, Vmax, c.DAQmx_Val_Volts, None + ) + task.CfgSampClkTiming( + "", rate, c.DAQmx_Val_Rising, c.DAQmx_Val_ContSamps, num_samples + ) + task.CfgDigEdgeStartTrig(clock_terminal, c.DAQmx_Val_Rising) + + start_filter_delay = float64() + sample_timebase_rate = float64() + + # get delay in number of clock samples + task.SetAIFilterDelayUnits("", c.DAQmx_Val_SampleClkPeriods) + + task.GetAIFilterDelay("", start_filter_delay) + task.GetSampClkTimebaseRate(sample_timebase_rate) + + task.ClearTask() + + return int(start_filter_delay.value) + + +def supported_AI_terminal_configurations(device_name): + """Determine which analong input configurations are supported for each AI. + + Valid options are RSE, NRSE, Diff, and PseudoDiff. + + Args: + device_name (str): NI-MAX device name + + Returns: + dict: + Dictionary of analog input channels where each value is a list of + the supported input terminations. + """ + supp_types = {} + poss_types = {'RSE': c.DAQmx_Val_Bit_TermCfg_RSE, + 'NRSE': c.DAQmx_Val_Bit_TermCfg_NRSE, + 'Diff': c.DAQmx_Val_Bit_TermCfg_Diff, + 'PseudoDiff': c.DAQmx_Val_Bit_TermCfg_PseudoDIFF} + chans = DAQmxGetDevAIPhysicalChans(device_name) + for chan in chans: + byte = DAQmxGetPhysicalChanAITermCfgs(device_name+'/'+chan) + chan_types = [key for key, val in poss_types.items() if val & byte] + supp_types[chan] = chan_types + + return supp_types + + def supported_AI_ranges_for_non_differential_input(device_name, AI_ranges): """Empirically determine the analog input voltage ranges for non-differential inputs. Tries AI ranges to see which are actually allowed for non-differential input, since - the largest range may only be available for differential input, which we don't - attempt to support (though we could with a little effort). + the largest range may only be available for differential input. Args: device_name (str): NI-MAX device name @@ -403,7 +490,8 @@ def get_min_semiperiod_measurement(device_name): models = [] for name in DAQmxGetSysDevNames().split(', '): - model = DAQmxGetDevProductType(name) + # ignore extra details in model names + model = DAQmxGetDevProductType(name).split(' ')[0] print("found device:", name, model) if model not in models: models.append(model) @@ -435,6 +523,16 @@ def get_min_semiperiod_measurement(device_name): multi_rate = None capabilities[model]["max_AI_single_chan_rate"] = single_rate capabilities[model]["max_AI_multi_chan_rate"] = multi_rate + if capabilities[model]["num_AI"] > 0: + capabilities[model]["AI_term_cfg"] = supported_AI_terminal_configurations(name) + cfgs = [item for sublist in capabilities[model]["AI_term_cfg"].values() for item in sublist] + if cfgs.count('RSE'): + capabilities[model]["AI_term"] = 'RSE' + elif cfgs.count('Diff'): + capabilities[model]["AI_term"] = 'Diff' + elif cfgs.count('PseudoDiff'): + capabilities[model]["AI_term"] = 'PseudoDiff' + capabilities[model]["supports_simultaneous_AI_sampling"] = DAQmxGetDevAISimultaneousSamplingSupported(name) capabilities[model]["ports"] = {} ports = DAQmxGetDevDOPorts(name) @@ -484,20 +582,30 @@ def get_min_semiperiod_measurement(device_name): for i in range(0, len(raw_limits), 2): Vmin, Vmax = raw_limits[i], raw_limits[i + 1] AI_ranges.append([Vmin, Vmax]) - # Restrict to the ranges allowed for non-differential input: - AI_ranges = supported_AI_ranges_for_non_differential_input(name, AI_ranges) # Find range with the largest maximum voltage and use that: - Vmin, Vmax = max(AI_ranges, key=lambda range: range[1]) + Vmin_raw, Vmax_raw = max(AI_ranges, key=lambda range: range[1]) # Confirm that no other range has a voltage lower than Vmin, # since if it does, this violates our assumptions and things might not # be as simple as having a single range: + assert min(AI_ranges)[0] >= Vmin_raw + capabilities[model]["AI_range_Diff"] = [Vmin_raw, Vmax_raw] + if 'RSE' in capabilities[model]["AI_term_cfg"]['ai0']: + # Now limit to non-differential inputs (if available), which may have lower ranges + AI_ranges = supported_AI_ranges_for_non_differential_input(name, AI_ranges) + # Find RSE range with the largest maximum voltage and use that: + Vmin, Vmax = max(AI_ranges, key=lambda range: range[1]) assert min(AI_ranges)[0] >= Vmin capabilities[model]["AI_range"] = [Vmin, Vmax] else: capabilities[model]["AI_range"] = None + capabilities[model]["AI_range_Diff"] = None if capabilities[model]["num_AI"] > 0: - capabilities[model]["AI_start_delay"] = AI_start_delay(name) + if capabilities[model]["AI_term"] == 'PseudoDiff': + capabilities[model]["AI_start_delay_ticks"] = AI_filter_delay(name) + capabilities[model]["AI_start_delay"] = None + else: + capabilities[model]["AI_start_delay"] = AI_start_delay(name) else: capabilities[model]["AI_start_delay"] = None