modelicaConfigure
Set or query the OpenModelica used by the nflow Modelica bridge.
📝Syntax
modelicaConfigure(path)
omc = modelicaConfigure()
modelicaConfigure('')
📥Input Arguments
Parameter Description
path a string scalar or character row vector: an OpenModelica home directory (for example 'C:/Program Files/OpenModelica1.27.0-64bit') or the omc executable itself. An empty string clears the configured override.
📤Output Arguments
Parameter Description
omc the resolved path to the omc executable for the current configuration, or an empty string when none is found.
📄Description

modelicaConfigure selects the OpenModelica compiler that the nflow Modelica bridge uses to turn a Modelica model into an FMU. Use it when auto-detection is wrong or when several OpenModelica versions are installed.

The setting is persisted in the Nelson preferences directory and is authoritative: once configured, only that location is tried, so pointing nflow at a specific OpenModelica never silently resolves to a different one. When no override is configured, the location is auto-detected from the NELSON_OPENMODELICA_HOME and OPENMODELICAHOME environment variables, the standard install directories, then PATH.

Called with no argument, modelicaConfigure returns the currently resolved omc path. Called with an empty string, it clears the override and returns to auto-detection. Setting a path that does not resolve to a runnable omc raises a warning but is still stored, so a machine can be pre-configured.

The nflow editor writes the same preference through this function, so the graphical settings and the command line share one source of truth.

💡Examples
Point nflow at a specific OpenModelica installation.
modelicaConfigure('C:/Program Files/OpenModelica1.27.0-64bit');
info = modelicaInfo()
Return to auto-detection.
modelicaConfigure('')
🔗See Also
modelicaInfomodelicaToFmu
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub