msl.equipment.connection_nidaq module

Uses NI-DAQ as the backend to communicate with the equipment.

class msl.equipment.connection_nidaq.ConnectionNIDAQ(record)[source]

Bases: Connection

Uses NI-DAQ to establish a connection to the equipment.

See the nidaqmx examples for how to use NI-DAQ.

The returned object from the connect() method is equivalent to importing the NI-DAQ package in your code. For example, this:

>>> nidaqmx = record.connect()
>>> with nidaqmx.Task() as task:
...     task.ai_channels.add_ai_voltage_chan('Dev1/ai0')
...     task.read()
...
-0.07476920729381246

is equivalent to:

>>> import nidaqmx
>>> with nidaqmx.Task() as task:
...     task.ai_channels.add_ai_voltage_chan('Dev1/ai0')
...     task.read()
...
-0.07476920729381246

The backend value must be equal to NIDAQ to use this class for the communication system. This is achieved by setting the value in the Backend field for a connection record in the Connections Database to be NIDAQ.

Do not instantiate this class directly. Use the connect() method to connect to the equipment.

Parameters

record (EquipmentRecord) – A record from an Equipment-Register Database.

property constants

Returns the nidaqmx.constants module.

property CtrFreq

Returns the CtrFreq class.

property CtrTick

Returns the CtrTick class.

property CtrTime

Returns the CtrTime class.

property DaqError

Returns the DaqError class.

property DaqResourceWarning

Returns the DaqResourceWarning class.

property DaqWarning

Returns the DaqWarning class.

property errors

Returns the nidaqmx.errors module.

property Scale

Returns the Scale class.

property stream_readers

Returns the nidaqmx.stream_readers module.

property stream_writers

Returns the nidaqmx.stream_writers module.

property system

Returns the nidaqmx.system module.

property Task

Returns the Task class.

property types

Returns the nidaqmx.types module.

property utils

Returns the nidaqmx.utils module.

property version

The NI-DAQmx driver version number.

Type

str