How to Output Scans to DAQ but Ignore Digital Outputs
2 views (last 30 days)
Show older comments
Hello All,
I have a DAQ USB-6003 interfacing with Matlab. I currently have 1 analog input, 1 digital output, and 1 analog output. I understand that I can use 'write' command to output to the DAQ. However, because I have a digital output with no clock, it tells me that "on-demand" operations only are available for that channel.
Therefore, if I try to use an MxN scan matrix to send using the 'write' command, it throws an error (see image). I am wondering if there is a way to only output to the analog channel(s) and ignore the digital channel.
Thanks
0 Comments
Answers (1)
Umar
on 2 Jul 2024
Edited: Walter Roberson
on 2 Jul 2024
Hi Holden,
After reviewing your comments, please ensure that your scan matrix is correctly configured. Make sure that only the analog channels you want to write to are included in the scan matrix. Let me provide example of how you can create a scan matrix in Matlab for analog output:
% Define your analog output channels
analogChannels = [0 1]; % Specify the analog channels you want to use
% Create a scan matrix with values for analog output
scanMatrix = [0.5 1; 0.3 0.7]; % Example values for analog output
% Write the scan matrix to the analog output channels
outputData = scanMatrix';
writeData = [analogChannels; outputData];
write(s, writeData); % Assuming 's' is your analog output session
Please ensure that the analogChannels array contains the indices of the analog channels you want to use, and the scanMatrix contains the values you want to output to those channels.
Hope this will help resolve your problem.
6 Comments
Umar
on 2 Jul 2024
No problem Holden, we are glad that your problems are resolved. Happy 4th of July.
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!