IBM
Contents Index Previous Next



Creating a New Block Diagram


What You Will Learn

Creating a Block Diagram from the Organizer

In this exercise, you will create a block diagram, starting from the Organizer.

  1. Locate the Organizer window and double-click the icon named GameBlock. In a similar fashion as when creating the system diagram, you will get the Edit dialog (see Figure 25 on page 56). Make sure the Show in editor option is on and click the OK button.
    Next, the Add Page dialog is opened. The dialog is used to specify the type of page (process or block interaction). The page name can also be specified. Decide if you want the pages to be autonumbered. (1, 2,... N). This functionality is enabled by default.

Figure 44 : Prompting to add a page

  1. Make sure the Process Interaction Page button is on and click OK.

The SDL Editor opens a window on page 1 of the newly created block diagram. The block diagram editor window is similar to the system diagram window; only the symbol menu differs.

Figure 45 shows the appearance of the finished block GameBlock when printed. As you may see, the diagram contains two process reference symbols, five signal routes, three connection points and a text symbol with a signal declaration.

Figure 45 : The block GameBlock

You should now draw the block diagram as depicted in Figure 45. You add the symbols and lines in a similar fashion as when editing the system diagram. Please spend a minute reading the three sub-sections below before starting drawing the diagram, in order to familiarize yourself with the new concepts that are introduced and how you manage them.

Process Name and Number of Instances

When you add a process reference symbol, you should specify the number of instances by appending the text directly after the name of the process reference symbol. The number of instances is the text between parentheses `( )'.

Signal Routes

Signal routes are drawn in a similar way as channels. When you select a process reference symbol, two "handles" are displayed.

Figure 46 : The two handles of a process reference symbol

Connection Points

When you draw signal routes to / from the frame symbol, you should not only fill in the name and signal list, but also take advantage of graphical connection points to establish connections between the signal routes and the parent system diagram, i.e. connecting the signal routes to the channels. When you draw a signal route to the frame, an additional text object is created close to the frame symbol. In this text object, the name of the corresponding channel is entered. See Figure 47.

Figure 47 : Graphical connection point

The figure depicts a signal route (R1) in the block diagram and the referencing system diagram with the connected channel (C1).

To edit a connection point:

Editing the Block Diagram

Now, draw the diagram as described in the following steps:

  1. Start by adding the process reference symbol "Main(1,1)".
    • As when drawing the system diagram, all text you enter is subject to an immediate syntax analysis. Errors are indicated by a red underlining, which disappear as soon as you have entered the complete text according to the SDL syntax.
    • Remember that before text editing has started, the text cursor is not flashing. Pressing <Delete> at this stage deletes the whole selected symbol, instead of just a typed character.
  2. Draw a signal route from the environment to the process (use the Redirect command). Enter the name of the signal route: R1.

Using the Signal Dictionary for Individual Signals

You are now to specify the name of the signals to be conveyed on the signal route R1. The SDL Editor has the ability to assist you in reusing the signals that are already defined in the SDL structure (i.e. defined in the system diagram, since you are working in a top-down fashion!), with a facility known as the signal dictionary.

  1. Select the signal list text field.
  2. Select the command Signal Dictionary from the Window menu. The Signal Dictionary window is displayed. If necessary, move it so that you can see the signal list in the Editor window.

Note:

To function properly, the Signal Dictionary utility requires that the input SDL diagrams are syntactically correct. If not, you need to go back to the previous exercise (see "Correcting Analysis Errors" on page 77) and run the Analyzer in order to correct any errors.

Figure 48 : The Signal Dictionary window

  1. Look at the left list in the Signal Dictionary window. The first section starts with the separator Up. This section includes the signals that are available by looking one level up in the diagram structure (i.e. in the parent diagram, system DemonGame).

Figure 49 : The Up separator

  1. In this section, the first item identifies the System DemonGame, as expected:

Figure 50 : The item symbolizing the system DemonGame

  1. Since you are editing a signal route from the system diagram to the block diagram, you should look for all icons/lines symbolizing channels from the parent diagram, i.e. IN channels.

Figure 51 : The line specifying a channel from the parent
diagram to the current diagram

  1. Beneath the channel all the signals that it conveys are listed. Click on the signal named Newgame:

Figure 52 : The Newgame signal

  1. From the Edit menu, select the command Insert. The signal list in the SDL Editor is immediately updated.
    • Alternatively, you may double-click the signal in the list.

Note: Undoing the operation

If you happen to insert the signal into the wrong text field (such as the signal route name), you may select the Undo command from the Signal Dictionary's Edit menu. (The SDL Editor's Text Window has no Undo facility).

  1. Insert the required comma and a newline in the Editor window (move the signal list if needed).
  2. Double-click the signal Endgame in the Signal Dictionary.
  3. The channel in the Signal Dictionary also gives a suggestion about how to fill in the connection point: C1. Select the connection point text field in the diagram and double-click the channel in the Signal Dictionary.

Using the Signal Dictionary for Multiple Signals

  1. In the SDL Editor window, add the process reference symbol: Game(0,1).
  2. Draw the signal route R3 from Game to the frame symbol.
    When you are to enter the signal list for R3, you do not need to enter the signals one by one as for R1, since the channel C2 is not split up into multiple signal routes, in the way that C1 becomes R1 and R2 (see your printout or Figure 27 on page 58). Instead, you may insert all signals with one single operation:
  3. Select the channel C2 in the Signal Dictionary. The right list is updated to list all signals conveyed on the channel. Insert them with the Insert command (or double-click the channel C2).

Figure 53 : Selecting a channel in the Signal Dictionary
window lists all signals

You are now somewhat familiar with the Signal Dictionary utility.

Completing the Diagram

  1. Fill in the remaining parts of the diagram using your preferred method. When done, you may close the Signal Dictionary window (use the Close command from the File menu).
  2. Once you are finished with the block GameBlock, save everything, for instance by clicking on the Organizer's Save quick button. Accept the default file name suggested by the Save dialog.

Working with Multiple Diagrams

You have now created two SDL diagrams. Both diagrams are currently opened by the SDL Editor; however only the diagram currently being edited is visible in a window.

The SDL Editor provides a menu named Diagrams where all diagrams and pages currently opened by the editor are listed.

  1. Click on the Diagrams menu. It should now list two diagrams:

Figure 54 : The Diagrams menu

Each of these menu choices correspond to a diagram and page currently opened by the SDL Editor. The file the diagram is stored on is also displayed to the right of the diagram name.
Now, bring the diagram for the system DemonGame into view:
  1. Select the menu choice
    System DemonGame/1 ...... DemonGame.ssy1
    The system diagram is instantly displayed. (The block diagram is now hidden.)
    • The menu choices Back and Forward can also be used to switch between diagrams and pages. The SDL Editor keeps track of which pages you have edited and you can go back and forward in this list, in much the same way as for visited Web pages in a Web browser. There are also two quick buttons for this.

Working with Multiple Windows

So far, you have only worked with one single window on a page. The SDL Editor allows you to open new windows on the same diagram, which makes it possible to work on multiple views on a page. This is also called instantiating a window.

To open a new window on a page:

  1. Make sure the page whose window is to be instantiated is the page currently in view in the SDL Editor. If not, use the Diagrams menu.
  2. From the Window menu, select the command New Window. A new window showing the current page is instantly displayed (see Figure 55).
  3. You may now use any window to work on the page. Any change causes both windows to be simultaneously updated. Try this, for instance by moving a symbol!
  4. You probably need one window only for this tutorial, since the diagrams you are working on in this tutorial are small, on purpose. Close any of the two windows with the Close Window command from the Window menu.

Figure 55 : Two windows of the same page

Resulting Organizer View

Save everything. The resulting Organizer View should now look like:

Figure 56 : The resulting Organizer view

Checking the Syntax of the Block Diagram

You may now want to use the Analyzer to check the syntax of the block diagram you just created.

To analyze the block GameBlock, do as follows:

  1. Select the icon for the block GameBlock to specify the block as input to the Analyzer.
  2. Select the command Analyze and analyze the block diagram.
    • Note that the Analyze dialog lets you select which part(s) of the system you wish to analyze. Make sure the top text in the dialog says Analyze Block GameBlock before clicking -Analyze.
  3. Proceed as for the system diagram, i.e.
1

The exact appearance of the menu choice depends on the directory structure you are working on.


http://www.ibm.com/rational
Contents Index Previous Next