Unable to see Digilent Analog Discovery 2 device in Analog Input Recorder app

8 ビュー (過去 30 日間)
Angelo Cacini
Angelo Cacini 2022 年 9 月 10 日
コメント済み: Angelo Cacini 2022 年 9 月 25 日
Hi, I'm able to run successfully the code reported below, but I can't see my Analog Discovery 2 device in the Analog Input Recorder app (nor Analog Output Generator).
I can see the device in the Hardware Manager, but when I click on the device I get the following error message:
Many thanks in advance for any help or advice.
Regards
daqvendorlist
dev = daqlist
dev.DeviceInfo(5)
dq = daq("digilent")
addoutput(dq, "AD1", "1", "Voltage");
addoutput(dq, "AD1", "2", "Voltage");
ch_out = dq.Channels(1:2);
ch_out(1).Name = "AD1_1_out";
ch_out(2).Name = "AD1_2_out"
addinput(dq, "AD1", "1", "Voltage");
addinput(dq, "AD1", "2", "Voltage");
ch_in = dq.Channels(3:4);
ch_in(1).Name = "AD1_1_in";
ch_in(2).Name = "AD1_2_in"
rate = 300e3;
dq.Rate = rate;
% Specify a 10 Hz sine wave for 1 second.
f = 10;
totalduration = 1;
n = totalduration * rate;
t = (1:n)/rate;
output = sin(2*pi*f*t)';
[data, startTime] = readwrite(dq, [output 2*output]);
plot(data.Time, data.AD1_1_in, data.Time, data.AD1_2_in);
xlabel('Time (s)');
ylabel('Voltage (V)');
title(['Clocked Data Triggered at: ' datestr(startTime)])
  2 件のコメント
Branislav Korenko
Branislav Korenko 2022 年 9 月 25 日
編集済み: Branislav Korenko 2022 年 9 月 25 日
Hi,
Actually having the same issue any suggestions why the Analog Input Recorder app doesn't see the AD2?
Thank you and Best Regards,
Branislav
Angelo Cacini
Angelo Cacini 2022 年 9 月 25 日
Hi,
no progress from my side, still unable to use Analog Input Recorder app.
As work arround I've used the code posted above.
Regards,
Angelo

サインインしてコメントする。

回答 (1 件)

Seth Furman
Seth Furman 2022 年 9 月 12 日
I should mention that datestr is discouraged. Prefer datetime where possible.
For example,
dt = datetime("now","Format","dd-MMM-yyyy-HH-mm-ss")
dt = datetime
12-Sep-2022-20-59-59
string(dt)
ans = "12-Sep-2022-20-59-59"

カテゴリ

Help Center および File ExchangePeriodic Waveform Generation についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by