07-31-2015 03:51 AM
I am very new to data acquisition and bought an NI USB 6001 to start learning. Since I can get MATLAB free via my university, I'm using the Matlab data acquisition toolbox as the DAQ software.
My problem is that I get the following error message when I try to generate an AO signal (voltage for an LED) and measure an AI signal (voltage from a 9V battery) simultaneously.
Warning: This change caused queued output data to be flushed. Use queueOutputData to queue data before starting the object.
Hardware does not support the specified connection. Check the device's user manual for valid device routes and pin-outs.
However measuring the AI or generating the AO each by themselves works perfectly fine.
My Matlab script looks like this:
daq.getDevices;
s=daq.createSession('ni');
s.Rate = 1000;
s.DurationInSeconds = 10;
addAnalogInputChannel(s,'Dev1','ai0','Voltage');
addAnalogOutputChannel(s,'Dev1','ao0','Voltage');
aoVoltage=1.8+0.1*sin(linspace(0,2*pi,10000))';
queueOutputData(s,aoVoltage);
s
startBackground(s);
Note that adding the AI and AO channels to the session also works, however I get mentioned error when the session starts. Is this a limitation of my DAQ hardware (I don't see something like that mentioned in the manual) or do I have to alter the script?
The connected pins for the LED are AO0(+) and AO GND(-).
The connected pins for the battery are AI0(+) and AI4(-). (The problem is still there if I use ground reference for the AI)
Solved! Go to Solution.
07-31-2015 01:39 PM
07-31-2015 03:38 PM
6001 can't do simultaneous tasks. Pretty standard limitation of the lower-end hardware.... just don't have the computational resources on the board to handle that stuff. Even the 621x boards only have limited multitasking capability.
Can either step up to a higher-end DAQ ($$$$) or buy a 2nd low-end one and synchronize tasks in software (timing's not as accurate). I've done both approaches, which one is "best" really depends on the application.... if low cost or high performance is a priority.
08-01-2015 04:10 AM
Thanks! What would I be looking for in the product description/manual to find out if the hardware is capable of multitasking? Is this the same as multichannel or does this only refer to acqusition of the same channel type, e.g. all AO? I already tried measuring multiple AO inputs and this worked. So does this mean that I can only measure/ generate multiple signals of the same type? So generating a DO and measuring a DI simultaneously or generating a DO and measuring a AI simultaneously is not possible either?
10-21-2017 05:11 AM
I have same question. Where is the simultaneous ability?
04-17-2018 05:05 AM
From Mathworks:
"Tim, this does not error in MATLAB R2017b.
However NI USB-6001, NI USB-6002, NI USB-6003 do not have internal trigger signals, so the analog input and output channels will not have a hardware-synchronized start with the default configuration.
So, to have synchronized analog input and analog output channels with these device models you need to use external triggering with an external PFI terminal and addTriggerConnection."
Source: https://uk.mathworks.com/matlabcentral/answers/309786-unable-to-get-ni-usb-6002-to-generate-and-read...
11-10-2022 12:41 PM
Can i read 2 Analog Inputs simultaneously? Or does the board not support it... ????
Any help would be really appreciated!
11-10-2022 01:51 PM
@mseth2 wrote:
Can i read 2 Analog Inputs simultaneously? Or does the board not support it... ????
Any help would be really appreciated!
Simultaneously in software - yes, possible, just include both channels in the same task
11-10-2022 02:14 PM
Hello, thank you for the response, I was wondering if there was a python way of doing it? I do not have any experience with LabVIEW OR matlab. Can you help? Thank you!
11-10-2022 08:02 PM
@mseth2 wrote:
Hello, thank you for the response, I was wondering if there was a python way of doing it? I do not have any experience with LabVIEW OR matlab. Can you help? Thank you!
Of course, you can use the Python DAQmx drivers and there are a few examples too.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8o0SAC