ΣSigmaStudio Ask AI Русский Log in

Sigmastudio server Matlab register write- what's missing?

SigmaDSP & SigmaStudio jeffrex Jul 25, 2018 00:00 2 replies Original on forum ↗
Subscribe
jeffrex Question
Jul 25, 2018 00:00

Hi all, I'm writing Matlab code to control an ADAU1772 through sigmastudio server. I can do register reads, but writes aren't working. Here's the Matlab code for a write:

SS = actxserver('Analog.SigmaStudioServer.SigmaStudioServer');
ss_server = SS.invoke('ISigmaStudioServer');

b=uint8(zeros(4,1));

b=ss_server.REGISTER_READ_ARRAY('IC 1',224,4); %This works!

b=uint8(zeros(4,1));

ss_server.REGISTER_WRITE_ARRAY('IC 1', 224, 4, b) %But this doesn't!!

The write generates this error:

Error using Interface.2942E58A_4461_410E_87B3_64152C81935F/REGISTER_WRITE_ARRAY
Error: The parameter is incorrect.

Does anyone have any idea why the write doesn't work? I thought maybe I couldn't write the the active bank, but that doesn't seem to be the problem.

Thanks,

Jeff

register write

adau1772

Integrated/Special Purpose A/D Converters

matlab

sigmastudio

Audio CODECs

Show More

jeffrex Reply
Jul 25, 2018 00:00

- Hi Jim, you have entered a few guru-level replies in similar threads. Could you take a look at this?

Thanks,

Jeff

jeffrex Reply
Jul 26, 2018 00:00

Eureka! Found this thread at Mathworks:

How can I pass arguments to an ActiveX server from MATLAB 7.0 (R14) as one-dimensional arrays? - MATLAB Answers - MATLAB…

If you set the default safearray dimensionility to 1 instead of 2 with the matlab command

feature('COM_SafeArraySingleDim',1)

Then writes like the one below are successful.

b=uint8(zeros(4,1));

ss_server.REGISTER_WRITE_ARRAY('IC 1', 224, 4, b)

Do any ADI software engineers look at these message boards?