Using Stateflow     Search    Help Desk 

Add and Define Data Objects

Data are added, removed, and edited using the Explorer. These data objects must be defined: Time, Speed, Duration, and Max_speed.

Add and Define Local Data

The Time data object is local.

   1.
Choose Explore... from the Tools menu of the graphics editor.
   2.
Select the parent for the new data object.
Double-click on the machine name (the name you specified when you saved the Simulink model) in the Object Hierarchy list. Double-click on the chart name (the name you specified on the Stateflow block). The chart will be the parent for all the data in the carousel example.
   3.
Choose Data from the Explorer Add menu. A data item appears in the Contents pane.
   4.
Enter Time in the item's Name field.
   5.
Select Local in the Scope field.
   6.
Click on the OK button to save the changes and close the dialog box.

Add and Define Input from Simulink Data

The Speed data object is Input from Simulink:

   1.
Choose Explore... from the Tools menu of the graphics editor.
   2.
Select the parent for the new data object.
Double-click on the machine name (the name you specified when you saved the Simulink model) in the Object Hierarchy list. Double-click on the chart name (the name you specified on the Stateflow block). The chart will be the parent for all the data in the carousel example.
   3.
Choose Data from the Explorer Add menu. A data item appears in the Contents pane.
   4.
Enter Speed in the item's Name field.
   5.
Select Input from Simulink in the Scope field.
   6.
Click on the OK button to save the changes and close the dialog box.

Add and Define Data Output to Simulink

Ride_on is the only data Output to Simulink:

   1.
Choose Explore... from the Tools menu of the graphics editor.
   2.
Select the parent for the new data object.
Double-click on the machine name (the name you specified when you saved the Simulink model) in the Object Hierarchy list. Double-click on the chart name (the name you specified on the Stateflow block). The chart will be the parent for all the data in the carousel example.
   3.
Choose Data from the Explorer Add menu. A data item appears in the Contents pane.
   4.
Enter Ride_on in the Name field.
   5.
Select Output to Simulink in the Scope field.
   6.
Since the Scope is Output to Simulink, a port number is displayed. You do not need to change the port number.
   7.
Click on the OK button to save the changes and close the dialog box.

Add and Define Workspace Data

Duration is the only Workspace data object:

   1.
Choose Explore... from the Tools menu of the graphics editor.
   2.
Select the parent for the new data object.
Double-click on the machine name (the name you specified when you saved the Simulink model) in the Object Hierarchy list. Double-click on the chart name (the name you specified on the Stateflow block). The chart will be the parent for all the data in the carousel example.
   3.
Choose Data from the Explorer Add menu. The new data object appears in the Explorer contents pane.
   4.
Enter Duration in the Name field.
   5.
Select Workspace in the Scope field.

Add and Define Constant Data

Max_speed is the only Constant data object:

   1.
Choose Explore... from the Tools menu of the graphics editor.
   2.
Select the parent for the new data object.
Double-click on the machine name (the name you specified when you saved the Simulink model) in the Object Hierarchy list. Double-click on the chart name (the name you specified on the Stateflow block). The chart will be the parent for all the data in the carousel example.
   3.
Choose Data from the Explorer Add menu. The new data object appears in the Explorer contents pane.
   4.
Enter Max_speed in the item's Name field.
   5.
Select Constant in the Scope field.


[ Previous | Help Desk | Next ]