-
Notifications
You must be signed in to change notification settings - Fork 10
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
Migration to NIDAQmx python wrapper #8
base: main
Are you sure you want to change the base?
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
@jerlfan @aurore-finco @seb5g |
We can try to have a look at it and test it in the lab in January, sure! |
I added Jérémie and Aurore as reviewers as they might be the one currently using those features |
Browsing the files I could see you actually reimplemented many enums and class I had with previous implementation using pydaqmx. I thought nidaqmx was more pythonic, is there then a need to expose these again and not use nidaqmx functionalities directly? |
our main goal was to implement the ni task management for asynchronous call. I don't think we had an enum "strategy". My understanding is that nidaqmx is more a wrapper to get close to the C objects. Most of the enums are about tasks and chanels constants/setup. |
|
||
return values | ||
|
||
def move_Abs(self, position): |
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.
move_abs !!!
self.task.StopTask() | ||
return 0 | ||
|
||
def move_Rel(self, position): |
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.
move_rel
elif self.settings['NIDAQ_type'] == 'Digital_Output': | ||
self.writeDigital(1, np.array([self.target_position], dtype=np.uint8), autostart=True) | ||
|
||
def move_Home(self): |
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.
move_home
if not not devices: | ||
for device in devices: | ||
for source in source_type: | ||
if source == DAQ_NIDAQ_source['Analog_Input'].name: # analog input |
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.
by the way enums are actually more conveniently used with:
DAQ_NIDAQ_source.Analog_Input.name
```
like this you're sure to not call things that are not member of the enum (but again here because the enum already exist in the nidaqmx module, one should directly use it. I did all this to transform at the time the not really pythonic pydaqmx library. Execpt that maybe something similar to DAQ_NIDAQ_source is not present in the nidaqmx module?)
""" | ||
logger.info("********** CONFIGURATION SEQUENCE INITIALIZED **********") | ||
devices_info = [dev.name + ': ' + dev.product_type for dev in self.devices] | ||
logger.info("Detected devices: {}".format(devices_info)) |
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.
should use the fstring formating which make things more readable
@loicguilmard We have only some 6323 and 6333. We'll have a quick look anyway, but it might indeed not be compatible. |
@seb5g which ones do you prefer ? |
and 2 a using undocumented, private methods ie: Edge.member_names b or using MethodType(members, Edge) Don't know the second one... Do as you think it's the best Also I saw you imported using star. It's really bad practice.... Please import things you'll use Thx |
I already removed the constants * import :) I won't tell who wrote that :p @aurore-finco we are using the NI cdaq-9174 chassis with the modules 9205 and 9211. From what i've experienced changing chassis is pretty transparent just the device name change, but modules have a lot of different task parameters. I'll join our toml as an example to ease the customization. |
…, ThermocoupleType
Nidaq cethil multimodule
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