fmudialog.compileFMUSources
Description
fmudialog.compileFMUSources(
generates
the binary for the current platform for an FMU that contains its source code.fmuPath
)
fmudialog.compileFMUSources(
generates binary for the current platform for an FMU that contains its source codefmuPath
, Name,Value
)
Examples
Generate Binary for FMU with Source Code
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
.
Customize Build Information using a Build Function
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
fmuPath
— Path to the FMU or ZIP file
character vector | string scalar
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.
FMUMode
— FMU simulation mode
'Co-Simulation'
(default) | 'ModelExchange'
Specify the simulation mode of the generated binary.
Data Types: char
| string
DebugMode
— Generate debugging information
'off'
(default) | 'on'
Specify if debugging information is to be generated.
Data Types: char
| string
CustomBuild
— Name of the build function used to customize RTW.BuildInfo
object
char vector | 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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)