-
Notifications
You must be signed in to change notification settings - Fork 10
Migration to NIDAQmx python wrapper #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Wrapper daqmxni as been implemented from nidaqmx library. Simple counter works. Other channels must be tested. Must add a "timer" to the counter.
… config during init
…idaq_cethil_multimodule
loicguilmard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aren't those supposed to be DAQmx_legacy now ?
| self.level = level | ||
|
|
||
|
|
||
| class Channel: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Channel object exists also in the nidaqmx library (see doc here), with many child classes (AIChannel, AOChannel, etc.) just like we do. Shouldn't we rather use these?
I am not fully sure, as the nidaqmx objects require a task during initialization, we might need to rewrite a lot of code, but this would seem better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After investigation it seems convenient to keep our channels. As you said the nidaqmx channel object require a task, and it doesn't really match the use of the param tree or the config files + modifying and deleting channels properly in a whole global task could easily become a mess so closing a task and opening a new one remains a clean way for update_task.
src/pymodaq_plugins_daqmx/hardware/national_instruments/daqmxni.py
Outdated
Show resolved
Hide resolved
src/pymodaq_plugins_daqmx/hardware/national_instruments/daqmxni.py
Outdated
Show resolved
Hide resolved
| def __init__(self, **kwargs): | ||
| super().__init__(**kwargs) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should specifiy somewhere that the DigitalChannels are not fully implemented and not tested yet.
| self.channels = None | ||
| self.clock_settings = None | ||
| self.trigger_settings = None | ||
| self.live = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is self.controller initialized? Which object is it supposed to be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.controller is a DAQmx object (btw I'm renaming it NIDAQmx) which is supposed to be initialized either in the init_detector of the daq_NIDAQmx_Viewer.py for a detector or in the ini_stage of daq_NIDAQmx_Move.py for an actuator
| else: | ||
| self.controller = controller | ||
| else: | ||
| self.controller = 'A Nidaqmx task' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The controller should probably not be a string here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I didn't implement it but only made a copy paste of the current one, i'm removing this file to be sure only working things are released.
aurore-finco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So only the DAQ_viewer 0D has been tested with the new nidaqmx version? I think that the DAQ_Move might not work at the moment.
…DAQmx_Move) to let previous PYDAQmx based-on daq_NIDAQmx.py reachable
|
@seb5g I think we all agree now. If you're ok with the result, would you accept this PR ? May be you want to test it against your system ? |
| @@ -0,0 +1,10 @@ | |||
| from pathlib import Path | |||
| from hatchling.metadata.plugin.interface import MetadataHookInterface | |||
| from pymodaq_utils.resources.hatch_build_plugins import update_metadata_from_toml | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If one use pyproject and hatch then one has to add pymodaq_utils in the project requirements. As only including pymodaq 4 will not require pymodaq_utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already in the pyproject.toml in the following section:
[build-system]
requires = [
"hatchling>=1.9.0",
"hatch-vcs", "toml",
"pymodaq_utils>=0.0.6",
]
Do you mean adding it in the dependencies of the project section such as below ?
dependencies = [
"pymodaq>=4.4",
"pydaqmx",
"nidaqmx",
"aenum",
"pymodaq_utils"
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non you're right it is a build requirement... sorry
I saw one thing to modify in my quick review. I will accept the PR and then test on my stuff. I'll do other PR if need be. |
|
Hi there, version 1.0.0 using nidaqmx is online! Good job to everyone @Soungai00 @jerlfan @loicguilmard @aurore-finco and all other I may not know about ;-) |
Plugin updated with NIDAQmx viewer based on NIDAQmx python wrapper.
For this first release with NI, Analog Input are coded and working with cDAQ & NI-USB devices.
Measurements available are current, voltages and temperatures:
.toml config files are used to get the configuration of the manip and scalable group parameter are created during init_detector to get the configurated analog inputs