Problem reading analog data from DT9816 with Data Acquisition Toolbox Functions

1 view (last 30 days)
I have a problem reading data from the AD conversor DT9816.
I'm using "read(d,numscans)" function from Data Acquisition to capture analog chanel voltage. The main problem is that with single capture, it works. But, when I try to capture more measurements (more than 1 numscan) it shows the following error:
"Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element."
I tried o asign with index as a vector, but neither worked. I attach the code. Lines that do not work are commented onthe code.
I'm using 2021a and I read somewhere that maybe has legacy problems, as DT9816 is kind of old.
  4 Comments
chrisw23
chrisw23 on 8 Nov 2022
Edited: chrisw23 on 8 Nov 2022
Ah sry I didn't realized that vendor.
They provide Win10/11 driver that should be .net compatible and easy to import.
After the installation off the universal driver, it will be accessible via the GAC
C:\WINDOWS\assembly\GAC_MSIL\MccDaq\<version>\MccDaq.dll
asm = NET.addAssembly("MccDaq")
myDaq1 = MccDaq.MccBoard(0); % index 0 assumes that the first device is the DT9816s
..as a starting point
Martin
Martin on 9 Nov 2022
Sorry to tell you that my problem is not related with the Driver or hardware I'm using. Hardware is detected perfectly by Matlab. Look.
My problem is using the read function. It's like Matlab cannot create the output vector of the function. When I try to read just 1 data, it works: data=read(d,1). But with 2 or more, message is shown:
"Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element."
I tried to do it with indexes: data(:,:), data(:,1), data(1:numscans,:)... But always the same message error.
I'm using Data Transation hardware, not National Instruments. Despite of this, I installed DAQami MCC and drivers from NI, but no changes occured.

Sign in to comment.

Answers (0)

Categories

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

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!