Jump to content
  • 0

MATLAB Analog Discovery


mabernico

Question

I would like to use the Analog Discovery via the MATLAB DAQ interface.  I would like to output a custom signal to both AWG1 and AWG2 simultaneously.  I am able to produce a signal on a single channel using the following code (where output1 is an array of 0s or 3.3s to produce a square wave).  When I monitor this at the headphone jack I receive a frequency sweep in my right ear.

s=daq.createSession('digilent')  ; 
ch=s.addAnalogOutputChannel('AD1',1,'Voltage');
s.Rate=100e3;
s.queueOutputData(output1.');
s.startForeground;

 

If i change the second line to this:

ch=s.addAnalogOutputChannel('AD1',2,'Voltage');

I am able to get a signal from AWG2. When I monitor this at the headphone jack I receive a frequency sweep in my left ear, as expected.

 

I would like to get output from both AWGs simultaneously.  In the code below the attempt is to duplicate the same signal on both AWGs.  When I monitor this at the headphone jack I get a single frequency square wave in only the right ear.

s=daq.createSession('digilent')  ; 
ch=s.addAnalogOutputChannel('AD1',1:2,'Voltage');
s.Rate=100e3;
s.queueOutputData([output1.'  output1.']);
s.startForeground;

 

The entire length of the playback is 90 seconds.  I have tried reducing the number of data points and the sample rate by a factor of 2 thinking it was a buffering issue.   I would expect that cutting it in half would work since I am using the same data two times over, but even cutting it by a factor of 10 yielded no different results.

 

Can you provide any suggestion as to what I might do to get the desired output?

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

The synchronized AWG with MatLab is not working with WaveForms 2.7.5. Please try using the following version: https://drive.google.com/file/d/0B-YtGABZihr-ZjM1MUwzOEV6cEE/view?usp=sharing

In case you need more functionality than the DAQ offers you can access the WaveForms SDK functions, see: https://forum.digilentinc.com/topic/285-matlab-waveforms-sdk/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...