![]() |
![]() |
![]() |
![]() |
![]() |
Creating a New Block Diagram
What You Will Learn
- To create and draw a block diagram
- To request signal dictionary support
- To work with multiple diagrams using the SDL Editor
- To open new windows on a page
- To work with multiple SDL Editor windows
- To perform syntax check on a block diagram
Creating a Block Diagram from the Organizer
In this exercise, you will create a block diagram, starting from the Organizer.
- 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.
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.
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.
- The left handle is used for drawing signal routes, in a similar fashion as channels.
- The right handle is used for drawing create requests. It is not used in this tutorial.
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.
The figure depicts a signal route (R1) in the block diagram and the referencing system diagram with the connected channel (C1).
Editing the Block Diagram
Now, draw the diagram as described in the following steps:
- 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.
- 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.
- Select the signal list text field.
- 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.
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.
- 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).
- 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.
- From the Edit menu, select the command Insert. The signal list in the SDL Editor is immediately updated.
- Insert the required comma and a newline in the Editor window (move the signal list if needed).
- Double-click the signal Endgame in the Signal Dictionary.
- 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
- In the SDL Editor window, add the process reference symbol: Game(0,1).
- 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:
- 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).
You are now somewhat familiar with the Signal Dictionary utility.
Completing the Diagram
- 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).
- 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.
- 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:
- Select the menu choice
System DemonGame/1 ...... DemonGame.ssy1
The system diagram is instantly displayed. (The block diagram is now hidden.)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:
- 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.
- From the Window menu, select the command New Window. A new window showing the current page is instantly displayed (see Figure 55).
- 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!
- 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.
Resulting Organizer View
Save everything. The resulting Organizer View should now look like:
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.
- Select the command Analyze and analyze the block diagram.
- Proceed as for the system diagram, i.e.
- Look for any syntax errors in the Organizer Log.
- Correct these errors.
- Repeat the procedure if required (see "Correcting Analysis Errors" on page 77 if you do not remember how to do this).
The exact appearance of the menu choice depends on the directory structure you are working on.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |