Issue with PipeWriteXxxArray ActiveX API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with PipeWriteXxxArray ActiveX API

573 Views
lucabarbiero
Contributor IV

Hi,

I have  as issue with using the PipeWriteXxxArray API functions, as I connect to the ActiveX server from MATLAB and I try to send arrays.

With scalar inputs it works:

lucabarbiero_0-1669883585015.png

 

But how should I provide an array? I tried with both MATLAB cell array:

lucabarbiero_3-1669883721896.png

 

And MATLAB normal array:

lucabarbiero_5-1669883780122.png

But nothing. Also tried row vs column array, and tried other PipeWriteFloatArray (same issue).

 

What is the right way?

 

Thanks,

Luca

 

 

 

 
 

 

 

0 Kudos
3 Replies

564 Views
lucabarbiero
Contributor IV

Hi Michal,

It's ok you know that as a user I like to pioneer features of this amazing tool.

After adding that command to my MATLAB script, I don't get the error anymore when invoking PipeWriteXxxArray from MATLAB.

However at target side, after calling FMSTR_PipeRead, the right amount of bytes is received, but only the first element of the array is received correctly, while further array elements contain corrupted data. I tried with  PipeWriteUIntArray, PipeWriteFloatArray and with arrays of 2 and 5 elements.

I can do with just sending scalars for my current use case. Maybe take a note to look into this at some point in time.

Thanks for your quick response,

Luca

0 Kudos

559 Views
MichalH
NXP Apps Support
NXP Apps Support

Yes, we will investigate and fix. 

Thank you.
Michal

0 Kudos

568 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello Luca,

I don't think anyone has tried to exercise Array passing from Matlab before. Can you quickly try to set:

feature('COM_SafeArraySingleDim', 1) 
 
This should turn the Matlab arrays into a single-dimensional safearrays which the FreeMASTER expects. 
 
If this does not help, we will help to debug the issue deeper.
 
Thanks,
Michal
 
0 Kudos