Data Acquisition with ADLINK DAQe-2006

조회 수: 5 (최근 30일)
Yu Ang Tan
Yu Ang Tan 2012년 11월 27일
댓글: muhammad choudhry 2021년 3월 10일
Hi MATLAB Community,
I am having difficulty acquiring data with the ADLINK card. This is my setup.
%%Capture a Single Analog Input Signal
ai_device = analoginput('mwadlink', 0)% Opens the analog input functionality
ai0 = addchannel(ai_device, 0)%Add channel #0 to ai_device
ai1 = addchannel(ai_device, 1)%Add channel #1 to ai_device
%%Single Sample
getsample(ai_device)%Read the voltage value on channel #0
The getsample(ai_device) works fine as expected. But when I try continuous sampling:
%%Continuous Sample Setting
set(ai_device, 'SampleRate', 1000)%Set SampleRate to 1000
set(ai_device, 'SamplesPerTrigger', 5000)%Set SamplePerTriger to 1000
start(ai_device) %Start data acquisition
get(ai_device, 'Running')
wait(ai_device, 10)%Wait for data acquisition to complete (wait timeout is 10 seconds)
get(ai_device, 'SamplesAcquired')
[time, ai_data] = getdata(ai_device);%Get the waveformcaptured by ai_device object
The 'SamplesAcquired' property shows 64, and the getdata function returns an empty array.
The 'BufferingMode' is 'Auto' and the 'BufferingConfig is [64 30].
What's wrong?
Side Note: =========== I tried continuous sampling by using getsample function with the following code:
n = 100 d = zeros(n,2); t = zeros(n,1);
tic for i = 1:n t(i) = toc; d(i,:) = getsample(ai_device)%Read the voltage value on channel #0 pause(.001) end
It turns out that the ADLink only returns a sample about every 1.5 seconds. Trying the same code on another DAQ (DT9816-S) returns a sample about every .001 seconds.
  댓글 수: 1
muhammad choudhry
muhammad choudhry 2021년 3월 10일
lolz, after 8 years I am having the same problem. Stupid to ask but still asking haha did you get it sorted ?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by