Data Translation DT9857E-08 / Data Acquisition Toolbox - Cannot acquire signal

3 views (last 30 days)
Hi,
I am trying to generate/acquire signal using a DT9857E-08 with the data acquisition toolbox.
While trying a simple readwrite command, the acquired signal it not at all the expected waveform.
In both instances, the output is directly loopback to the input, there is nothing in between. The aquired signal should be identical.
I have tried 2 different code variant. First the "DAQ Adaptor session based":
sampleRate = 96e3; % Sampling Rate
%% Simple Tone
A = 1; % Vpk
fc = 100; % Hz
duration = 0.250; % Seconds
signalLength = round(duration * sampleRate); % Generated signal time vector
t = [0:signalLength-1]' / sampleRate;
outputSignal = A * sin(2 * pi * fc .* t); % Generated signal
% Plot generated signal
figure()
plot(t, outputSignal,...
"DisplayName", "Output Signal")
%% Create Session
s = daq.createSession('dt'); % Create a session
s.Rate = sampleRate; % Assign rate
%% Configure I/O
chOut=addAnalogOutputChannel(s,...
'DT9857E-08(00)',... % Device ID
'0',... % Channel ID
'Voltage'); % Measurement Type
chIn=addAnalogInputChannel(s,...
'DT9857E-08(00)',... % Device ID
'0',... % Channel ID
'Voltage'); % Measurement Type
% Ensure input channel coupling is DC
s.Channels(1,2).Coupling='DC';
queueOutputData(s,outputSignal);
[data,time] = startForeground(s);
hold on
plot(time, data,...
"DisplayName", "Acquired Signal")
legend()
grid on
delete (s);
Giving me the following output:
And the second option, the readwrite daq approach:
sampleRate = 96e3;
dq = daq("dt");
devInfo = daqlist("dt").DeviceInfo;
dq.Rate = sampleRate;
chIn = addinput(dq, devInfo.ID, '0', 'Voltage');
chIn.Coupling = 'DC';
chOut = addoutput(dq, devInfo.ID, '0', 'Voltage');
%% Simple Tone
A = 1; % Vpk
fc = 100; % Hz
duration = 0.250; % Seconds
signalLength = round(duration * sampleRate); % Generated signal time vector
t = [0:signalLength-1]' / sampleRate;
outputSignal = A * sin(2 * pi * fc .* t); % Generated signal
% Plot generated signal
figure()
plot(t, outputSignal,...
"DisplayName", "Output Signal")
%% Play Tone
data = readwrite(dq, outputSignal,"OutputFormat","Matrix");
hold on
plot(t, data,...
"DisplayName", "Acquired Signal")
legend()
grid on
dq.reset();
delete(dq);
Which yield the foolowing waveform:
There are my hardware specifications:
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.8.0.1873465 (R2020a) Update 8
MATLAB License Number: 41113221
Operating System: Microsoft Windows 11 Pro Version 10.0 (Build 22631)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.8 (R2020a)
Audio Toolbox Version 2.2 (R2020a)
DSP System Toolbox Version 9.10 (R2020a)
Data Acquisition Toolbox Version 4.1 (R2020a)
Signal Processing Toolbox Version 8.4 (R2020a)
-----------------------------------------------------------------------------------------------------
Data Acquisition Toolbox Support package for Data Translation hardware Version 1.1 (R2020a)
I am convince that the DT9857E-08 works as it give correct readings while using the QuickDAQ software.
Hope you will have all the information necessary.
Thanks in advance for the support!

Accepted Answer

Thibaut
Thibaut on 20 May 2024
FIXED
=======================================
The problem reside within the Data Translation Open Layer version.
Reverting from 7.8.9 to 7.8.2 fixed the issue.
Please follows here

More Answers (0)

Categories

Find more on Data Acquisition Toolbox Supported Hardware in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!