Output files PNA E8363B

Hi everybody! I have installed Matlab 7.0 on the op.system of the PNA E8363, and now I need to make a real-time import of the PNA's parameters into matlab. Could you please tell me how it can be done? I suppose I need to know how the PNA stores the data. I've read the pna help, but I've understood only the file types used, not how to read them in a real time application. Thanks a lot!

You will not be able to get a true real time setup as the PNA only has data accessible at the end of a sweep or multiple sweeps if a N-port calibration has been completed.

With this being said, you would want to use the PNA's COM interface through Matlab to pull the PNA's data into your program. I would reference the Getting Started with COM portion of the Matlab Help file as a COM programming reference.

The code is perfect, thanks again. I've read the pna help and now I'm learning to program it inside Matlab! Now I'm trying to get data from two channels together, that is for example S11 and S12. With this code I am able only to acquire measurements from one channel, that is the active channel on the pna. Could you please help me in what method to use in order to acquire two channels? I am trying to use the Add method, but I'm not sure that this is the best solution. Thanks!!

I've seen that the code creates a new trace on the PNA screen. Is there a way to switch from a trace to another when they're already on the screen, without creating a new one? For example, if I select the S11 trace with the mouse on the PNA, the ActiveMeasurement and ActiveChannel methods return a handle to the active trace, that is S11. I'd like to switch from S11 to S12 with the software, so that S12 becomes the active trace, and then repeat ActiveMeasurement and ActiveChannel to read data. Thanks again!

Dara's suggestion is best in terms of efficiency, if you can get away with having just one trace. If for specific reasons you'd prefer to keep two traces, the Measurement COM object actually does have an 'Activate' method on it specifically for the purpose you were asking about. So corresponding to OJ's earlier code snippet...

"Dara's suggestion is best in terms of efficiency, if you can get away with having just one trace. If for specific reasons you'd prefer to keep two traces, the Measurement COM object actually does have an 'Activate' method on it specifically for the purpose you were asking about. So corresponding to OJ's earlier code snippet...

meas.Activate

would activate the S11 meas on the display, and

meas2.Activate

would activate the S21 meas.

Best regards,Brad HokkanenAgilent PNA Firmware Team"

I tried OJ Danzy code, but my problem is that I need to use the method in a loop, in order to have a continous data transfer to matlab. I've seen that each time I launch the code a new trace appears on the PNA screen; instead, what I prefer is to have S11 and S21 already on the screen, so as when I calibrate a filter for example, and to have the possibility to switch via code from the two S parameters. From what I understand, what I should do is the following:

meas=na.ActiveMeasurement; chan=na.ActiveChannel;

chan.Single(true);

dataS11=meas.getData(1,1);

meas.ChangeParameter(S21);

dataS21=meas.getData(1,1);

Is that correct? I haven't tried the code yet, I'm not sure if this is the right way. Thanks, kind regards

If you have both your S11 and S21 to start with, and the S11 is the active measurement, what this code will do...

meas=na.ActiveMeasurement; chan=na.ActiveChannel;

chan.Single(true);

dataS11=meas.getData(1,1);

meas.ChangeParameter(S21);

dataS21=meas.getData(1,1);

...is that it will retrieve both S11 and S21 data, but it will change your S11 to a S21 in the process -- that's what the "meas.ChangeParameter(S21)" does. If you do wish to manually create both the S11 trace and S21 trace yourself and leave them there, and just have your code access them, then I suggest using our COM 'Measurements' object (is a collection). If you created the S11 trace before creating the S21 trace (and those are the only measurements), then this...

I have some problems running the code.... The situation is the following: I have both S11 and S21 on the PNA screen, and S11 is the selected trace. I'd like to read S11 data, than switch to S21 and read its data as well. I've tried the code below, but when I launch it an error message appears, saying that the method ChangeParameter is not called in the right way. I suppose I have to define S21 as a string first, but I'm not sure about it, and I don't know how to do it

All the PNA's ActiveX methods and properties are described in the COM section of the programming guide built into the PNA's online help with a number of examples. However, there are no MathLab specific syntax listed in the help file.

From experience, I would recommend using the PNA's SCPI interface in Matlab and not the COM interface to the analyzer. Matlab does not support a full COM/ActiveX implementation, so you will not be able to access any of the higher numbered interfaces (where most of the fun stuff is).