Jump to content
  • 0

Error showing when use DAQ DT9837A in MATLAB R2022b


Sodanamm

Question

12 answers to this question

Recommended Posts

  • 0

I have the same problem. Debugging the code there seems to be a bug in ChannelGroupOL.m and AsyncOLChannel.m (see also: https://de.mathworks.com/matlabcentral/answers/1693530-error-when-trying-to-start-acquisition-from-data-translation-device). It would be great if  you could fix it soon, we need the toolbox urgent.

Greetings

Andreas

-----

Edit: On Windows10 with Matlab R2021b the toolbox seems to work, but analog output is not functional. Installing 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. 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 is independent of the driver version and should be fixed soon.

 

Edited by AndreasS
Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0
On 3/1/2023 at 1:44 AM, Fausto said:

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.

still got error while startForegrond as below

 

[data,time] = startForeground(s);
Property assignment is not allowed when the object is empty.  Use subscripted
assignment to create an array element.

 

can you provide me any advise

Link to comment
Share on other sites

  • 0

Hello @Sodanamm.

Please verify that you updated the required changes, which I mentioned in my previous post.  I have verified that the 'dt_foreground_streaming_AI.m' example, in the 'C:\Users\{username}\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes' directory, does not report an error.  Be sure to update the device ID parameter, in the example, to correspond with the attached Data Translation device.  Which DT device are you using?

Regards,

Fausto

Link to comment
Share on other sites

  • 0
On 4/1/2023 at 1:53 AM, Fausto said:

Hello @Sodanamm.

Please verify that you updated the required changes, which I mentioned in my previous post.  I have verified that the 'dt_foreground_streaming_AI.m' example, in the 'C:\Users\{username}\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes' directory, does not report an error.  Be sure to update the device ID parameter, in the example, to correspond with the attached Data Translation device.  Which DT device are you using?

Regards,

Fausto

Hi Fausto, thank for your advise now it running fine since am forgot to update first line in  'AsyncOLChannel.m'

Link to comment
Share on other sites

  • 0

Dear Fausto
I would be grateful for your advice. I have spent a while trying to sort out a problem with simultaneous AI and AO triggering and I wonder if you are familiar with the problem.


Actually, I use DT9832 board but I am quite certain that it is a driver problem by now. I use Matlab 2021a to avoid AO problems described in the thread and I revert back to DT Open Layers v7.8.2 as you advised.


I attach an m file which illustrates what I am doing and a function file it uses. The programme works perfectly. However, I use daqreset at each run. I cannot afford it in the real application due to time constraints and I use daqreset only at the start up.


When I disable AO in the real application then AI triggering works perfectly. However, when I enable both AO and AI then I have an intermittent problem. Both subsystems trigger sometimes but AI fails to trigger occasionally and I have a massage:


Error in asyncio.Channel/onCustomEvent (line 477)
            notify(obj, 'Custom', asyncio.CustomEventInfo(type,data));

Error in asyncio.Channel>@(source,data)obj.onCustomEvent(data.Type,data.Data) (line 409)
                                     @(source, data) obj.onCustomEvent(data.Type, data.Data)); 
> In asyncio/Channel/onCustomEvent (line 477)
In asyncio.Channel>@(source,data)obj.onCustomEvent(data.Type,data.Data) (line 409) 
Warning: Error occurred while executing the listener callback for event DataWritten defined for class asyncio.InputStream:
Error using daq.internal.BaseClass/localizedError (line 157)
Internal Error: Unexpected operation processAcquiredData occurred in state WaitingForHardwareTrigger.

I thought AI triggering failures might be due to a cross-talk between AI and AO trigger inputs and put a hardware buffer between them but it did not help.

Many thanks
Andrei 
 

Datain.m dtao2.m

Link to comment
Share on other sites

  • 0

Hello @Andrei62.

Thank you for your response and code.  I tested your MATLAB files with MATLAB R2021b, DT Open Layers v7.8.2, and a DT9836 (which uses the same DT driver as your DT9832).  I wired digital output bit 0 to the A/D External Trigger pin and the D/A External Trigger pin.  I ran your example several times, but could not reproduce your issue.  Next, I disconnected the wire to the D/A External Trigger pin and ran your example; no errors.  Afterwards, I reconnected the wire to the D/A External Trigger pin and disconnected the wire to the A/D External Trigger pin.  I ran your example, but MATLAB did not report any errors, nor did it plot any data points.  I reconnected the wire to the A/D External Trigger pin and ran your example again.  Still, no data was plotted.  I executed a 'daqreset' command in MATLAB, but that did not resolve the plotting issue.  With MATLAB still running, I cycled the USB connection to my DT9836 device and then ran your example.  As a result, data points were plotted.  It appears that since the DT9836 did not receive a valid trigger for the A/D subsystem, the DT device driver was not cleared until the USB connection was cycled.

I modified both your .m files to pause slightly longer in order to check if data would be plotted provided the A/D External Trigger pin detected a trigger signal.  If no trigger signal is detected on the A/D External Trigger pin, then another HI level digital output signal is sent.  For this case, no data is acquired, but you should also not require a 'daqreset' command.  The following run should acquire and plot new data, if the digital output lines to the A/D and D/A are correct.  Please test the attached files with your DT9832 device.

Regards,

Fausto

dtao2_v2.mDatain_v2.m

Link to comment
Share on other sites

  • 0

Hello @Fausto

I am using DT9857E, after updating the device ID in the example file I came across this error :"Invalid default value for property 'AsynchronousIoChannel' in class 'daq.dt.internal.ChannelGroupOL': Unable to resolve the name 'asyncio.Channel.empty''

Then I made all the revisions you mentioned namnely : 

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();

 

BUT, now I get this error " Property assignment is not allowed when the object is empty.  Use subscripted
assignment to create an array element"

 

I have attached the two altered m filed in this message. 

Could you please advise.

Sincerely,

Ali 

AsyncOLChannel.m ChannelGroupOL.m

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...