Main Content

sltest.observer.getObserverMapping

Get Observer Port block mapping

Since R2024b

    Description

    mapping = sltest.observer.getObserverMapping(obsref) returns the mapping information for the system model elements observed by the Observer Port blocks linked to the specified Observer Reference block.

    example

    Examples

    collapse all

    This example requires a Stateflow® license.

    import sltest.observer.*
    openExample("sf_car")
    
    [obsport,obsmodel]=observeElement('Signal',...
       Simulink.BlockPath("sf_car/transmission"),2);
    obsref = Simulink.findBlocksOfType('sf_car',...
       'ObserverReference');
    obsmap = getObserverMapping(obsref);
    
    obsmap.Signal
    

    Input Arguments

    collapse all

    Observer Reference block, specified as a string, character vector, or double. Use a string or character vector to specify the path of the Observer Reference block, or use a double to specify the handle of the Observer Reference block.

    Output Arguments

    collapse all

    Information about each Observer Port block, returned as a separate structure for each observed element type. This table shows the structure fields for each element type.

    Observer Port BlockObserved Element TypeObserved Element Observed Element InformationAdditional Element Information

    Observer Port path

    'Signal'

    Path or handle of the block or Stateflow chart associated with observed signal

    Port index

     

    Observer Port path

    'SFData'

    Path or handle of the Stateflow chart containing the observed data

    Stateflow data name

     

    Observer Port path

    'SFStateActivity'

    Path or handle of the Stateflow chart that contains the observed activity

    Stateflow activity state: 'OFF' or 'ON'

    Stateflow activity type: 'Self'

    Observer Port path

    'FMUInternalVariable'

    Path or handle of the Functional Markup Unit that contains the FMU internal variable

    FMU internal variable name

     

    Version History

    Introduced in R2024b