NI-DAQ device working on some PCs but not others
Ältere Kommentare anzeigen
We are running a National Instruments DAQ (NI-DAQ) in Matlab using the provided dll (NIDAQmx.dll). It is working on one of our PCs (Windows 7, Matlab 2015a), but not two of our other PCs (Windows 10, Matlab 2015a nor 2021a, Windows 10, 2017b). We are confident that it worked in December 2020 on at least one of the Windows 10 PCs. On the Windows 10 PCs, we can use it fine via the built-in NI interface and Matlabs 'session-based' interface, but we have lots of code written around the dll version and need that working.
Below is a minimum example that reproduces our issue:
Device = 'Dev2/ao0';
DAQmx_Val_Volts = 10348;
Voltage = 0.0;
TaskName = []; % An additional error occurs if this is non-empty, but only on Windows 10.
[ statusCreateTask, TaskName, task ] = DAQmxCreateTask_(TaskName);
statusCreateChannel = DAQmxCreateAOVoltageChan(task,Device,-10,10,DAQmx_Val_Volts);
statusWriteAnalog = DAQmxWriteAnalogScalarF64(task,1,0,Voltage);
statusClearTask = DAQmxClearTask(task);
fprintf('%i, %i, %i, %i\n', statusCreateTask, statusCreateChannel, statusWriteAnalog, statusClearTask)
CreateVoltageChan and WriteAnalogScalar both produce the error -200088, which means "-200088::Task specified is invalid or does not exist." This occurs regardless of whether the device is plugged into our PC.
Strangely, Setting TaskName to anything but [] raises the additional error "-200089 DAWmxErrorDuplicateTask" after subsequent calls, but only on the Windows 10 PCs.
We have also tried restarting everything, installing Windows updates, installing the latest NI drivers and rolling back to previous drivers.
This post from 2013 describes a very similar problem. However TaskHandle is already defined as uInt32 in our NIDAQmx.h file, so the answer there doesn't seem to be relevant.
Akzeptierte Antwort
Weitere Antworten (1)
LO
am 1 Jun. 2021
0 Stimmen
Have you tried uninstalling completely and reinstalling the NI-DAQ Data Acquisition Toolbox ?
I have encountered troubles with the 2020 version of MATLAB (on windows 10) and it did not work until Irepeated the install process, at least a couple of times. In some cases the download&install package did not work properly (it got stuck).
If that happens, try to remove the installed components form MATLAB and also erase them from the PC (from the MATLAB installation folder). Install again.
3 Kommentare
Leigh Martin
am 1 Jun. 2021
LO
am 1 Jun. 2021
In my case I can't even run an acquisition session without the toolbox, I am using windows 10, MATLAB 2018 and 2020.
I am using both USB 6211,6212 and PCI express ni devices.
For all these I need the toolbox installed.
I wonder actually how can you run data acquisition without it :)
Leigh Martin
am 1 Jun. 2021
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!