• 易迪拓培训,专注于微波、射频、天线设计工程师的培养
首页 > CST > CST使用问答 > Problems with macros in CST MWs 2009

Problems with macros in CST MWs 2009

录入:edatop.com     点击:
Hi,

I would like get S11 of this project (test.cst):
-------------
Sub Results
Dim a11 As Object
Dim p11 As Object
Set a11 = Result1D ("a1(1)1(1).sig")
Set p11 = Result1D ("p1(1)1(1)")

Dim n As Integer
Dim frq As Double
Dim phase As Double
Dim ampli As Double
Dim real As Double

frq=12
n=a11.GetClosestIndexFromX(frq)
phase = Pi/180.0 * p11.GetY(n)
ampli = a11.GetY(n)
real = ampli * Cos(phase)

End Sub

Sub Main
'Starts CST MICROWAVE STUDIO?
Set studio = CreateObject("CSTStudio.Application")
Set proj = studio.OpenFile("C:\MyDoc\test.cst")

Results
End Sub
---------

However, I have this warning:

----
Unable to read result file: C:\MyDoc\Temp\DE24\Untitled_0\Result\a1(1)1(1).sig
(Set a11=Result1D("a1(1)1(1)"))
----

How can I read the S11?

Thanks,

Hi,

I found an interface for accesing result,CSTResultReader.dll is in Advance topic in the help. There are some example.

When I try use this example "Using CSTResultReding.dll from within a Visual Basic script" in my program. I get this fail:

(10040) Moduled could not be loaded
(iErr=OpenProject sProjName, projHandle)

Somebody could help me?

THX

I use code for S11 access:
With Result1D ("a1(1)1(1) ") ' Connect to S11
nn = .GetN ' Get number of frq-points
For ii = 0 To nn-1
' Read all points, index of first point is zero.
F = .GetX(ii) ' here: frequency
S11 = .GetY(ii) ' here: according S11
Next ii
End With

申明网友回复良莠不齐,仅供参考。如需专业解答,请学习易迪拓培训专家讲授的CST视频培训教程

上一篇:dxf mit cst
下一篇:Vivaldi antenna in cst

CST培训课程推荐详情>>

  网站地图