Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CST MWS vba script parameter sweep ASCII export

Status
Not open for further replies.

marcel1709

Newbie level 2
Joined
Sep 16, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Germany
Activity points
1,293
Hi everybody

I have a little problem with the CST VB.

I design a model in CST MWS. Know

I want to performe a Parameter-Sweep.

I choose a userdefined output.

Cause I want to analyze some data in matlab,

I want, what CST save for expample the energy in a ascii file.

A new file for every run of the sweep.

But this is not working.

Do you have a idea?

The code:
Code:
Code:
Option Explicit

Sub ParameterSweepWatch(action As Integer)

   'Please define actions for the parameter sweep watch here.


   Select Case action
      Case 0
      'Please define actions before the parametersweep starts.

      Case 1
      'Please define actions after each calculation.
       Dim zaehler       As Integer
       Dim Dateiname    As String
        Dim filename        As String
         Dim Fileendung    As String
         Dim strwert         As String
       Dim wertdouble     As Double

        wertdouble= ParameterSweep.GetValueOfVaryingParameter()

      strwert    = CStr(wertdouble)
      filename     = "I:\simulation-Output\File-"
      Fileendung    = ".txt"
      Dateiname    =

      SelectTreeItem ("1D Results\Energy\Energy [5]")

      With ASCIIExport

       .Reset

       .FileName (Dateiname)

       .Mode ("FixedNumber")
         .Execute

      End With

      Case 2
      'Please define actions after the parametersweep has finished.

   End Select

End Sub

Sub Main()


  ParameterSweepWatch 0
  ParameterSweepWatch 1
  ParameterSweepWatch 2

End Sub

Thanking for your in anticipation.

Added after 9 minutes:

I found the answer.

It was to easy!

' userdefined watch for parameter sweep
Code:
Option Explicit

Sub ParameterSweepWatch(action As Integer)

	'Please define actions for the parameter sweep watch here.


	Select Case action
		Case 0
		'Please define actions before the parametersweep starts.

		Case 1
		'Please define actions after each calculation.
		 Dim zaehler 		As Integer
		 Dim Dateiname 		As String
 		 Dim filename  		As String
  		 Dim Fileendung 	As String
  		 Dim strwert   		As String
		 Dim wertdouble     As Double

	     wertdouble		= ParameterSweep.GetValueOfVaryingParameter(0)
	     Parametername 	= ParameterSweep.GetNameOfVaryingParameter(0)

		strwert 	= CStr(wertdouble)
		filename  	= "I:\simulation-Output\File-"
		Fileendung 	= ".txt"
		Dateiname 	=filename & Parametername & strwert & Fileendung

		SelectTreeItem ("1D Results\Energy\Energy [5]")

		With ASCIIExport

    	.Reset

    	.FileName (Dateiname)

    	.Mode ("FixedNumber")

		.Step(100)

   		.Execute

		End With

		Case 2
		'Please define actions after the parametersweep has finished.

	End Select

End Sub

Sub Main()


  ParameterSweepWatch 0
  ParameterSweepWatch 1
  ParameterSweepWatch 2

End Sub
 

what is your problem?
you can get your results directly from file-export-ascii format
may that i understand from your question,if not forgive me for misunderstand
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top