Thread: PNA-X remote calibration, multiple channels


Permlink Replies: 13 - Pages: 1 - Last Post: Nov 10, 2011 3:55 PM Last Post By: gfarrel
bejstam


Posts: 11
Registered: 10/30/11
PNA-X remote calibration, multiple channels
Posted: Oct 31, 2011 6:22 AM
Click to report abuse...   Click to reply to this thread Reply
Is there a way to perform remote calibration of multiple channels in parallel? I have a setup with one S parameter channel, one NF channel, and one IMD channel.

I would like to be able to perform all the "Port 1 Open" calibrations sequentially, the all the "Port 2 Open" calibrations etc, just to save a lot of connecting / disconnecting.

- Thomas
daras


Posts: 871
Registered: 12/01/05
Re: PNA-X remote calibration, multiple channels
Posted: Oct 31, 2011 10:52 AM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
yes - if you use the guided calibration interface (SCPI or COM) you can initiate more than cal session at one time and perform the common acquire steps of each session before moving to the next step. If you tell us what you are using for remote interface (COM or SCPI) and what dev. environment, we may be able to provide you with some examples.
bejstam


Posts: 11
Registered: 10/30/11
Re: PNA-X remote calibration, multiple channels
Posted: Nov 1, 2011 1:21 AM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
I use SCPI. Commands are sent from a Delphi application using the VISA interface, and it all works fine. An example sequence of two parallel calibrations that cannot be in the same channel (e.g. NF and IMD) would be most appreciated.

Thanks,

- Thomas
daras


Posts: 871
Registered: 12/01/05
Re: PNA-X remote calibration, multiple channels
Posted: Nov 1, 2011 5:09 PM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
The only examples I happen to have on hand are for calibrating multiple channels of the same type simultaneously. However, the same techniques work for calibrating multiple channels of the different types. the difference between calibrating multiple channels of the same type, and multiple channels of different types, is that if all the channels are the same type (just different frequencies or other different stimulus conditions), then most likely all the calibration sessions will have the same number and type of connection steps. for example if I have 5 different IMD channels, and I am using an ECal and a power sensor, then all 5 cals will have the same two steps: connect the power sensor to port 1 and connect the ECal between ports 1 and 2 for example). However, if I have an IMD and a Noise Figure channels, they won't have the same exact calibration steps, but some of the steps may be the same. for example they may both have a step to connect the ECal between ports 1 and 2. Unfortunately the only way can recognize similar steps between two different types of calibration is by parsing the step descriptions for each. one other unfortunate complicating factor is that we may not always use the identical prompts for similar steps in two different guided calibrations. we do realize that this is not ideal and will complicate the lives of people who are trying to do what you are attempting and we are working on correcting that, but in the latest firmware available today, this is still the case and it does require you to look for keywords rather than trying to directly string compare step descriptions from different guided cal sessions. In other words, be forewarned

if are still planning on continuing with this effort, here is an example of calibrating multiple Swept IMD channels:


public void PerformMultiChannelIMDCal(int[] channum)
{
ClearAllErrors();
pna.WriteLine("sens:CORR:PREF:CSET:SAVE REUSE");
int[] steps = new int[channum.Length];

for (int i = 0; i < channum.Length; i++)
{
int sn = i + 1;
int cn = channum[i];

pna.WriteLine("sens" + cn + ":corr:coll:guid:conn:port1 \"APC 3.5 female\"");
pna.WriteLine("sens" + cn + ":corr:coll:guid:conn:port2 \"APC 3.5 male\"");

pna.WriteLine("sens" + cn + ":corr:imd:sens:conn \"Ignored\""); //set the power sensor connector to ignored
CheckForError();

pna.WriteLine("sens" + cn + ":corr:coll:guid:ckit:port1:cat?");
object[] KITS = pna.ReadListAsStringArray();
string kit = (string)KITS[0];
char[] str = { '\"' };
kit = kit.Trim(str);

pna.WriteLine("sens" + cn + ":corr:coll:guid:ckit:port1 \"" + kit + "\"");
pna.WriteLine("sens" + cn + ":corr:coll:guid:ckit:port2 \"" + kit + "\"");
CheckForError();

pna.WriteLine("sens" + cn + ":corr:imd:cal:freq all"); //cal all frequencies
pna.WriteLine("sens" + cn + ":corr:imd:cal:meth matc"); //use the match corrected method
pna.WriteLine("sens" + cn + ":corr:imd:mpr 3"); // set the max products to 3rd order
pna.WriteLine("sens" + cn + ":corr:imd:sord:incl on"); // include 2nd order products
pna.WriteLine("sens" + cn + ":corr:imd:pow -10"); // set the power meter cal power to -10 dBm

pna.WriteLine("sens" + cn + ":corr:coll:guid:init \"IMDCal_" + cn + "\"");
CheckForError();

pna.WriteLine("sens" + cn + ":corr:coll:guid:step?");
steps[i] = pna.ReadNumberAsInt32();
CheckForError();
ClearAllErrors();
}

for (int step = 1; step <= steps[0]; step++)
{
pna.WriteLine("sens" + 1 + ":corr:coll:guid:desc? " + step);
string desc = pna.Read();
Console.WriteLine(desc);
Console.ReadKey();
for (int i = 0; i < channum.Length; i++)
{
int sn = i + 1;
int cn = channum[i];
Console.WriteLine("Starting step " + step + " of the cal for channel " + channum[i]);
SetupStatusByte(STATUSBYTEMODE.EVENTS);
pna.WriteLine("sens" + cn + ":corr:coll:guid:acq STAN" + step);
SerialPoll(32);
CheckForError();
}
}
for (int i = 0; i < channum.Length; i++)
{
int sn = i + 1;
int cn = channum[i];
pna.Timeout = TIMEOUT;
pna.WriteLine("sens" + cn + ":corr:coll:guid:save");
Console.WriteLine("Cal in channel " + channum[i] + " is complete.");
Single(cn);
}
}

public void SetupStatusByte(STATUSBYTEMODE mode)
{
if (mode == STATUSBYTEMODE.EVENTS)
{
pna.WriteLine("*CLS;*WAI");
pna.WriteLine("*STB?");
pna.ReadNumber();
pna.WriteLine("*ESE 0");
pna.WriteLine("*ESE 1");
}
else if (mode == STATUSBYTEMODE.OPERATION)
{
//pna.WriteLine("STAT:OPER 0");
pna.WriteLine("STAT:OPER:ENAB 1024");
pna.WriteLine("STAT:OPER:DEV:ENAB 16");
}

}

public void SerialPoll(short mask)
{
bool done = false;
short statusByte = 0;

pna.Timeout = 500;
pna.WriteLine("*OPC");
while (!done)
{
statusByte = pna.ReadStatusByte();
//Console.WriteLine("Serial Polling : " + Convert.ToString(statusByte) + "\r\n");
if ((statusByte & mask) == mask)
done = true;
else
Sleep(50); //sleep 50 milliseconds

}
}

public void CheckForError()
{
pna.Timeout = SHORTTIMEOUT;
pna.WriteLine("SYST:ERR?");
string errMsg = pna.Read(TRIMEND);
int errNum = Convert.ToInt32(errMsg.Substring(0, errMsg.IndexOf(',')));
if (errNum != 0)
{
Exception SCPI_ERROR = new Exception(errMsg);
throw SCPI_ERROR;
}
}


bejstam


Posts: 11
Registered: 10/30/11
Re: PNA-X remote calibration, multiple channels
Posted: Nov 2, 2011 7:19 AM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
I have checked the order in which the standards for the different channels should be applied with my used cal kit. However, the PNA does not respond well to my commands...

A SCPI log:
14:05:58:087 -> *RST
14:05:58:088 -> CALC:PAR:DEL:ALL
14:05:58:089 -> CALC1:PAR:DEF:EXT "Tr1",S11
14:05:58:090 -> CALC1:PAR:DEF:EXT "Tr2",S12
14:05:58:090 -> CALC1:PAR:DEF:EXT "Tr3",S21
14:05:58:091 -> CALC1:PAR:DEF:EXT "Tr4",S22
14:05:58:092 -> CALC2:CUST:DEF "Tr5","Noise Figure Cold Source","NF"
14:05:58:093 -> DISP:WIND1:TRAC1:FEED "Tr1"
14:05:58:094 -> DISP:WIND1:TRAC2:FEED "Tr2"
14:05:58:095 -> DISP:WIND1:TRAC3:FEED "Tr3"
14:05:58:095 -> DISP:WIND1:TRAC4:FEED "Tr4"
14:05:58:096 -> DISP:WIND1:TRAC5:FEED "Tr5"
14:05:58:097 -> SENS1:FREQ:STAR 880e6
14:05:58:098 -> SENS1:FREQ:STOP 915e6
14:05:58:099 -> SENS1:SWE:POIN 1001
14:05:58:099 -> SENS1:SWE:MODE HOLD
14:05:58:100 -> SENS1:PATH:CONF:ELEM "Port1NoiseTuner","Internal"
14:05:58:101 -> SENS2:FREQ:STAR 880e6
14:05:58:102 -> SENS2:FREQ:STOP 915e6
14:05:58:103 -> SENS2:SWE:POIN 51
14:05:58:104 -> SENS2:SWE:MODE HOLD
14:05:58:105 -> SENS2:PATH:CONF:ELEM "Port1NoiseTuner","External"
14:05:58:105 -> SENS1:SWE:MODE SING;*OPC?
14:05:58:982 <- +1
14:05:58:983 -> SENS2:SWE:MODE SING;*OPC?
14:05:59:219 <- +1
14:05:59:220 -> *IDN?
14:05:59:222 <- Agilent Technologies,N5241A,MY49411172,A.09.33.09
14:05:59:224 -> *OPT?
14:05:59:226 <- "200,P02,080,087,029,219,224,UNL,016,014,081,S02"
14:06:19:716 -> CALC1:PAR:SEL "Tr1"
14:06:19:718 -> SENS1:CORR:COLL:GUID:CONN:PORT1 "APC 3.5 female"
14:06:19:720 -> SENS1:CORR:COLL:GUID:CONN:PORT2 "APC 3.5 female"
14:06:19:722 -> SENS1:CORR:COLL:GUID:CKIT:PORT1 "85033D/E"
14:06:19:723 -> SENS1:CORR:COLL:GUID:CKIT:PORT2 "85033D/E"
14:06:19:725 -> SENS1:CORR:CSET:CAT? NAME
14:06:19:814 <- "CalSet_1,CalSet_2,CalSet_3,CalSet_4,CH1000_CALREG,CH1_1710_1785,CH1_880_915,CH1_CALREG,Ch1_CalSet_ThBe,CH2_1710_1785,CH2_880_915,CH2_CALREG,Ch2_CalSet_ThBe,CH3_1710_1785,CH3_880_915,CH3_CALREG,ThBe 20111026 Amplifier Lab"
14:06:19:816 -> SENS1:CORR:COLL:GUID:INIT
14:06:19:818 -> SENS1:CORR:COLL:GUID:STEP?
14:06:19:877 <- +7
14:06:19:879 -> CALC2:PAR:SEL "Tr5"
14:06:19:881 -> SENS2:CORR:COLL:GUID:CONN:PORT1 "APC 3.5 female"
14:06:19:882 -> SENS2:CORR:COLL:GUID:CONN:PORT2 "APC 3.5 female"
14:06:19:884 -> SENS2:CORR:COLL:GUID:CKIT:PORT1 "85033D/E"
14:06:19:886 -> SENS2:CORR:COLL:GUID:CKIT:PORT2 "85033D/E"
14:06:19:888 -> SENS2:CORR:CSET:CAT? NAME
14:06:20:009 <- "CalSet_1,CalSet_2,CalSet_3,CalSet_4,CH1000_CALREG,CH1_1710_1785,CH1_880_915,CH1_CALREG,Ch1_CalSet_ThBe,CH2_1710_1785,CH2_880_915,CH2_CALREG,Ch2_CalSet_ThBe,CH3_1710_1785,CH3_880_915,CH3_CALREG,ThBe 20111026 Amplifier Lab"
14:06:20:011 -> SENS2:NOIS:REC NOIS
14:06:20:012 -> SENS2:NOIS:AVER:STAT OFF
14:06:20:014 -> SENS2:NOIS:AVER 40
14:06:20:015 -> SENS2:NOIS:BWID 4MHz
14:06:20:017 -> SENS2:NOIS:GAIN 30
14:06:20:019 -> SENS2:NOIS:TEMP:AMB 300
14:06:20:020 -> SENS2:NOIS:IMP:COUN 7
14:06:20:022 -> SENS2:NOIS:TEMP:AMB 299
14:06:20:023 -> SENS2:NOIS:TUN:ID "N4691-60004 ECal 06570"
14:06:20:025 -> SENS2:NOIS:TUN:INP "B"
14:06:20:026 -> SENS2:NOIS:TUN:OUTP "A"
14:06:20:028 -> SENS2:CORR:TCOL:USER:VAL 300
14:06:20:029 -> SENS2:NOIS:ENR:FIL "c:\program files\agilent\network analyzer\noise\346ch01_44421602.enr"
14:06:20:031 -> SENS2:NOIS:SOUR:CONN "APC 3.5 male"
14:06:20:033 -> SENS2:NOIS:SOUR:CKIT "85033D/E"
14:06:20:034 -> SENS2:NOISE:CAL:METHOD "Vector"
14:06:20:036 -> SENS2:CORR:COLL:GUID:INIT
14:06:20:038 -> SENS2:CORR:COLL:GUID:STEP?
14:06:20:183 <- +8
14:06:20:185 -> SENS2:CORR:COLL:GUID:DESC? 1
14:06:20:187 <- "Connect adapter (APC 3.5 female to APC 3.5 female) to the port 2 measurement plane. Connect Noise Source to adapter. After measuring, leave adapter in place for the following step."
14:06:50:322 -> CALC2:PAR:SEL "Tr5"
14:06:50:324 -> SENS2:CORR:COLL:GUID:ACQ STAN1
14:06:52:361 -> SENS2:CORR:COLL:GUID:DESC? 2
14:06:52:363 <- "Connect APC 3.5 FEMALE TO APC 3.5 FEMALE ADAPTER between port 1 and port 2"
14:07:14:208 -> CALC2:PAR:SEL "Tr5"
14:07:15:448 -> SENS2:CORR:COLL:GUID:ACQ STAN2
14:07:35:212 -> CALC1:PAR:SEL "Tr1"
14:07:43:107 -> SENS1:CORR:COLL:GUID:ACQ STAN7


Standard 2 of Ch2 and standard 7 of Ch1 is the same, in this case the female-female adapter. The last command sent in the SCPI log generates error 122, "The specified channel was not found."

Maybe I am missing something basic in this, but I have tried to implement the SCPI sequences as they are in the help files.

- Thomas
Dr_joel


Posts: 2,671
Registered: 12/01/05
Re: PNA-X remote calibration, multiple channels
Posted: Nov 2, 2011 1:39 PM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
Hej Thomas, I get the same error, and the channel seems to be missing. Investigating...
Dr_joel


Posts: 2,671
Registered: 12/01/05
Re: PNA-X remote calibration, multiple channels
Posted: Nov 2, 2011 2:16 PM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
OK Thomas, sue wood helped me figure this out. She says she's not sure if she owes you a beer, or you owe her one, but the command you are missing is:
sens:corr:coll:guid:channel:mode 0
Put this after the *RST. This command means "respect the channel X on the sensX:corr..." commands. In OLD, OLD PNA code, all the sensX:corr commands operated on the active channel, regardless of X. With this command, mode 0 is "don't be compatible with old PNA code"; mode 1 is default as "be compatible"; Also, you don't need (but they probably don't hurt) the calc:par:sel commands before each sensX:corr.

Sue did mention to me "good job for figuring out what the code should need, but with compatibilty off, they are not needed"

Also, the problem occurs because the window is left over from the cal step, which it should be closed, but maybe the cal:par:select changed the cal window to the active window before the cal code had a chance to close the cal window...its odd that the cal window is still up and the active window is closed (not gone, if you close the cal window and do "display 1x" the active channel window comes back. The window being gone is why the next command doesn't work, it doesn't see any traces in the active window. The compatibilty mode 0 says "don't pay attention to the active window, just the sensX:corr command.

On the standard acquisitons, you probably should OPC the standards, so that you be sure to wait for them to return. I use VEE with the SCPI string parser, so it blocks until the command is complete.
bhokkan

Posts: 322
Registered: 12/01/05
Re: PNA-X remote calibration, multiple channels
Posted: Nov 2, 2011 3:38 PM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
daras pointed me to this posting earlier today and I was going to respond with the same answer as Joel but he beat me to it. :)
bejstam


Posts: 11
Registered: 10/30/11
Re: PNA-X remote calibration, multiple channels
Posted: Nov 3, 2011 1:49 PM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
OK. It all works fine now with S parameters, NF and IMD all in parallel. I need to connect each standard just once. But, there is one small problem left: The cal sets on ch 2 and ch 3 won't save...

Before I initialize my cals on the three different channels, I check to make sure that the cal sets exist. Otherwise I simply create them.

After finalizing the measurements of the standards, I use
SENS1:CORR:COLL:GUID:SAVE:CSET "Ch1_CalSet"
SENS2:CORR:COLL:GUID:SAVE:CSET "Ch2_CalSet"
SENS3:CORR:COLL:GUID:SAVE:CSET "Ch3_CalSet"
which according to the help file should save the cal sets. The ch 1 cal set saves OK, but the ch 2 and ch 3 cal sets are left empty, and the PNA shows an error stating something like "mnemonic not implemented", most likely SCPI error 108. (I'm working from home right now, so I cannot check the actual error code.)

Should the saving of the cal sets be performed in any other way, or without channel numbering?
swood

Posts: 13
Registered: 02/05/07
Re: PNA-X remote calibration, multiple channels
Posted: Nov 3, 2011 2:13 PM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
Hi Thomas,
I'll have to look into this further but I think our documentation is not exactly right on this command (SENS1:CORR:COLL:GUID:SAVE:CSET). And the behavior for standard channels and applications channels is apparently different.

Can you please try to use the following command in its stead:

SENS1:CORR:COLL:GUID:SAVE:IMMediate.

For non-sparameter channels, this will save the cal register only.
You can then follow this command with:

SENS[n]:CORR:CSET:COPY ( string <UserCalSetName>).

This command will copy the currently active calset on channel [n] and copy it to a user calset with the name provided. Then I think you will end up with the result you were expecting.
bejstam


Posts: 11
Registered: 10/30/11
Re: PNA-X remote calibration, multiple channels
Posted: Nov 10, 2011 1:31 AM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
Thanks for your help. We've got it all working now.

If something in the help files will change, due to bug fixes etc., is there an easy way to track all these changes, not having to check each command separately?
daras


Posts: 871
Registered: 12/01/05
Re: PNA-X remote calibration, multiple channels
Posted: Nov 10, 2011 10:45 AM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
in the main page of the help (the web and the normal .chm version) there is a link labeled "What's New" and our Learning Products engineer is very good at always highlighting the changed or new topics of the help in that area.
Dr_joel


Posts: 2,671
Registered: 12/01/05
Re: PNA-X remote calibration, multiple channels
Posted: Nov 10, 2011 3:50 PM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
and on the first page of the programming commmands page, there is a "new commands" that is very complete.
gfarrel

Posts: 75
Registered: 01/10/06
Re: PNA-X remote calibration, multiple channels
Posted: Nov 10, 2011 3:55 PM   in response to: bejstam in response to: bejstam
Click to report abuse...   Click to reply to this thread Reply
I make many changes to the online version of the help file that are NOT related to new features. For example, modifying the example program as a result of your recent problems. So Brad suggested a single page that lists ALL of the changes to help file topics, separate from What's New. This would be more work, but some may find value in this, including myself. If others find this valuable, I may get to it sooner, rather than later.

Point your RSS reader here for a feed of the latest messages in all forums