Jump to content
  • 0

MATLAB continuously treating AD2 as if AD1


K. Erickson

Question

Hello Digilent world,

I'm currently using the AD2 to calculate impedance using MATLAB. From the beginning it forced me to use the device id as "AD1." I figured, whatever, it's working. However it was limiting to only working at a max rate of 300k while simultaneously reading through the ch1 and 2 scope and generating a waveform. 

I eventually realized that my device ID should be something like AD2_1. Which seemed to be an indication that MATLAB would treat it as an actual AD2 with all of it's increased capabilities. This is necessary as I would like to generate and read as high of a frequency through an inductor or capacitor as possible so I can plot impedance vs frequency.

The problem seems to come from having the Data Acquisition toolbox from Digilent installed on MATLAB. MATLAB treats the AD2 as an AD2 for a time, but it keeps eventually getting stuck treating it as an AD1. Which seems to switch what code will and won't work with my device. 

When I delete the Digilent Data Acquisition toolbox, it usually treats it as an AD2 again. Is there some way I can prevent this? 

I am currently running the latest version of MATLAB R2023a, have waveforms installed, and have the "Digilent Toolbox" downloaded as well. Another abnormality is the fact that my computers device manager does not recognize the AD2. But MATLAB and waveforms both recognize that I have it plugged into a USB port.

Thank you in advance for any assistance.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Thank you for your reply Eduard

 

Currently I only have the Digilent toolbox enabled. The Digilent Data Acquisition toolbox has been uninstalled. So it seems that I can get it working with the data acquisition toolbox uninstalled. However, both toolboxes were the most up to date versions.

I don't really understand how MATLAB can operate the AD2 without the Digilant data acquisition toolbox. The only other data acquisition toolbox that I have is the regular mathworks one, v4.7.

 

Edited by kme
add on the data acquisition toolbox info
Link to comment
Share on other sites

  • 0

Hi @kme,
Both these toolboxes perform the same task (i.e. control the device) using the same DAQ toolbox SDK (https://www.mathworks.com/products/data-acquisition.html).

The newer one, was made by Digilent with guidance from Mathworks in order for us to provide better support (new features and support for new devices):
https://www.mathworks.com/matlabcentral/fileexchange/122817-digilent-toolbox

This is the older one, made by Mathworks:
https://www.mathworks.com/matlabcentral/fileexchange/40344-data-acquisition-toolbox-support-package-for-digilent-analog-discovery-hardware?s_tid=ta_fx_results

I think if you have both installed, you will encounter some sort of conflict between them (hence sometimes you would "acquire" the device using the old toolbox instead of the new one and vice-versa)

Edited by Niță Eduard
Link to comment
Share on other sites

  • 0

I see, I can understand that then. I have a few other people messing around with the AD2 and through MATLAB, and none of them had this issue when having both toolboxes installed. I've been using MATLAB with only the Digilent Toolbox installed and have not been experiencing issues yet. 

The tutorial that led me to believe I needed both toolboxes is this one:
https://digilent.com/reference/test-and-measurement/guides/matlab-getting-started

I suppose for now this issue is resolved.

Thank you so much for your help!

Edited by kme
adding a link
Link to comment
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
×
×
  • Create New...