LEADS icon indicating copy to clipboard operation
LEADS copied to clipboard

Support National Instruments myDAQ as an Input Source

Open ATATC opened this issue 11 months ago • 9 comments

As @qmascarenhas requested, I have investigated the Python binding for National Instruments myDAQ and believe that it can be used as an authentic source for both sensor calibration and experiments.

ATATC avatar Jan 31 '25 14:01 ATATC

Reference: https://github.com/ni/nidaqmx-python

ATATC avatar Jan 31 '25 15:01 ATATC

@qmascarenhas Can you lend me a sensor of any type to test the myDAQ tomorrow?

ATATC avatar Feb 21 '25 00:02 ATATC

@qmascarenhas Can you lend me a sensor of any type to test the myDAQ tomorrow?

yes, sure! sorry I missed this ... can you lmk what exactly you need?

qmascarenhas avatar Feb 27 '25 15:02 qmascarenhas

What sensors do we have?

ATATC avatar Feb 27 '25 17:02 ATATC

For sensing, the myDAQ has analog and digital inputs. I would focus right now on the analog inputs see example1_read_AI_pins.py. You could even use the myDAQ itself ... wire the 5V pwr output to the AI channel, read and log the reading. I could also give you one of the throttles and you can wire it up to the 5V pwr output and measure the throttle output (AI channel - read and log). In fact, this could be something that @HaydenHour should do as an exercise for his work on the E&M Lab Series work for Lab 1.

qmascarenhas avatar Feb 27 '25 17:02 qmascarenhas

Can you let @HaydenHour make a pull request to merge his previous work on the pedal first?

ATATC avatar Feb 28 '25 01:02 ATATC

@ATATC @HaydenHour you will need to install the NI-DAQmx driver before you try testing. See https://github.com/ni/nidaqmx-python/blob/master/README.rst#getting-started

qmascarenhas avatar Mar 03 '25 19:03 qmascarenhas

Btw the read and write functionalities for input and output devices are not yet implemented.

ATATC avatar Mar 03 '25 19:03 ATATC

@ATATC @HaydenHour you will need to install the NI-DAQmx driver before you try testing. See https://github.com/ni/nidaqmx-python/blob/master/README.rst#getting-started

@HaydenHour for testing I would suggest using VS instead of the wrapper that @ATATC has started writing just to make sure we have a handle on how to address the myDAQ. To start, I would wire DGND to AI0- and +5V to AI0+ and then follow the example steps to read the AI0 channel. You should expect to read a float value of around 5. Please drop by rm217 tomorrow to pick up some jumper wires that you can use.

qmascarenhas avatar Mar 03 '25 21:03 qmascarenhas