- https://www.mathworks.com/help/daq/daq.interfaces.dataacquisition.addinput.html
- https://www.mathworks.com/help/daq/daq.interfaces.dataacquisition.addoutput.html
Is there any way to do simultaneous input and output on the same NI device using the new Data Acquisition Interface?
10 views (last 30 days)
Show older comments
With the old Session-Based Data Acquisition, I can create multiple sessions for the same device (one session for input and one session for output), so that I can simultaneously do input and output on the same NI device. For example, I can turn digital outputs on and off while acquiring analog data. Is there any way to do this with the new Data Acquisition Interface? If not, this seems like an unfortunate limitation of the new Data Acquisition Toolbox.
0 Comments
Answers (1)
Kshittiz
on 20 Sep 2023
Hi,
I understand that you want to know if it is possible to create multiple sessions for the same device using the new Data acquisition interface to simultaneously do input and output on the same NI device.
As you want to do input and output on the same NI device, I would advise you to create a single session and then create multiple input and output sessions using the same session object. To know how to create a “daq” session object, refer to the following documentation:
After creating the session object, you can add the analog input and output channels using the ‘addinput’ and ‘addoutput’ functions. To learn more about how to call the ‘addinput’ and ‘addoutput’ functions, please refer to the following documentations:
I hope this answers your query.
Thanks!
Kshittiz
1 Comment
Weston Cole Meyers
on 5 Apr 2024
Hello,
After doing this type of setup, I am trying to use the "start" function to aquire voltage data from one of my 2 analog inputs. I used the following terminology:
s = daq("ni")
s.Rate = 1000;
PT_DEV = 'Dev1';
PT_CH = 'ai0';
PRESSTRANS = addinput(s,PT_DEV,PT_CH,'Voltage');
start(PRESSTRANS,"NumScans",200);
When I use this, I get the following error notification:
"Incorrect number or types of inputs or outputs for function 'start'.
Error in Rarefactiontube01 (line 67)
start(PRESSTRANS,"NumScans",200);"
But when I try to use s (which calls forth my other channels, one of which is an analog voltage input and the other being an analog voltage output) I get the following error:
start(s,"NumScans",200)
Error is:
"Only on-demand operations are supported for this configuration."
I simply wish to call ONLY PRESSTRANS so that I can get a baseline pressure for my experiment. There must be some way, as it would seem silly for the Data Aquisition Toolbox to not allow for terminal-specific operations. Thank you for any help you can provide.
-Weston
See Also
Categories
Find more on Data Acquisition Toolbox Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!