Monitor Stateflow States with MATLAB Language

You must have already set Stateflow® states as test points in model ex_slrt_sf_car (open_system(docpath(fullfile(docroot, 'toolbox', 'xpc', 'examples', 'ex_slrt_sf_car')))). If you have not, see Configure Stateflow States as Test Points.

  1. To get a list of signals in the Command Window, type:

    tg = slrt
  2. To display the signals in the real-time application, type:

    tg.ShowSignals = 'on'

    The latter causes the Command Window to display a list of the target object properties for the available signals.

    For Stateflow states that you have set as test points, the state appears in the BLOCK NAME column. For example, assume that you set a test point for the first state of gear_state in the shift_logic chart of the ex_slrt_sf_car model. The state of interest, first, appears as follows in the list of signals in the MATLAB® interface:


    shift_logic is the path to the Stateflow chart. gear_state.first is the path to the specific state.

Related Topics