Main Content

fmudialog.compileFMUSources

Generate binary for FMU with source code on current platform

Since R2024a

    Description

    fmudialog.compileFMUSources(fmuPath) generates the binary for the current platform for an FMU that contains its source code.

    example

    fmudialog.compileFMUSources(fmuPath, Name,Value) generates binary for the current platform for an FMU that contains its source code

    Examples

    collapse all

    Generate the binary for the current platform for an FMU with source code.

    fmudialog.compileFMUSources('C:\myFiles\mySystem.fmu');

    You can also specify the location to the ZIP folder of the FMU.

    fmudialog.compileFMUSources('C:\myFiles\mySystem.fmu');

    The function will generate FMU with binary for the platform that you are in and save it to the current working directory with the same name. The previous copy of the FMU without the binary will be saved to the current working directory and it will be named as mySystem_orig.fmu.

    You can customize the build process of your FMU by specifying a build function that modifies its build information.

    Use fmudialog.compileFMUSources to specify custom build information for your FMU using the CustomBuild argument. Specify a function that modifies the build information as the input value for his argument.

    fmudialog.compileFMUSources('mySystem.fmu', 'CustomBuild', 'customBuildFcn')

    The function modifies buildInformation that is an object of type RTW.BuildInfo (MATLAB Coder) created by fmudialog.compileFMUSources using information from the modelDescription.xml file of the FMU. Add this function to the path of the current MATLAB session.

    function buildInformation = customBuildFcn(buildInformation)
        buildInformation.addDefines('-DDISABLE_PREFIX');
    end

    Input Arguments

    collapse all

    Path to the FMU or ZIP file that contains the source code of the FMU without the binary for your current platform.

    Example: 'C:\myFiles\mySystem.fmu'

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: fmudialog.compileFMUSources('mySystem.fmu', 'Debug Mode', 'on') generates the binary and debugging information for the current platform for the specified FMU that contains its sources code.

    Specify the simulation mode of the generated binary.

    Data Types: char | string

    Specify if debugging information is to be generated.

    Data Types: char | string

    Specify the name of the build function that is used to customize RTW.BuildInfo (MATLAB Coder) object. This function should accept the RTW.BuildInfo (MATLAB Coder) object created for FMU construction as its input and return the modified build information.

    Version History

    Introduced in R2024a