12-27-2024 03:47 PM
I'm running Windows 11 with NI device monitor and a USB-6363. The NI device monitor and USB-6363 appear to be working fine:
I'm also running pycharm community edition 2024.3.1.1, and Python 3.13.1 and the following example:
import nidaqmx
with nidaqmx.Task() as task:
task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
task.read()
print("test")
When I run the program, I get no errors and no output, except for "test".
Any suggestions? I'm not even sure where to begin.
Solved! Go to Solution.
12-27-2024 09:11 PM
You need to store the read value in a variable and print it to see the value you read.
Try running the DAQmx example, https://github.com/ni/nidaqmx-python/tree/master/examples
BTW, only one application can access DAQ hardware, this means, either your Python code must access or the Test panel not both at the same time.
12-27-2024 11:30 PM
Thanks, that worked!
01-01-2025 03:50 PM
Note that python nidaqmx examples are not that good or let's say exhaustive. Earlier, I got the nice recommendation to look at C examples and translate to python API (which may still not be that easy).
Don't hesitate to post on forum, this will enrich python usage