Error when trying to start acquisition from Data Translation device.
Show older comments
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
More Answers (2)
Fausto Soares
on 27 Feb 2023
4 votes
@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.
Justin Rehak
on 4 Aug 2022
1 vote
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
Sam Brooks
on 18 Aug 2022
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
Justin Rehak
on 18 Aug 2022
%% 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!
salvador Tazanou
on 16 Feb 2023
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
Andreas Sprenger
on 24 Feb 2023
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
Andreas Sprenger
on 27 Feb 2023
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.
Fausto Soares
on 27 Feb 2023
(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 ).
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!