Data Acquisition with ADLINK DAQe-2006

5 vues (au cours des 30 derniers jours)
Yu Ang Tan
Yu Ang Tan le 27 Nov 2012
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 commentaire
muhammad choudhry
muhammad choudhry le 10 Mar 2021
lolz, after 8 years I am having the same problem. Stupid to ask but still asking haha did you get it sorted ?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by