嗨,感谢您阅读本文.....我正在使用COM在Visual Basic中编写一些软件。
我已经完成了大部分我想做的事情。
我根据用户输入设置2到8个测量值,然后以3种方式中的1种进行校准。
我可以做Ecal校准OK。
但是,我正在努力进行机械标准校准,我试图一次性获取所有通道的每个标准,以最大限度地减少所需的连接器交换次数。
分析仪是E8801A PNA。
应用程序代码为A04.87.01 / build 450.0 / Type Library 1.9。
这是一台较旧的Windows 2000机器,我认为这是我可以使用的最新版本。
我的VB代码是:set calmgr = pna.GetCalManager Set guidedcal = calmgr.GuidedCalibra
tion 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如果numsteps 3然后scrap = MsgBox(“ERROR !!”,vbCritical)'所有通道将打开/短/加载退出子结束如果下一个c对于calstep = 1到3废料
= MsgBox(guidedcal.GetStepDescription(calstep),vbOKOnly,“Step”+ CStr(calstep)+“of 3”)对于c = 1到NumberOfChannels pna.ActivateWindow c设置chan = pna.Channels(c)设置meas = pna。
测量(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设置chan = pna.Channels(c)pna.ActivateWindow c设置meas = pna.Measurements(c)chan.Continuous meas.Activate calmgr.GetCalSetByGUID calsetGUID(c)chan.SelectCalSet calsetGUID(c),True guidedcal.GenerateErrorTerms
chan.Hold True Next c这几乎可以工作,但是当它产生错误术语时,会出现错误,指出无法应用错误术语。
最后一个频道似乎确实应用了修正,我认为问题是在每一步都没有选择正确的校准集。
这让我觉得命令“calmgr.GetCalSetByGUID calsetGUID(c)”和“chan.SelectCalSet calsetGUID(c),True”不能正常工作,因为我认为它应该。
所以,我错过了一些东西(很明显,我是!!)或者这个旧的分析仪中是否有一个错误阻止我做我想做的事情?
william hill官网
上关于多通道校准以及使用SCPI的信息很少。
有人可以帮忙吗?
感谢您的任何想法,最好的问候,迈克。
以上来自于谷歌翻译
以下为原文
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.