Thread: Multiple Channel Guided Calibration for PNA


Permlink Replies: 3 - Pages: 1 - Last Post: May 10, 2012 4:53 PM Last Post By: daras
Spikey Mike

Posts: 2
Registered: 05/08/12
Multiple Channel Guided Calibration for PNA
Posted: May 8, 2012 7:15 AM
Click to report abuse...   Click to reply to this thread Reply
Hi, thanks for reading this.....

I am writing some software in Visual Basic, using COM. I have got most of the things I want to do pretty well sorted out OK. I am setting up between 2 and 8 measurements depending on user input and then calibrating in 1 of 3 ways. I can do the Ecal calibration OK. However, I am struggling with a mechanical standards calibration, where I am trying to acquire each standard for all channels in one go to minimise the number of connector swaps needed.

The analyser is an E8801A PNA. Application code is A04.87.01 / build 450.0 / Type Library 1.9. It is an older windows 2000 machine and I think that this is the latest version available to me.

The VB code I have is:

Set calmgr = pna.GetCalManager
Set guidedcal = calmgr.GuidedCalibration

For c = 1 To NumberOfChannels

pna.ActivateWindow c
Set chan = pna.Channels(c)

Set CalSet = calmgr.CreateCalSet(c)
calsetGUID(c) = CalSet.GetGUID
chan.SelectCalSet calsetGUID(c), True
guidedcal.Initialize c, False

guidedcal.ConnectorType(1) = "Type N (50) female"
guidedcal.ConnectorType(2) = "Not used"

guidedcal.CalKitType(1) = "85032F"

numsteps = guidedcal.GenerateSteps

If numsteps 3 Then
scrap = MsgBox("ERROR !!", vbCritical) 'all channels will be open / short / load
Exit Sub
End If

Next c

For calstep = 1 To 3
scrap = MsgBox(guidedcal.GetStepDescription(calstep), vbOKOnly, "Step " + CStr(calstep) + " of 3")

For c = 1 To NumberOfChannels

pna.ActivateWindow c
Set chan = pna.Channels(c)
Set meas = pna.Measurements(c)
chan.Continuous
meas.Activate
calmgr.GetCalSetByGUID calsetGUID(c)
chan.SelectCalSet calsetGUID(c), True
guidedcal.AcquireStep (calstep)
chan.Hold True
Next c
Next calstep

For c = 1 To NumberOfChannels
Set chan = pna.Channels(c)
pna.ActivateWindow c
Set meas = pna.Measurements(c)
chan.Continuous
meas.Activate

calmgr.GetCalSetByGUID calsetGUID(c)
chan.SelectCalSet calsetGUID(c), True
guidedcal.GenerateErrorTerms
chan.Hold True
Next c

This almost works, but when it gets to the point of generating error terms, there is an error saying error terms could not be applied. The very last channel does seem to have correction applied, and I think that the problem is that the proper cal set is not being selected at each step. This makes me think that the command "calmgr.GetCalSetByGUID calsetGUID(c)" and "chan.SelectCalSet calsetGUID(c), True" is not working as I think it should.

So, am I missing something (obviously, I am!!) or is there a bug in this old analyser that is preventing me from doing what I want?
There is very little information on the forum about multiple channel calibrations and what there is uses SCPI.

Can anybody help? thanks for any ideas you may have,

Best regards, Mike.

Dr_joel


Posts: 2,379
Registered: 12/01/05
Re: Multiple Channel Guided Calibration for PNA
Posted: May 9, 2012 11:05 PM   in response to: Spikey Mike in response to: Spikey Mike
Click to report abuse...   Click to reply to this thread Reply
If we can get daras to chime in, I know he has done exactly this process.

But one comment: you might try using the scpi string parser in com to send the scpi commands just to see if it is the COM implementation that is the trouble.

you get a handle to the scpi parser such as (from the help file)

Dim scpi As ScpiStringParser
Set scpi = app.ScpiStringParser
Dim startfreq As Double
startfreq = 100e6
'
scpi.Parse "Sens:Freq:Start " & startfreq

This way you can mix in scpi commands if the examples are in scpi. And you are right, the application code is really old there. I see that the E8801A is listed under the 6.04 but with the note of running on XP.
Spikey Mike

Posts: 2
Registered: 05/08/12
Re: Multiple Channel Guided Calibration for PNA
Posted: May 10, 2012 8:41 AM   in response to: Dr_joel in response to: Dr_joel
Click to report abuse...   Click to reply to this thread Reply
Thanks, Dr_joel

I've been out of the office for a few days, so hence the delay in my reply. I will try the SCPI parser idea; thanks for that. All the cal sets definately get created, but it is only the last of the set that seems to get any "action".

I'm writing this software very much as an asside to my core job, so progress is a bit slow, but when I get chance to do a bit more I will report back.

Thanks agian,
Regards, Mike.
daras


Posts: 760
Registered: 12/01/05
Re: Multiple Channel Guided Calibration for PNA
Posted: May 10, 2012 4:53 PM   in response to: Dr_joel in response to: Dr_joel
Click to report abuse...   Click to reply to this thread Reply
I looked through my files, but I don't have any COM examples for doing something like this. Here is a good thread that explains the multiple channel calibration using SCPI:

http://www.home.agilent.com/owc_discussions/thread.jspa?messageID=52726&#52726

one other Caveat is that you are working with a very old version of firmware and back then we had no inclination of allowing multiple simultaneous guided cal sessions and many of the SCPI commands that you see in the above thread were added long after version A.04.xx

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