TheoMaria
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Posts posted by TheoMaria
-
-
17 hours ago, attila said:
Hi @TheoMaria
See the following:DWFtest.zip
The server does not allow me to add m code or m file, here you have a picture:calllib('dwf','FDwfParamSet', 4, 0); % DwfParamOnClose continue on Run calllib('dwf','FDwfDeviceAutoConfigureSet', phdwf.Value, 0); calllib('dwf','FDwfAnalogIOChannelNodeSet', phdwf.Value, 0, 0, 1.0); % V+ enable calllib('dwf','FDwfAnalogIOChannelNodeSet', phdwf.Value, 0, 1, 5.0); % V+ 5V calllib('dwf','FDwfAnalogIOChannelNodeSet', phdwf.Value, 1, 0, 1.0); % V- enable calllib('dwf','FDwfAnalogIOChannelNodeSet', phdwf.Value, 1, 1, -5.0); % V- -5V calllib('dwf','FDwfAnalogIOEnableSet', phdwf.Value, 1); % master enable calllib('dwf','FDwfAnalogIOConfigure', phdwf.Value); % configure device
Hello @attilathank you for your reply. I have tried this on Matlab as a function DWFtest, and called the function on my main file as DWFtest(). However, I ran into a few warnings which state that "The function FDwfParamSet is not found in the library". I go several warnings for all of the calllib parameters you mentioned on your file. Now, I know that my dwf.h file is in the following directory in my PC: hfile = 'D:/Digilent/WaveFormsSDK/inc/dwf.h' so I edited your file, but everything else remains the same.
So could you please tell me how I can fix this?
Also, when I run the main file for 5+ times, I run into the following error:
Error detected using 'digilent' hardware:
Digilent devices with the following serial numbers are reserved by another program:
SN:210321A35F30. To unreserve these devices, close the application and call daqreset.I have attached the main file, in case you would like to look at it.
I closed all the applications, even unplugged the USB to the AD2, and tried daqreset, but to no avail. I had to restart my PC to get rid of this problem. Do you know how to fix this too?
Thank you once again! :)
-
Hello,
I am aware and have controlled the Power supply as well as the individual channel voltage using Python. But I am unaware how to do the same on Matlab. I have read a few posts concerning this topic, where I read about using the h file to initialize the device and then use the power supply:
However, I am still confused as I could not use this due to an error "could not find file". Could anyone please let me know in detail (preferably step-by-step) on how to enable the power supply for AD2 on Matlab?
Thank you!
How to control the power supply of Analog Discovery 2 on MATLAB?
in Test and Measurement
Posted · Edited by TheoMaria
Hi @attilaThank you for the reply again. I have tried the file you sent earlier, however the warnings would not go away, which I mentioned before (he function is not found in the library) as well as #pragma once in main file. The device does not open either. The error that I receive are:
1. Library not found (although I am sure the directory is correct like I mentioned before).
2. Error using calllib on line 19, I have attached the picture. [calllib('dwf','FDwfGetVersion',pBuffer);]
Note: DFWPower() is the function that you have sent yesterday.
Thank you for your help, I am aware that I am asking too much of you but I would really appreciate it if you can help me out.