Using VB Scripting for the Simulation

Compatibility:

To use VB Scripting for the simulation, perform the following procedure.

Step Action
1 At the bottom of the layout window, click the Scripting tab.
2 Type the following short script (see Figure 12):Const NumIterations = 3 lambda = 1.55

For x=1 to NumIterations

ParamMGR.SetParam “wavelength”, CStr(lambda) ParamMGR.Simulate

WGMgr.Sleep(50)

lambda = lambda – 0.15

Next

BPM - Figure 12 Script

Figure 12: Script

Note: This script will perform 3 iterations with a 0.15µm step-down from the starting wavelength.

•     First wavelength = 1.55µm

•     Second wavelength = 1.40µm

•     Third wavelength = 1.25µm

For more information on scripting, see the OptiBPM User’s Guide.3From the Simulation menu, select Edit Parameters.

The Variables and Functions dialog box appears.4Type the following values:

Name: wavelength

Expression: 1.555To set the value, click Verify.

The value is set automatically to 1.55 (Expression setting).6To apply the settings, click Add/Apply.

The wavelength settings appear under the User Variables tab (see

Figure 13).

BPM - Figure 13 Settings in Variables and Functions dialog box

Figure 13: Settings in Variables and Functions dialog box

7 To return to the layout, click OK.
8 Before running the simulation, test the script for errors by running the scripting page (Simulation > Run Script, or press Play on the Script toolbar).

If you have made a VB syntax error, a message with the line number and description of the problem will appear in the Notification tab of the Output Window. If you only get the message “Warning: Running of Script will clear Undo Redo stacks”, then all is well, and you should proceed. If you get error messages in addition to the warning, check your spelling and typing of the script before going to simulation.

Note: In later lessons, you will learn that many scripts can change the layout. This is a desirable feature for advanced simulations, but keep in mind that running these scripts will change the layout you have drawn.9From the Simulation menu, select Calculate 2D Isotropic Simulation.

The Simulation Parameters dialog box appears.10Type the following setting:

Wavelength (µm): wavelength11Under Simulation technique, click Simulate Using Script (see Figure 14).

BPM - Figure 14 Run simulation using the scripto

Figure 14: Run simulation using the scripto

12 To start the simulation, click Run.

The OptiBPM_Simulator window opens and a VBScript prompt box appears and displays the wavelength of Iteration 1.13To open OptiBPM_Analyzer and view the simulation results, in the prompt box that appears at the end of the simulation, click Yes.

The OptiBPM_Analyzer window opens.