mundo_nidaqmx¶
-
class plugins.mundo_nidaqmx.main.NIDAQmxPlugin(
context: mundo.api.context.ApplicationContext
)¶ NI-DAQmx plugin used to automatically start the measurement of a mass spectrometer before the automation process is started.
-
__init__(
context: mundo.api.context.ApplicationContext
) None¶ Initializes the plugin.
It is recommended to always call this constructor in your own plugins, even if you implement your own.
- Parameters
context – Instance of the
ApplicationContextclass
- property should_render: bool¶
Tell the application that this plugin should be rendered. This is False by default, which means that the
render()method will not be called.
- on_ready() None¶
Once the application is fully initialized and ready. This event indicates that the application context is initialized, and that plugins can safely use it.
- on_start() None¶
Send pulse to mass spectrometer on automation process start.
- on_destroy() None¶
Cleanup plugin. Called when the application deactivates this plugin.
-
render(
parent: PySide2.QtWidgets.QWidget,
expand: Callable,
collapse: Callable
) None¶ Render the GUI widget used to interface with the NI-DAQmx plugin. This widget should allow the user to manually select which controller the application connects to, as well as allow the user to manually send commands to the controller.
- Parameters
parent – The parent widget to render the plugin GUI in
expand – Method used to expand the plugin’s dropdown
collapse – Method used to collapse the plugin’s dropdown
- serialize() Dict[str, Any]¶
Returns configuration options for the plugin that should be saved to file.
-
__init__(
NI-DAQmx driver¶
- exception plugins.mundo_nidaqmx.driver.DAQSetupError¶
DAQ setup error exception.
- class plugins.mundo_nidaqmx.driver.DAQ¶
Driver for the NI-DAQmx controller.
This is used to communicate with the controller, as well as sending out a digital pulse. The digital pulse can be used to tel the measurement device, e.g. a mass spectrometer (MS), to begin measuring once the automation process is started.
- __init__() None¶
- property driver_version: Optional[str]¶
Get the current NI-DAQmx driver version in xx.xx.xx format.
- Returns
The version of the local NI-DAQmx driver
- property devices: List[nidaqmx.system.device.Device]¶
Get the currently connected NI-DAQmx devices.
- Returns
A list of the connected devices
- property is_installed: bool¶
Checks if the NI-DAQmx is installed and configured correctly. This must return True in order for the driver to function. If the driver is not installed, all action in this class are noop’s.
- Returns
True if the NI-DAQmx driver is installed. False otherwise
-
setup(
device: nidaqmx.system.device.Device,
port: str,
channel: str
) None¶ Initializes a new NI-DAQmx task that can be used to open a digital communication channel with the NI controller.
- Parameters
device – NI-DAQmx device to connect to
port – The port name
channel – The ports channel name
- Raises
DAQSetupError – Raised if the setup fails
-
send_pulse(
duration: int = 1
) None¶ Sends a digital pulse to the channel opened at path defined by the constructor.
- Parameters
duration – Duration of output pulse in seconds
- close() None¶
Closes the underlying NI-DAQmx task and any open connections. This should be called on application cleanup.