How to Output Scans to DAQ but Ignore Digital Outputs

2 visualizaciones (últimos 30 días)
Holden
Holden el 1 de Jul. de 2024
Comentada: Umar el 2 de Jul. de 2024
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

Respuestas (1)

Umar
Umar el 2 de Jul. de 2024
Editada: Walter Roberson el 2 de Jul. de 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 comentarios
Holden
Holden el 2 de Jul. de 2024
Good to know, looks like both ways work, Thanks!
Umar
Umar el 2 de Jul. de 2024
No problem Holden, we are glad that your problems are resolved. Happy 4th of July.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Acquisition Toolbox Supported Hardware en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by