Main Content

linkToFMU

Link component to FMU

Since R2024b

    Description

    fmuHandle = linkToFMU(component,fmuName) links from the component to an FMU file.

    example

    Examples

    collapse all

    Create an FMU behavior by linking an FMU file named actuator.fmu to the actuatorComp component.

    Create a model archModel.

    model = systemcomposer.createModel("archModel");
    systemcomposer.openModel("archModel");
    arch = get(model,"Architecture");

    Add an actuatorComp component to the model.

    comp = addComponent(arch,"actuatorComp");
    

    Link the actuatorComp component to an FMU file so the component references the FMU file actuator.fmu.

    fmuHandle = linkToFMU(comp,"actuator.fmu");

    Input Arguments

    collapse all

    Component with no sub-components, specified as a systemcomposer.arch.Component object.

    Example: "Robot"

    Data Types: char | string

    FMU file name for an existing FMU that defines the architecture or behavior of the component, specified as a character vector or string.

    Example: "actuator.fmu"

    Data Types: char | string

    Output Arguments

    collapse all

    Handle to linked FMU, returned as a numeric value.

    Data Types: double

    Version History

    Introduced in R2024b