Error when trying to start acquisition from Data Translation device.

Hi,
I'm trying to connect a Data Translation device (DT9818) using Data Acquisition Toolbox. I have installed the driver and Data Acquisition Toolbox Support for Data Translation Hardware. Everything seems to be fine, however when I want to start acquisition, I receive an error:
Invalid default value for property 'AsynchronousIoChannel' in class 'daq.dt.internal.ChannelGroupOL': Unable to resolve the name 'asyncio.Channel.empty'.
Can anybody tell me if I'm missing something, maybe I need some additional files? Here's the simple code:
v=daq.getVendors;
d=daq.getDevices;
s=daq.createSession('dt');
addAnalogInputChannel(s,'DT9818(00)','1','Voltage');
[data,time]=startForeground(s);
Invalid default value for property
'AsynchronousIoChannel' in class
'daq.dt.internal.ChannelGroupOL':
Unable to resolve the name
'asyncio.Channel.empty'.
Second option I tried:
d=daq('dt');
n=addinput(d,'DT9818(00)','1','Voltage');
data=read(d,seconds(5))
Invalid default value for property
'AsynchronousIoChannel' in class
'daq.dt.internal.ChannelGroupOL':
Unable to resolve the name
'asyncio.Channel.empty'.
I use MATLAB R022a.

 Accepted Answer

I have same issue also. I recently changed from R2019a to R2022a.
May be a package difference. Under R2019a I used the following package:
Data Translation DT9837 and MATLAB DAQ Adaptor with MATLAB Data Acq Toolbox version 1.0.0.0
I will test this now.

2 Comments

I reverted to R2019a. Installed the following package:
Data Acquisition Toolbox Support Package for Data Translation Hardware
version 1.1
Reboot Computer
And it worked fine.
Maybe in issue with 2022a. I reverted backed to what previously worked for me.
Apparently there is a different file path for the class 'asyncio.Channel' in R2022a. I found it under 'matlabshared.asyncio.internal.Channel' instead.
However I keep getting different errors now, so I don't know if it's the only issue.

Sign in to comment.

More Answers (2)

@Justin Rehak Thank you for your suggestions. I was able to get my DT9834 to work with MATLAB R2022b, Windows 11 64-bit, and DT Open Layers v7.8.9.
Below are the changes I made, which should help clarify the workaround for using the 'Data Acquisition Toolbox Support Package for Data Translation Hardware' with MATLAB R2022a and newer.
In the 'C:\Users\{username}\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\Data Acquisition Toolbox Support Package for Data Translation Hardware\+daq\+dt\+internal' folder, I updated two files (AsyncOLChannel.m and ChannelGroupOL.m).
In the 'AsyncOLChannel.m' file, I made the following changes.
Line 1: classdef AsyncOLChannel < matlabshared.asyncio.internal.Channel
Line 21: obj@matlabshared.asyncio.internal.Channel(pluginInfo.devicePath, ...
Line 23: 'Options', channelOptions,...
Line 24: 'StreamLimits', streamLimits);
Line 35: matlabshared.asyncio.internal.DataEventInfo(remainderIn) );
Line 51: matlabshared.asyncio.internal.DataEventInfo(remainderOut) );
In the 'ChannelGroupOL.m' file, I made the following single change.
Line 23: AsynchronousIoChannel = matlabshared.asyncio.internal.Channel.empty();
(Note: There is a known bug with the analog output when using DT Open Layers v7.8.9. Revert back to DT Open Layers v7.8.2. The DT DataAcq OMNI software can be downloaded from BOX using this link: https://datatranslation.box.com/s/8mrbkoxzyv8r9fbsadybvj0btxk2qbni ).
Regards.
I was able to fix this by editing the following files of the Data Translation toolbox:
daq.dt.internal.AsyncOLChannel.m
Replace asyncio.Channel with matlabshared.asyncio.internal.Channel
Change line 21-24 constructor inputs to include 'Options' and 'StreamLimits' before the respective inputs.
daq.dt.internal.ChannelGroupOL.m
Replace asyncio.Channel with matlabshared.asyncio.internal.Channel
You can get to the files via the open command.

6 Comments

Thanks, this is really useful. I keep getting this error:
Check for incorrect argument data type or missing argument in call to function
'addAnalogInputChannel'.
Could you post a copy of what line 21-24 should look like after they are changed?
I think the problem is i haven't put the 'Options' and 'StreamLimits' in the right place.
Thanks again
%% Lifetime
methods
function obj = AsyncOLChannel(channelOptions, streamLimits, pluginInfo)
% Define a plugin directory if one isn't provided
if nargin < 3
pluginInfo.converterPath = fullfile(toolboxdir('daq'), 'daqsdk', 'bin', computer('arch'),'daqmlconverter');
pluginInfo.devicePath = fullfile(toolboxdir('daq'), 'daqsdk', 'bin', computer('arch'),'daqasyncio');
end
obj@matlabshared.asyncio.internal.Channel(pluginInfo.devicePath, ...
pluginInfo.converterPath,...
'Options', channelOptions,...
'StreamLimits', streamLimits);
end
end
If this doesn't do the trick, you will need to Step In through the functions until you find the problematic code. Good luck!
Hi!
I thought I could ask if these changes allow you to use Data translation hardware in MATLAB2022a.
I made them and keep getting errors. The first one is the following:
"Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element."
Do you maybe have a hint for me?
Thank you in advance
Hi,
I have the same problem with DataTranslation (DT9812). I applied your code changes and in file AsyncOLChannel.m I get the Matlab message: "A superclass constructor is being called but matlabshared.asyncio.internal.Channel is not a declared superclass name." How to define a superclass in this file?
Any help is appreciated.
Andreas
After hours of testing: On Windows10 with Matlab R2021b (and previous versions of Matlab) the toolbox seems to work, but analog output is not functional. Installing the MCCDAQ driver version 7.8.0 instead of 7.8.9 fixes this issue. But keep in mind: Window10 does not install DotNetfx3.5 by default which is essential. If you try to install DotNetfx3.5 you will get a 0x80244022 error, which can be fixed (https://social.technet.microsoft.com/Forums/en-US/b20f126a-4478-4efe-8f56-dd94c8b491cd/software-update-error-0x80244022?forum=configmanagersecurity).
The bug with Matlab R2022b 'Data Acquisition Toolbox Support Package for Data Translation Hardware' is independent of the driver version and should be fixed soon.
(Note: There is a known bug with the analog output when using DT Open Layers v7.8.9. Revert back to DT Open Layers v7.8.2. The DT DataAcq OMNI software can be downloaded from BOX using this link: https://datatranslation.box.com/s/8mrbkoxzyv8r9fbsadybvj0btxk2qbni ).

Sign in to comment.

Categories

Products

Release

R2022a

Community Treasure Hunt

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

Start Hunting!