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.