Stateflow    

Adding Output Data to Simulink

The following steps describe how to add and define the necessary fields for a data output to Simulink:

  1. Add a data object to the chart using the Stateflow diagram editor or Stateflow Explorer (see Adding Data to the Data Dictionary).
  1. You must add the data to the chart and not to any other object in the chart. Adding a data object with the Stateflow diagram editor adds it only to the chart that is visible in the diagram editor. In Stateflow Explorer, you must select (highlight) the chart object in the hierarchy shown in the left pane of the Explorer before adding the event.

  1. Set the Scope of the data to Output to Simulink.
  1. When you define a data object to be Output to Simulink, a Simulink output port is added to the Stateflow block. Output data objects from the Stateflow block to the Simulink model are scalar.

Specify the remaining properties for the data. Data output to Stateflow can be a scalar, or it can be a vector or two-dimensional matrix array of fixed size. It is not possible to change the array size at run-time. See Defining Data Arrays

If you choose to add data in the Stateflow Explorer, you can also change some of its properties directly in the Explorer (see Setting Properties for Data, Events, and Targets).

Click Apply to save the properties. Click OK to save the properties and close the dialog box.


  Adding Input Data from Simulink Implementing Interfaces in Stateflow to Simulink