How to Output Scans to DAQ but Ignore Digital Outputs

3 次查看(过去 30 天)
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

回答(1 个)

Umar
Umar 2024-7-2
编辑:Walter Roberson 2024-7-2
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 个评论
Umar
Umar 2024-7-2
No problem Holden, we are glad that your problems are resolved. Happy 4th of July.

请先登录,再进行评论。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by