fluidlab.daq.daqmx

DAQmx (National Instruments, fluidlab.instruments.daq.daqmx)

Todo

DAQmx interface and drivers (using Comedi API?)…

Provides:

fluidlab.daq.daqmx.read_analog(resource_names, terminal_config, volt_min, volt_max, samples_per_chan=1, sample_rate=1, coupling_types='DC', output_filename=None, verbose=False)[source]

Read from the analog input subdevice.

Parameters:
resource_names: {str or iterable of str}

Analogic input identifier(s), e.g. ‘Dev1/ai0’.

terminal_config: {‘Diff’, ‘PseudoDiff’, ‘RSE’, ‘NRSE’}

A type of configuration (apply to all terminals).

volt_min{number or iterable of numbers}

Minima for the channels.

volt_max{number or iterable of numbers}

Maxima for the channels.

samples_per_chan: number

Number of samples per channel to read.

sample_rate: number

Sample rate for all channels (Hz).

coupling_types{‘DC’, ‘AC’, ‘GND’, list of str}

Type of coupling for each resource.

output_filename: {None, str}

If specified data is output into this file instead of output arrays.

verbose: {False, boolean}

If True, print more verbose message

fluidlab.daq.daqmx.write_analog(resource_names, sample_rate=1, volt_min=-10.0, volt_max=10.0, signals=None, blocking=True, verbose=False)[source]

Write analogic output

Parameters:
resource_name:

Analogic input identifier(s), e.g. ‘Dev1/ao0’.

sample_rate: number

Frequency rate for all channels (Hz).

volt_min: {number or iterable of numbers}

Minima for the channels

volt_max: {number or iterable of numbers}

Maxima for the channels

signals: numpy.ndarray or simple scalar

The signal(s) to be output.

blocking: bool

Specifies whether to wait until the task is done before returning. If blocking=false, then a task object is returned. To stop the task, use the write_analog_end_task() function.

fluidlab.daq.daqmx.write_analog_end_task(task, timeout=0.0)[source]

This function ends a writing task that has been created with blocking=False.

Parameters:
taskPyDAQmx.Task

The task to end.

timeoutnumber

Time (in s) to wait before stopping the task if it is not done.

fluidlab.daq.daqmx.measure_freq(resource_name, freq_min=1, freq_max=1000)[source]

Read analogic output

Parameters:
resource_name: str

Analogic input identifier, e.g. ‘Dev1/ctr0’.

freq_minnumber

The minimum frequency (Hz) that you expect to measure.

freq_maxnumber

The maximum frequency (Hz) that you expect to measure.

Functions

measure_freq(resource_name[, freq_min, freq_max])

Read analogic output

read_analog(resource_names, terminal_config, ...)

Read from the analog input subdevice.

write_analog(resource_names[, sample_rate, ...])

Write analogic output

write_analog_end_task(task[, timeout])

This function ends a writing task that has been created with blocking=False.