Main Content

Simulink.SubsystemReference.getSystemOwningTheLock

Return subsystem reference instance that has acquired lock for editing

Since R2022a

    Description

    ssRef = Simulink.SubsystemReference.getSystemOwningTheLock(ssFile) returns an instance of the subsystem file ssFile in a model or the subsystem file itself that has acquired the lock for editing. If no instance is currently being edited, the function returns an empty array.

    example

    Examples

    collapse all

    Open the model containing referenced subsystems.

    model = "slexModelUsingReusableSS";
    open_system(model);

    Add a Scope block to the subsystem reference instance Double Input in the model.

    add_block('simulink/Sinks/Scope',...
        'slexModelUsingReusableSS/Double Input/Scope');

    Get the path of the subsystem reference instance in the model that is locked for editing.

    ssRef... 
     = Simulink.SubsystemReference.getSystemOwningTheLock("slexReusableSS")
    ssRef = 
    'slexModelUsingReusableSS/Double Input'
    

    Input Arguments

    collapse all

    Path or handle of a subsystem file, specified as a string scalar, character vector, or double.

    Example: "slexReusableSS"

    Data Types: string | char | double

    Output Arguments

    collapse all

    Path or handle of a Subsystem Reference block in a model or a subsystem file that has acquired the lock for editing, returned as a character vector or double. The type of output depends on the input type. If you specify the path of subsystem file, the function returns the path of its instance currently being edited.

    Version History

    Introduced in R2022a