Does anyone have an example script for uploading data into a PNA from Matlab on a remote PC via DCOM? Specifically, I'm trying to put data with the putDataComplex method of the measurement object. The PNA is working well with Matlab via DCOM; it's just the "put" action that is causing a problem for me.

For example:

Let "meas" be a variable refering to the active measurement and "myData" be a complex array of size = 21,1 in Matlab. The active channel is in linear sweep mode with the number of points set to 21.

The following does not work:

* x=(1:21)/21;

* tmp = x.*exp(j*2*pi*x);

* myData = tmp.';

* meas.PutDataComplex('naMeasResult', myData);

I've tried transposing the dimensions of myData. I've also tried letting myData be a 21x2 array where the first column is the real and the second column is the imaginary information. (and I tried the transpose).

* for m=1:21

* myData(m,1)=real(tmp(m));

* myData(m,2)=imag(tmp(m));

* end

The typical error is:

+Error using+

+Interface.Agilent_PNA_Series_1.9_Type_Library.IMeasurement8/putDataComplex+

+Invoke Error, Dispatch Exception:+

+Description: Method putDataComplex failed: The parameter is incorrect.+

Any ideas?

For example:

Let "meas" be a variable refering to the active measurement and "myData" be a complex array of size = 21,1 in Matlab. The active channel is in linear sweep mode with the number of points set to 21.

The following does not work:

* x=(1:21)/21;

* tmp = x.*exp(j*2*pi*x);

* myData = tmp.';

* meas.PutDataComplex('naMeasResult', myData);

I've tried transposing the dimensions of myData. I've also tried letting myData be a 21x2 array where the first column is the real and the second column is the imaginary information. (and I tried the transpose).

* for m=1:21

* myData(m,1)=real(tmp(m));

* myData(m,2)=imag(tmp(m));

* end

The typical error is:

+Error using+

+Interface.Agilent_PNA_Series_1.9_Type_Library.IMeasurement8/putDataComplex+

+Invoke Error, Dispatch Exception:+

+Description: Method putDataComplex failed: The parameter is incorrect.+

Any ideas?

meas.PutDataComplex( +*_'naMeasResult'_*+ , myData);

are you passing in 'naMeasResult' as a string? if so, then that is the problem. naMeasResult is actually an enum that evaluates to an integer (2 to be specific) across the COM/DCOM interface. So if you can't get a hold of the defined enums from an ActiveX interface in Mathlab, you can actually change your call to:

meas.PutDataComplex( +*_2_*+ , myData);

Let us know if that resolves the problem.