< Previous | Next >

Lesson 4: Connecting blocks and analyzing behavior

Additional analysis of the use cases defines the structural and behavioral composition of the control system. The two essential systems are specified as SysML blocks–a ControlSystem block and a SystemUnderControl block. Use an internal block diagram to create the structural design.
The ControlSystem block and SystemUnderControl blocks form the system context and are defined in the starting point External Flows internal block diagram. The ControlSystem and SystemUnderControl blocks, represented as parts (cs and s), are coupled together in a closed loop control system.

Locating the External Flow internal block diagram

In the browser, expand DesignSynthesisPkg > blocks > Context > Internal Block Diagrams and double-click External Flows to open the diagram.

External Flow internal block diagram
You use this diagram to specify the connections between the SystemUnderControl and the ControlSystem blocks and the flow of heat and temperature between these two systems. SysML requires that such connections be specified between block instances within a context, so you can use the Context block to define the context and the parts are the instances of the SystemUnderControl and the ControlSystem blocks.

The starting point External Flows diagram has the input side connection (heat) specified, but the connection for the output side (temperature) is missing.

Connecting blocks through flowports

To complete the closed loop design in the External Flows internal block diagram:

  1. In the browser, expand the ControlSystem and SystemUnderControl folders and the FlowPorts folders, as shown here.
    Browser showing expanded ControlSystem and SystemUnderControl
  2. Use a shortcut to copy the temperature flow port from the ControlSystem and paste it into the SystemUnderControl > FlowPorts. Hold the Ctrl key down while dragging the temperature flowPort from ControlSystem to the FlowPorts in the SystemUnderControl block. Be sure that you select only the temperature flow port. Similarly, to move an element, drag it from one area to another in the browser.
  3. Examine the temperature flow ports that you added to the diagram and note that they are pointing in the wrong direction. Temperature must flow out of s.
  4. In the browser, double-click the temperature flow port in the SystemUnderControl folder.
  5. In the Features window, click Output in the Direction area and click OK. Observe the corresponding change on the diagram.
  6. To display the drawing toolbar, select View > Toolbars > Drawing.
  7. To connect the temperature flow ports, select the Connector tool Connector tool and click the flow ports to draw the connection between them.
  8. Do not enter text into the grey placeholder in the middle of the connector. Click another area of the diagram to allow the product to set the default name for the connector. The connector name is hidden by default.
  9. To add a flow direction to the temperature connector, select the Flow tool, click once on the center of the connector line. Do not type in the grey flow box.
    Adding a flow to the External Flow internal block diagram
  10. Double-click on the green flow arrow to open its Features window. On the Item Flows tab, select <<Add>> and <<Select>> from the menu.
  11. In the Select Convey window, navigate to and select output in the Flow Attributes. Click OK twice.
    Select Convey window

The flow attribute name, output, and its type, degC are displayed next to the flow arrow on the diagram.

Analyzing behavior in an activity diagram
To open the starting point activity diagram:
  1. In the browser, open the FunctionalAnalysisPkg.
  2. Double-click the OperateSystem activity. This opens the activity diagram for the activity.
This activity begins by waiting for an evPower event. Upon receipt of the event, flow of control splits concurrently along two paths:
  • a1, where the behavior alternates between two modes when it receives the evMode event: normal, where heating is enabled, and standby, where heating is disabled.
  • a2, where the system attempts to maintain the temperature (the temperature is not maintained while heating is disabled)
The interruptibleRegion defines the subset of behavior that can be interrupted to power off the system, terminating the activity.
Adding an action pin and parameter

To add a temperature action pin and the associated parameter:

  1. Select the Action Pin tool Action Pin tool. Add an action pin to the Maintain temperature action.
  2. Use the Features window for the new action pin to set its name to "temperature," its type to degC selected from the valueTypes in the TypesPkg, and its direction to In.
  3. Select the Activity Parameter tool Activity Parameter tool. Add an activity parameter to the activity by adding it to the right side of the diagram frame near the heat parameter.
  4. In the Features window for the new activity parameter, type temperature as the name, select degC for type from the TypesPkg, and set the direction to In. Click OK.
    Features window for new activity parameter
  5. In the diagram, expand the parameter symbol to fit around the name.
  6. Select the ObjectFlow tool ObjectFlow tool and connect the temperature activity parameter to the temperature action pin.

Your activity diagram should resemble this example.

Activity diagram

Lesson checkpoint

In this lesson, you learned how to perform these tasks:
  • Create and set the direction of the temperature flow ports
  • Connect the blocks in an internal block diagram
  • Add an action pin and parameter to an activity diagram
  • Analyze system behavior using an activity diagram

In the next lesson, you add a statechart that defines the SystemUnderControl behavior.

< Previous | Next >

Feedback