• 0
Sign in to follow this  
mabernico

MATLAB Analog Discovery

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?

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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/

Edited by attila

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this