hardware - National Instruments

NIDAQmx object

class pymodaq_plugins_daqmx.hardware.national_instruments.daqmxni.NIDAQmx[source]

Bases: object

Wrapper around the NIDAQmx package giving an easy-to-use object to instantiate channels and tasks

__init__()[source]
close()[source]

close the current task.

configuration_sequence(viewer, current_device)[source]

Configure each / modules / channels as giver by the user in the configuration file

Read the .toml file to get the desired hardware configuration, and send the nidaqmx a sequence which set up each channel.

classmethod get_NIDAQ_channels(devices=None, source_type=None)[source]

Get the list of available channels for all NiDAq connected devices

Parameters

devices: list

list of strings, each one being a connected device

source_type: str

Channels possible types

Returns

List of str containing device and channel names

classmethod get_NIDAQ_devices()[source]

Get list of NI connected devices

Returns

list

list of devices as strings to be used in subsequent commands

refresh_hardware()[source]

Refresh the NIDAQ hardware from settings values.

See Also

update_NIDAQ_devices, update_NIDAQ_channels

NIDAQmx Base module

class pymodaq_plugins_daqmx.hardware.national_instruments.NIDAQmx_base.DAQ_NIDAQmx_base[source]

Bases: object

Base NIDAQmx class for using DAQmx objects from daqmxni.py in the DAQ_NIDAQmx_Move & DAQ_NIDAQmx_Viewer

__init__()[source]
commit_settings(param: Parameter)[source]

Activate the parameters changes in the hardware.

Parameters

Type

Description

param

instance of pyqtgraph.parameter

the parameter to activate

See Also

update_NIDAQ_channels, update_task, DAQ_NIDAQ_source, refresh_hardware

get_channels_from_settings()[source]

Browse the viewer settings to gather all the channels that will be used.

stop()[source]

Stop the acquisition.

update_task()[source]

Update task according to channels from settings.

class pymodaq_plugins_daqmx.hardware.national_instruments.NIDAQmx_base.ScalableGroupAI(**opts)[source]

Bases: GroupParameter

Generic parameter items holding Analog Input parameters

__init__(**opts)[source]

Initialize a Parameter object. Although it is rare to directly create a Parameter instance, the options available to this method are also allowed by most Parameter subclasses.

Keyword Arguments:

name

The name to give this Parameter. This is the name that will appear in the left-most column of a ParameterTree for this Parameter.

value

The value to initially assign to this Parameter.

default

The default value for this Parameter (most Parameters provide an option to ‘reset to default’).

children

A list of children for this Parameter. Children may be given either as a Parameter instance or as a dictionary to pass to Parameter.create(). In this way, it is possible to specify complex hierarchies of Parameters from a single nested data structure.

readonly

If True, the user will not be allowed to edit this Parameter. (default=False)

enabled

If False, any widget(s) for this parameter will appear disabled. (default=True)

visible

If False, the Parameter will not appear when displayed in a ParameterTree. (default=True)

renamable

If True, the user may rename this Parameter. (default=False)

removable

If True, the user may remove this Parameter. (default=False)

expanded

If True, the Parameter will initially be expanded in ParameterTrees: Its children will be visible. (default=True)

syncExpanded

If True, the expanded state of this Parameter is synchronized with all ParameterTrees it is displayed in. (default=False)

title

(str or None) If specified, then the parameter will be displayed to the user using this string as its name. However, the parameter will still be referred to internally using the name specified above. Note that this option is not compatible with renamable=True. (default=None; added in version 0.9.9)

addNew(typ=None)[source]

Add a child.

Parameters

Type

typ

string

class pymodaq_plugins_daqmx.hardware.national_instruments.NIDAQmx_base.ScalableGroupAO(**opts)[source]

Bases: GroupParameter

Generic parameter items holding Analog Output parameters

__init__(**opts)[source]

Initialize a Parameter object. Although it is rare to directly create a Parameter instance, the options available to this method are also allowed by most Parameter subclasses.

Keyword Arguments:

name

The name to give this Parameter. This is the name that will appear in the left-most column of a ParameterTree for this Parameter.

value

The value to initially assign to this Parameter.

default

The default value for this Parameter (most Parameters provide an option to ‘reset to default’).

children

A list of children for this Parameter. Children may be given either as a Parameter instance or as a dictionary to pass to Parameter.create(). In this way, it is possible to specify complex hierarchies of Parameters from a single nested data structure.

readonly

If True, the user will not be allowed to edit this Parameter. (default=False)

enabled

If False, any widget(s) for this parameter will appear disabled. (default=True)

visible

If False, the Parameter will not appear when displayed in a ParameterTree. (default=True)

renamable

If True, the user may rename this Parameter. (default=False)

removable

If True, the user may remove this Parameter. (default=False)

expanded

If True, the Parameter will initially be expanded in ParameterTrees: Its children will be visible. (default=True)

syncExpanded

If True, the expanded state of this Parameter is synchronized with all ParameterTrees it is displayed in. (default=False)

title

(str or None) If specified, then the parameter will be displayed to the user using this string as its name. However, the parameter will still be referred to internally using the name specified above. Note that this option is not compatible with renamable=True. (default=None; added in version 0.9.9)

addNew(typ=None)[source]

Add a child.

Parameters

Type

typ

string

class pymodaq_plugins_daqmx.hardware.national_instruments.NIDAQmx_base.ScalableGroupCounter(**opts)[source]

Bases: GroupParameter

Generic parameter items holding Counter parameters

__init__(**opts)[source]

Initialize a Parameter object. Although it is rare to directly create a Parameter instance, the options available to this method are also allowed by most Parameter subclasses.

Keyword Arguments:

name

The name to give this Parameter. This is the name that will appear in the left-most column of a ParameterTree for this Parameter.

value

The value to initially assign to this Parameter.

default

The default value for this Parameter (most Parameters provide an option to ‘reset to default’).

children

A list of children for this Parameter. Children may be given either as a Parameter instance or as a dictionary to pass to Parameter.create(). In this way, it is possible to specify complex hierarchies of Parameters from a single nested data structure.

readonly

If True, the user will not be allowed to edit this Parameter. (default=False)

enabled

If False, any widget(s) for this parameter will appear disabled. (default=True)

visible

If False, the Parameter will not appear when displayed in a ParameterTree. (default=True)

renamable

If True, the user may rename this Parameter. (default=False)

removable

If True, the user may remove this Parameter. (default=False)

expanded

If True, the Parameter will initially be expanded in ParameterTrees: Its children will be visible. (default=True)

syncExpanded

If True, the expanded state of this Parameter is synchronized with all ParameterTrees it is displayed in. (default=False)

title

(str or None) If specified, then the parameter will be displayed to the user using this string as its name. However, the parameter will still be referred to internally using the name specified above. Note that this option is not compatible with renamable=True. (default=None; added in version 0.9.9)

addNew(typ=None)[source]

Add a child.

Parameters

Type

typ

string

class pymodaq_plugins_daqmx.hardware.national_instruments.NIDAQmx_base.ScalableGroupDI(**opts)[source]

Bases: GroupParameter

Generic parameter items holding Digital Input parameters

__init__(**opts)[source]

Initialize a Parameter object. Although it is rare to directly create a Parameter instance, the options available to this method are also allowed by most Parameter subclasses.

Keyword Arguments:

name

The name to give this Parameter. This is the name that will appear in the left-most column of a ParameterTree for this Parameter.

value

The value to initially assign to this Parameter.

default

The default value for this Parameter (most Parameters provide an option to ‘reset to default’).

children

A list of children for this Parameter. Children may be given either as a Parameter instance or as a dictionary to pass to Parameter.create(). In this way, it is possible to specify complex hierarchies of Parameters from a single nested data structure.

readonly

If True, the user will not be allowed to edit this Parameter. (default=False)

enabled

If False, any widget(s) for this parameter will appear disabled. (default=True)

visible

If False, the Parameter will not appear when displayed in a ParameterTree. (default=True)

renamable

If True, the user may rename this Parameter. (default=False)

removable

If True, the user may remove this Parameter. (default=False)

expanded

If True, the Parameter will initially be expanded in ParameterTrees: Its children will be visible. (default=True)

syncExpanded

If True, the expanded state of this Parameter is synchronized with all ParameterTrees it is displayed in. (default=False)

title

(str or None) If specified, then the parameter will be displayed to the user using this string as its name. However, the parameter will still be referred to internally using the name specified above. Note that this option is not compatible with renamable=True. (default=None; added in version 0.9.9)

addNew(typ=None)[source]

Add a child.

Parameters

Type

typ

string

class pymodaq_plugins_daqmx.hardware.national_instruments.NIDAQmx_base.ScalableGroupDO(**opts)[source]

Bases: GroupParameter

Generic parameter items holding Digital Output parameters

__init__(**opts)[source]

Initialize a Parameter object. Although it is rare to directly create a Parameter instance, the options available to this method are also allowed by most Parameter subclasses.

Keyword Arguments:

name

The name to give this Parameter. This is the name that will appear in the left-most column of a ParameterTree for this Parameter.

value

The value to initially assign to this Parameter.

default

The default value for this Parameter (most Parameters provide an option to ‘reset to default’).

children

A list of children for this Parameter. Children may be given either as a Parameter instance or as a dictionary to pass to Parameter.create(). In this way, it is possible to specify complex hierarchies of Parameters from a single nested data structure.

readonly

If True, the user will not be allowed to edit this Parameter. (default=False)

enabled

If False, any widget(s) for this parameter will appear disabled. (default=True)

visible

If False, the Parameter will not appear when displayed in a ParameterTree. (default=True)

renamable

If True, the user may rename this Parameter. (default=False)

removable

If True, the user may remove this Parameter. (default=False)

expanded

If True, the Parameter will initially be expanded in ParameterTrees: Its children will be visible. (default=True)

syncExpanded

If True, the expanded state of this Parameter is synchronized with all ParameterTrees it is displayed in. (default=False)

title

(str or None) If specified, then the parameter will be displayed to the user using this string as its name. However, the parameter will still be referred to internally using the name specified above. Note that this option is not compatible with renamable=True. (default=None; added in version 0.9.9)

addNew(typ=None)[source]

Add a child.

Parameters

Type

typ

string

NIDAQmx Actuator module

class pymodaq_plugins_daqmx.hardware.national_instruments.NIDAQmx_Move.DAQ_NIDAQmx_Actuator(parent=None, params_state=None, control_type='Actuator')[source]

Bases: DAQ_Move_base, DAQ_NIDAQmx_base

Wrapper object to access the Mock fonctionnalities, similar wrapper for all controllers.

Attributes

Type

params

dictionnary

__init__(parent=None, params_state=None, control_type='Actuator')[source]
commit_settings(param)[source]
Activate any parameter changes on the PI_GCS2 hardware.

Called after a param_tree_changed signal from DAQ_Move_main.
get_actuator_value() → DataActuator[source]

Get the current position from the hardware with scaling conversion.

Returns

float: The position obtained after scaling conversion.

ini_stage(controller=None)[source]

Actuator communication initialization

Parameters

controller: (object) custom object of a PyMoDAQ plugin (Slave case). None if only one actuator by controller (Master case)

Returns

self.status (edict): with initialization status: three fields:
  • info (str)

  • controller (object) initialized controller

  • initialized: (bool): False if initialization failed otherwise True

move_Abs(position)[source]

Move the actuator to the absolute target defined by position

Parameters

position: (flaot) value of the absolute target positioning

move_Home()[source]
Send the update status thread command.

daq_utils.ThreadCommand

move_Rel(position)[source]

Move the actuator to the relative target actuator value defined by position

Parameters

position: (flaot) value of the relative target positioning

stop_motion()[source]

Call the specific move_done function (depending on the hardware).

See Also

move_done

NIDAQmx Viewer module

class pymodaq_plugins_daqmx.hardware.national_instruments.NIDAQmx_Viewer.DAQ_NIDAQmx_Viewer(parent=None, params_state=None, control_type='0D')[source]

Bases: DAQ_Viewer_base, DAQ_NIDAQmx_base

Attributes

Type

data_grabed_signal

instance of Signal

params

dictionary list

task

See Also

refresh_hardware

__init__(parent=None, params_state=None, control_type='0D')[source]
close()[source]

Mandatory To be reimplemented in subclass

commit_settings(param)[source]

Activate the parameters changes in the hardware.

Parameters

Type

Description

param

instance of pyqtgraph.parameter

the parameter to activate

See Also

update_NIDAQ_channels, update_task, refresh_hardware

get_max_frequency()[source]

Get the maximum frequency according to the material’s limits and display the information. This method is destined to be removed once set_max_frequency will work correctly.

ini_attributes()[source]

To be reimplemented in subclass

ini_detector(controller=None)[source]

Initialisation procedure of the detector.

See Also

daq_utils.ThreadCommand

set_max_frequency()[source]

Set the maximum frequency applicable to the frequency parameter according to material’s limits.

stop()[source]

Stop the current grab hardware wise if necessary