02-03-2025 02:35 AM
I am getting two errors, copied below:
File "C:\my\path\to\packages\miniconda3\envs\my_env\lib\site-packages\nidaqmx\_library_interpreter.py", line 3312, in get_read_attribute_uint32
raise DaqError(extended_error_info, error_code)
nidaqmx.errors.DaqError: The specified resource is reserved. The operation could not be completed as specified.
Task Name: _unnamedTask<1>
Status Code: -50103
self.check_for_error(error_code)
File "C:\my\path\to\packages\miniconda3\envs\my_env\lib\site-packages\nidaqmx\_library_interpreter.py", line 6412, in check_for_error
raise DaqError(extended_error_info, error_code)
nidaqmx.errors.DaqError: You only can get the specified property while the task is reserved, committed or while the task is running.
Reserve, commit or start the task prior to getting the property.
Property: DAQmx_Read_AvailSampPerChan
Task Name: _unnamedTask<1>
Status Code: -200983
C:\my\path\to\packages\miniconda3\envs\my_env\lib\site-packages\nidaqmx\task\_task.py:98: DaqResourceWarning: Task of name "_unnamedTask<0>" was not explicitly closed before it was destructed. Resources on the task device may still be reserved.
warnings.warn(
C:\my\path\to\packages\miniconda3\envs\my_env\lib\site-packages\nidaqmx\task\_task.py:98: DaqResourceWarning: Task of name "_unnamedTask<1>" was not explicitly closed before it was destructed. Resources on the task device may still be reserved.
A colleague of mine even took the DAQ I was using and tried it themselves, but found the same error.
Thank you for your help!
05-02-2025 02:43 AM
Hi elchd,
What DAQ are you using?
The error persists even after restarting the DAQ?
Could you share the Python script? Maybe you are accidentely allocating a task at some point in the beginning of the script.
Best regards
Leonard
05-02-2025 06:41 AM
Hello,
Apologies, I had found a solution and explained it in a different forum posting. Yes, I was erroneously instantiating an extra task, so then when I try to read it clashes with the multiple tasks. I fixed my Python code where I was making an extra task, and it works well. Thanks for your interest!