-
Notifications
You must be signed in to change notification settings - Fork 188
Description
python : 3.10.12
chris@chrisubuntu:~$ python -m nidaqmx installdriver
Installed NI-DAQmx version (25.3.0) is up to date. (Expected 25.3.0 (2025Q2) or newer.)
ubuntu: 22.04
PCIe-6363
running code (working)
https://github.com/ni/nidaqmx-python/blob/master/examples/analog_in/cont_voltage_acq_int_clk.py
import nidaqmx
with nidaqmx.Task() as task:
task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
data = task.read()
print(f"Acquired data: {data:f}")
not running code
https://github.com/ni/nidaqmx-python/blob/1.0.0/examples/analog_in/voltage_acq_int_clk.py
https://github.com/ni/nidaqmx-python/blob/master/examples/analog_in/voltage_acq_int_clk.py
import nidaqmx
from nidaqmx.constants import AcquisitionType, READ_ALL_AVAILABLE
with nidaqmx.Task() as task:
task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
task.timing.cfg_samp_clk_timing(1000.0, sample_mode=AcquisitionType.FINITE, samps_per_chan=50)
data = task.read(READ_ALL_AVAILABLE)
print("Acquired data: [" + ", ".join(f"{value:f}" for value in data) + "]")
When I try to use task.timing ~ to use precise timing, error -50152 occurs
Try to use continuous acquisition, but cannot because of this issue.
Error:
chris@chrisubuntu:~/Downloads/nidaqmx-python/examples/analog_in$ python voltage_acq_int_clk.py
Traceback (most recent call last):
File "/home/chris/Downloads/nidaqmx-python/examples/analog_in/voltage_acq_int_clk.py", line 14, in
data = task.read(READ_ALL_AVAILABLE)
File "/home/chris/.local/lib/python3.10/site-packages/nidaqmx/task/_task.py", line 619, in read
_, samples_read = self._interpreter.read_analog_f64(
File "/home/chris/.local/lib/python3.10/site-packages/nidaqmx/_library_interpreter.py", line 4166, in read_analog_f64
self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value)
File "/home/chris/.local/lib/python3.10/site-packages/nidaqmx/_library_interpreter.py", line 6451, in check_for_error
raise DaqReadError(extended_error_info, error_code, samps_per_chan_read)
nidaqmx.errors.DaqReadError: A hardware failure has occurred. The operation could not be completed as specified.Task Name: _unnamedTask<0>
Status Code: -50152