是德科技
直播中

刘磊

8年用户 234经验值
私信 关注
[问答]

AcquirePowerReadingSex错误问题

我正在尝试使用功率计执行源功率校准,方法是从运行matlab的远程PC发出DCOM命令。
如果我使用PNA的前面板,源功率校准工作正常。
功率计:地址为13的gpib上的N1912A,通道A上的E4413A传感器:PNA:N5242A,端口1,测量让app = pna 835x应用程序对象我的代码* app.Preset; * *%设置频率和点数* *
app.ActiveChannel.StartFrequency = 60e6; * * app.ActiveChannel.StopFrequency = 2.51e9; * * app.ActiveChannel.NumberOfPoints = 101; * *%将参数更改为非比例R1 * * app.ActiveMeasurement.ChangeParameter('R1',1
); * *%config功率计测量* * app.SourcePowerCalibrator.PowerMeterGPIBAddress = 13; * * app.UsePowerSensorFrequencyLimits = 0; * * app.SourcePowerCalibrator.IterationsTolerance = 0.05; * * app.SourcePowerCalibrator.MaximumIterationsPerPoint = 5; * * app
.SourcePowerCalibrator.ReadingsTolerance = 0.05; * * app.SourcePowerCalibrator.ReadingsPerPoint = 3; * * app.SourcePowerCalibrator.SetCalInfoEx(1,1,0.0,'True'); * * pschan = app.SourcePowerCalibrator.PowerSensors.Item(1)
.PowerMeterChannel; * * app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter',pschan,'True'); *最后一行
导致以下错误:+ ???
调用错误,调度异常:+ +描述:方法AcquirePowerReadingsEx失败:找不到通道。+我已经尝试了以下所有版本的AcquirePowerReadingsEx命令。
它们都返回上面列出的相同错误。
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'ASEN',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','ASEN','True');
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'naPowerSensor_A',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','naPowerSensor_A','True');
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'E4413A',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','E4413A','True');
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'E4413A',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','E4413A','True');
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'1',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','1','True');
注意,以下三个命令工作正常:* app.SourcePowerCalibrator.CheckPower(0,80e6)* app.SourcePowerCalibrator.CheckPower('naPowerSensor_A',80e6)* app.SourcePowerCalibrator.CheckPower(pschan,80e6)%pschan定义如上
帮助将不胜感激。编辑:golfnut于2012年8月15日下午3:08

以上来自于谷歌翻译


     以下为原文

  I'm trying to perform a source power calibration with a power meter by issuing the DCOM commands from a remote PC running Matlab.  The source power calibration works fine if I use the front panel of the PNA.

Power Meter: N1912A  on gpib with address 13, with E4413A sensor on channel A
PNA: N5242A, port 1, measurement  

let app = the pna 835x application object

my code
*app.Preset;*

*%set frequencies and number of points*
*app.ActiveChannel.StartFrequency=60e6;*
*app.ActiveChannel.StopFrequency=2.51e9;*
*app.ActiveChannel.NumberOfPoints=101;*

*%change parameter to unratioed R1*
*app.ActiveMeasurement.ChangeParameter('R1',1);*

*%config power meter measurements*
*app.SourcePowerCalibrator.PowerMeterGPIBAddress=13;*
*app.UsePowerSensorFrequencyLimits = 0;*
*app.SourcePowerCalibrator.IterationsTolerance = 0.05;*
*app.SourcePowerCalibrator.MaximumIterationsPerPoint = 5;*
*app.SourcePowerCalibrator.ReadingsTolerance = 0.05;*
*app.SourcePowerCalibrator.ReadingsPerPoint = 3;*

*app.SourcePowerCalibrator.SetCalInfoEx(1,1,0.0,'True');*
*pschan=app.SourcePowerCalibrator.PowerSensors.Item(1).PowerMeterChannel;*

*app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter',pschan,'True');*

The last line causes the following error:

+??? Invoke Error, Dispatch Exception:+
+Description: Method AcquirePowerReadingsEx failed: Channel not found.+

I've tried all of the following versions of the AcquirePowerReadingsEx command.  They all return the same error listed above.

* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'ASEN',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','ASEN','True');
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'naPowerSensor_A',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','naPowerSensor_A','True');
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'E4413A',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','E4413A','True');
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'E4413A',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','E4413A','True');
* app.SourcePowerCalibrator.AcquirePowerReadingsEx(0,'1',1);
* app.SourcePowerCalibrator.AcquirePowerReadingsEx('naPowerMeter','1','True');

Note, the following three commands work fine:
* app.SourcePowerCalibrator.CheckPower(0,80e6)
* app.SourcePowerCalibrator.CheckPower('naPowerSensor_A',80e6)
* app.SourcePowerCalibrator.CheckPower(pschan,80e6) %pschan is defined above

Any help would be appreciated.

Edited by: golfnut on Aug 15, 2012 3:08 PM  

回帖(4)

李家沌

2019-7-17 06:15:19
我在SPC对象页面上做了一个注释:http://na.tm.agilent.com/pna/help/latest/Programming/COM_Reference/Objects/SourcePowerCalibrator_Object.htm

以上来自于谷歌翻译


     以下为原文

  I put a note on the SPC object page:  http://na.tm.agilent.com/pna/help/latest/Programming/COM_Reference/Objects/SourcePowerCalibrator_Object.htm
举报

刘磊

2019-7-17 06:29:16
感谢您对该问题的帮助。
我从来没有想到这一点。
我假设源校准器对象在PNA中持久存在,就像通道一样,app.sourcepowercalibrator只是对该持久对象的引用。
还有其他具有这种特性的物体吗?
顺便说一下,我注意到在线手册说明CheckPower方法是只写的。
这应该只读吗?
再次感谢。

以上来自于谷歌翻译


     以下为原文

  Thanks for the help on that issue.  I never would have figured that out.  I assumed that the source calibrator object persisted within the PNA much like a channel does and the app.sourcepowercalibrator was just a reference to that persistent object.  Are there other objects that have this peculiarity?

Btw, I noticed that the online manual states the  CheckPower  method is write only.  Should this be read only?

Thanks again.
举报

仲娜娜

2019-7-17 06:38:16
引用: sagafa 发表于 2019-7-17 06:29
感谢您对该问题的帮助。
我从来没有想到这一点。
我假设源校准器对象在PNA中持久存在,就像通道一样,app.sourcepowercalibrator只是对该持久对象的引用。

我同意这是违反直觉的。
如果我们从头开始设计我们的COM接口,我会解决这些问题。
此时,向后兼容性需要当前行为。
具有相似行为的另一个对象(在我的头顶)是GuidedCalibration对象。
在整个引导校准过程中,该物体必须保持活着...... SCPI没有这些奇怪的行为 - 因此使用SCPI也是可以解决的问题。

以上来自于谷歌翻译


     以下为原文

  I agree that it is counter intuitive. If we were designing our COM interface from scratch, I would fix these issues. At this point, the current behavior is required for backwards compatibility. 

The other object that has similar behavior (off the top of my head) is the GuidedCalibration object. This object must be kept alive throughout the entire guided calibration...

SCPI doesn't have these odd behaviors - so using SCPI is also work-around.
举报

张奕

2019-7-17 06:52:23
非常感谢你们这些帖子。
今晚让我保持健康。
真棒!
-Andy

以上来自于谷歌翻译


     以下为原文

  Thank you so very much for these posts.  Kept me sane tonight.  Awesome!
-Andy
举报

更多回帖

发帖
×
20
完善资料,
赚取积分