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":
signalLength = round(duration * sampleRate);
t = [0:signalLength-1]' / sampleRate;
outputSignal = A * sin(2 * pi * fc .* t);
"DisplayName", "Output Signal")
s = daq.createSession('dt');
chOut=addAnalogOutputChannel(s,...
chIn=addAnalogInputChannel(s,...
s.Channels(1,2).Coupling='DC';
queueOutputData(s,outputSignal);
[data,time] = startForeground(s);
"DisplayName", "Acquired Signal")
Giving me the following output:
And the second option, the readwrite daq approach:
devInfo = daqlist("dt").DeviceInfo;
chIn = addinput(dq, devInfo.ID, '0', 'Voltage');
chOut = addoutput(dq, devInfo.ID, '0', 'Voltage');
signalLength = round(duration * sampleRate);
t = [0:signalLength-1]' / sampleRate;
outputSignal = A * sin(2 * pi * fc .* t);
"DisplayName", "Output Signal")
data = readwrite(dq, outputSignal,"OutputFormat","Matrix");
"DisplayName", "Acquired Signal")
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!