A subsystem is like a component — it has an icon, parameters, and input and output ports. You build a subsystem using a group of components or other subsystems. You can easily create a subsystem by grouping selected components in the layout (see Figure 1).

Subsystems help you to create your own components based on the Component Library without programming, and to organize the layout in different hierarchical levels when there are a large number of components in different levels.

Optical System - Figure 1 -  Hierarchical simulation

Figure 1: Hierarchical simulation

This lesson describes how to create a subsystem using the External Modulated Laser subsystem from Lesson 1: Transmitter — External modulated laser. You will become familiar with subsystems and the Component Library.

Loading a sample file

To load a sample file, perform the following procedure.

StepAction
1From the File menu, select Open.
2From your C: drive, select Program Files > Optiwave Software > OptiSystem 9 > samples > Introductory tutorials > “Lesson 2 Subsystems – Hierarchical simulation.osd”.

Creating a subsystem

To create a subsystem, perform the following procedure.

StepAction
1In the Main layout, select the components that you want to include in the subsystem.
A box appears around the selected components (see Figure 2)..
2Right-click the selection.
A context menu appears (see Figure 24 from Lesson 1).
3From the context menu, select Create Subsystem.
The subsystem appears in a glass box. When you look inside the subsystem, a subsystem tab appears at the bottom of the Main layout (see Figure 3).
Note: The visualizers that are not included in the selection are disconnected. The subsystem does not add additional ports to connect the visualizers.

Optical System - Figure 2 - Creating a subsystem—Selected components in the Main layout

Figure 2: Creating a subsystem—Selected components in the Main layout

Looking inside a subsystem

To look inside a subsystem, perform the following procedure.

StepAction
1Select the subsystem glass box and right-click.
A context menu appears (see Figure 3)
2From the context menu, select Look Inside.
The subsystem opens and a Subsystem tab appears beside the Main layout tab at the bottom of the subsystem layout window (see Figure 3).

Optical System - Figure 3 -  Looking inside a subsystem

Figure 3: Looking inside a subsystem

3To return to the Main layout and close the subsystem, right-click in the subsystem layout and select Close Subsystem from the context menu (see Figure 24 from Lesson 1),
or
To return the Main layout and leave the subsystem open, click the Main Layout tab.

Creating a subsystem output port

You can change parameters and create ports in order to access the signals from the subsystem.

StepAction
1Select the subsystem glass box and right-click.
A context menu appears.
2From the context menu, select Look Inside.
The subsystem opens.
3From the Layout Tools toolbar, select Draw – Output Port Tool.
The cursor changes into a cross-hatch.
4Position the cursor on the edge of the subsystem layout where you want to add the output port.
The cross-hatch changes into an output port.
5Click to place the output port.
The output port is created (see Figure 5).

Connecting a component output port to a subsystem output port

To connect the Mach-Zehnder Modulator output port to the subsystem output port, perform the following procedure.

StepAction
1From the Layout Tools toolbar, select Layout Tool Optical System.
The cursor changes into the Layout Tool.
2Click the Mach-Zehnder output port.
The cursor changes into a link (see Figure 4).
3To connect the Mach-Zehnder output port to the subsystem output port, drag the cursor from the Mach-Zehnder output port to the subsystem output port (see Figure 5).
The output ports are connected.
4Click the Main Layout tab to return to the Main layout.
The output port appears in the subsystem.
Note: Use the same procedure to create input ports. Because this is a transmitter, you will not create input ports in this lesson.

Optical System - Figure 4 - Link tool in the subsystem

Figure 4: Link tool in the subsystem

Optical System - Figure 5 - Linking output ports

Figure 5: Linking output ports

Changing the port position and location

To change the port position and location, perform the following procedure.

StepAction
1In the Main layout, double-click the subsystem port,
or
In the subsystem, double-click the port.
The Port Properties dialog box appears (see Figure 6).
2Select the position in the subsystem that you want to move the port to:

• Top
• Bottom
• Left
• Right

3Move the slider to specify the exact position that you want to select.
4To return to the Main layout, click OK.

Optical System - Figure 6 - Port properties

Figure 6: Port properties

Subsystem properties — name and icon

You can change the name and add an icon for a subsystem by changing the subsystem parameters.

Changing a subsystem name

To change the subsystem name, perform the following procedure.

StepAction
1In the Main layout, double-click on the subsystem.
The Subsystem Properties dialog box appears.
2In the Label field, type External Modulated Transmitter (see Figure 7).
3To return to the Main layout, click OK.
The new subsystem name appears below the subsystem glass box and on the subsystem tab (see Figure 8).

Optical System - Figure 7 - Subsystem properties dialog

Figure 7: Subsystem properties dialog

Optical System - Figure 8 -  Subsystem modified tab name

Figure 8: Subsystem modified tab name

Adding a subsystem icon

You can load a user-defined image from a file to use as the a subsystem icon.
To add a subsystem icon, perform the following procedure.

StepAction
1In the Main layout, double-click the External Modulated Transmitter subsystem glass box.
The External Modulated Transmitter Properties dialog box appears.
2Click the Value cell beside Subsystem Representation.
A drop-down list appears.
3From the drop-down list, select User Image.
4Click the Value cell beside Image Filename, and click
The Open dialog box appears (see Figure 9).
5Select the image that you want to use as the subsystem icon, and click Open.
Note: You can use the image External.bmp in the samples directory.
The image you selected appears as the External Modulated Transmitter subsystem icon (see Figure 10).
6To return to the Main layout, click OK in the External Modulated Transmitter properties dialog box.

Optical System - Figure 9 - Subsystem dialog - User icon import

Figure 9: Subsystem dialog – User icon import

Optical System - Figure 10 - User imported subsystem icon in Project layout

Figure 10: User imported subsystem icon in Project layout

Adding global parameters to a subsystem

In this example, use the External Modulated Transmitter subsystem that you created. To access any parameter inside of the External Modulated Transmitter, look inside of the subsystem.

To change the subsystem component parameter values without looking inside each time you need to access them, you can create global parameters (see Figure 11).

In the following procedures, you will export the Power and Frequency parameters so that you will be able to access them without looking inside the External Modulated Transmitter subsystem.

To add a global parameter to a subsystem, perform the following procedure.

StepAction
1In the Main layout, double-click External Modulated Transmitter subsystem.
The External Modulated Transmitter Properties dialog box appears.
2Click Add Param.
The Add Parameter dialog box appears (see Figure 11).
3Type the following values:
• Name: Frequency
Type: floating-point
Category: Main
Minimum value: 100
Maximum value: 200
Current value: 193.1
Units: THz
4Click Add.
The Frequency parameter is added to the Main category. A message appears in the message window at the bottom of the dialog box to advise you that the Frequency parameter has been added.
5Click Add Param.
The Add Parameter dialog box appears.
6In the Add Parameter dialog box, type the following values:
Name: Power
Type: floating-point
Category: Main
Minimum value: -100
Maximum value: 30
Current value: 0
Units: dBm
7Click Add.
The Power parameter is added to the Main category. A message appears in the message window at the bottom of the dialog box to advise you that the Power parameter has been added.

Optical System - Figure 11 -  Add Parameter dialog

Figure 11: Add Parameter dialog

Optical System - Figure 12 - Frequency parameter added to External Modulated Transmitter

Figure 12: Frequency parameter added to External Modulated Transmitter

Accessing global parameters

In the last section, you added two parameters to the subsystem. Now you must create a reference between the components inside the subsystem and the global parameters (see Figure 13).

To access global parameters, perform the following procedure.

StepAction
1Right-click on the External Modulated Transmitter subsystem.
A context menu appears.
2Select Look inside.
The subsystem layout appears.
3Double-click the CW Laser.
The CW Laser Properties dialog box appears.
4Click in the Mode cell beside Frequency and select Script from the drop-down list.
5Click in the Units cell beside Frequency and select THz from the drop-down list.
6Click the button in the Value cell beside Frequency.
The Parameter Script Editor dialog box appears.
7Type Frequency and click OK.
8Click in the Mode cell beside Power and select Script from the drop-down list.
9Click in the Units cell beside Power and select dBm from the drop-down list.
10Click the button in the Value cell beside Power.
The Parameter Script Editor dialog box appears.
11Type Power and click OK.
12To return to the subsystem layout, click OK.
13To return to the Main layout, click the Main Layout tab.

Optical System - Figure 13 - Using script parameters

Figure 13: Using script parameters

For example, now when you change the value of the Frequency parameter for the External Modulated Transmitter subsystem, you will change the values for the CW Laser inside the External Modulated Transmitter subsystem.

Component Library

The OptiSystem Component Library consists of four sub-libraries (see Figure 14).

  • Default: Read-only — you cannot add or change the parameters of a default component.
  • Custom: Allows you to add new components and expand the Component Library. Note: You can base new components on components from the Default library. However, the component name must be different from the name of the component in the Default library. You can also include subsystems in the Custom library.
  • Favorites: Allows you to add components to a library that includes the ones you use most frequently.
  • Recently used: Components that you have used in recent projects are added automatically to the Recently used library.

Optical System - Figure 14 -  Component Library

Figure 14: Component Library

Before you add the External Modulated Transmitter to the Custom library, you will create a new folder named Transmitters (see Figure 15).

Creating sub folders in the Custom Library

To create a a sub folder in the Custom library, perform the following procedure.

StepAction
1From the Component Library, select Custom.
The Custom library opens.
2Right-click in the background of the Custom library.
A context menu appears (see Figure 15).
3Select Add Folder.
The New Folder dialog box appears (see Figure 16).
4Type Transmitters and click OK.
A new folder named Transmitters appears in the Custom library in the Component Library (see Figure 17).

Optical System - Figure 15 - Creating a custom folder menu

Figure 15: Creating a custom folder menu

Optical System Add Folder dialog

Figure 16: Add Folder dialog

Optical System - Figure 17 -  Added folder in Custom library

Figure 17: Added folder in Custom library

Adding a component to the library

You can drag components to any folder in the Custom library. To add the External Modulated Transmitter to the Custom library in the Transmitters folder (see Figure 18), perform the following procedure.

ActionStep
1Double-click the Transmitters folder in the Custom library.
2In the Main layout, select the External Modulated Transmitter component.
3Drag the External Modulated Transmitter subsystem into the Transmitters folder.
The External Modulated Transmitter subsystem appears in the Transmitters folder.

Optical System - Figure 18 - Added component in Custom Library

Figure 18: Added component in Custom Library

Creating additional ports

To access the electrical signal from the NRZ Pulse Generator inside the External Modulated Transmitter subsystem, create an additional output port in the subsystem (see Figure 19).

To create a port, perform the following procedure.

StepAction
1In the Main layout, right-click on the External Modulated Transmitter.
A context menu appears.
2Select Look Inside.
The subsystem layout appears.
3Create a new output port in the subsystem (see “Creating a subsystem output port” on page 40).

Optical System - Figure 19 -  Adding a new output port to the subsystem

Figure 19: Adding a new output port to the subsystem

Adding a fork to the subsystem

You cannot connect the NRZ Pulse Generator output to this port because it’s already connected to the Mach-Zehnder Modulator input. To solve this problem, you can duplicate the signal from the NRZ Pulse Generator and connect it to both the Mach-Zehnder Modulator input and subsystem output ports by adding a fork (see Figure 20).

To add a fork to the subsystem, perform the following procedure.

Note: To increase the size of the layout, press Ctrl+Shift and drag the cursor from the top left corner of the Main layout to the bottom right corner.

StepAction
1From the Component Library, select Default > Tools Library.
2Drag the Fork 1×2 to the Main layout.
3Select the blue connection between the NRZ Pulse Generator and the Mach-Zehnder Modulator.
The selected connection changes to red.
4Press Delete to delete the connection.
5Connect the NRZ Pulse Generator output to the Fork input.
6Connect the first Fork output to the subsystem output port.
7Connect the second Fork output to the available Mach-Zehnder Modulator input port (see Figure 20).
Note: To delete the internal data monitors, from the Layout Tools toolbar select the Monitor tool and click the monitor in each component output port.

Optical System - Figure 20 -  External Modulated Transmitter with two output ports

Figure 20: External Modulated Transmitter with two output ports

8To return to the Main layout, click the Main Layout tab.

Saving the modified subsystem

To save the modified subsystem, perform the following procedure.

StepAction
1In the Transmitters folder in the Custom library, select and right-click the External Modulated Transmitter.
A context menu appears.
2Select Delete.
3Drag the modified External Modulated Transmitter from the Main layout into the Transmitters folder in the Custom library.

Running the External Modulated Transmitter simulation

To run the simulation for the External Modulated Transmitter, perform the following procedure.

Note: Before you run the simulation, you must connect the External Modulated Transmitter output port to a component or visualizer.

StepAction
1Connect the first External Modulated Transmitter output to the Oscilloscope Visualizer.
2Connect the second External Modulated Transmitter output port to the Optical Spectrum Analyzer and to the Optical Time Domain Visualizer.
3Run the simulation:
a. Click Calculate.
b. Click the PLAY button.
The results appear in the Calculation Output window.
4To view the graphs of the results, double-click each visualizer (see Figure 21).Note: The center frequency and power of the transmitter are defined by the values of the Frequency and Power parameters.

Optical System - Figure 21 - Results from External Modulated Transmitter

Figure 21: Results from External Modulated Transmitter