FMI Variable Naming
Most modeling tools have rules for variable naming and/or reserve some characters to have a certain meaning. As an example, in Modelica, the dot in a.b indicates a hierarchical structure where b is a component of a. These rules and reservations can differ between software, and consequently imported FMUs might contain variables and parameters that need to be renamed in the Modelica model wrapper.
This chapter contains tables to be used as a guide to understanding how variable names are mapped during FMU import in System Modeler. Each table shows a set of example names and how they are mapped for different combinations of variable naming convention and allowed quoting (as described in this section). The last table contains examples of hard name mangling, which is relevant to the Variables that need name mangling option in the FMU Import dialog.
For an introduction to FMI, see the Functional Mock-up Interface page.
Mapping Tables
FMU name | Wrapper variable | Wrapper start parameter |
x | x | x_start_ |
x_ | x__ | x___start_ |
å | mangled | mangled |
1_1_x | '1_1_x' | '1_1_x_start_' |
w.x.y | w.x.y | w.x.y_start_ |
v[1,1] | v[1,1] | v_start_[1,1] |
u[1].v[1] | u[1].v[1] | u[1].v_start_[1] |
der(x) | 'der(x)' | 'der(x)_start_' |
der(x,2) | 'der(x,2)' | 'der(x,2)_start_' |
'x' | mangled | mangled |
Variable naming convention: Structured; Allow use of quoted Modelica identifier for imported variables: yes.
FMU name | Wrapper variable | Wrapper start parameter |
x | x | x_start_ |
x_ | x__ | x___start_ |
å | mangled | mangled |
1_1_x | mangled | mangled |
w.x.y | w.x.y | w.x.y_start_ |
v[1,1] | v[1,1] | v_start_[1,1] |
u[1].v[1] | u[1].v[1] | u[1].v_start_[1] |
der(x) | x_der | x_der__start_ |
der(x,2) | x_der2_ | x_der2__start_ |
'x' | 'x' | 'x_start_' |
Variable naming convention: Structured; Allow use of quoted Modelica identifier for imported variables: no.
FMU name | Wrapper variable | Wrapper start parameter |
x | x | x_start_ |
x_ | x__ | x___start_ |
å | mangled | mangled |
1_1_x | '1_1_x' | '1_1_x_start_' |
w.x.y | 'w.x.y' | 'w.x.y_start_' |
v[1,1] | 'v[1,1]' | 'v[1,1]_start_' |
u[1].v[1] | 'u[1].v[1]' | 'u[1].v[1]_start_' |
der(x) | 'der(x)' | 'der(x)_start_' |
der(x,2) | 'der(x,2)' | 'der(x,2)_start_' |
'x' | mangled | mangled |
Variable naming convention: Flat; Allow use of quoted Modelica identifier for imported variables: yes.
FMU name | Wrapper variable | Wrapper start parameter |
x | x | x_start_ |
x_ | x__ | x___start_ |
å | mangled | mangled |
1_1_x | mangled | mangled |
w.x.y | mangled | mangled |
v[1,1] | mangled | mangled |
u[1].v[1] | mangled | mangled |
der(x) | mangled | mangled |
der(x,2) | mangled | mangled |
'x' | 'x' | 'x_start_' |
Variable naming convention: Structured; Allow use of quoted Modelica identifier for imported variables: no.
FMU name | Wrapper variable | Wrapper start parameter |
1_1_x | _x___1__x_mangled_ | _x___1__x_mangled__start |
w.x.y | w_u_x_u_y_mangled_ | w_u_x_u_y_mangled__start |
v[1,1] | v_Bd_1_s_1_Bf__mangled_ | v_Bd_1_s_1_Bf__mangled__start |
der(x) | der_o_x_p__mangled_ | der_o_x_p__mangled__start |
'x' | _n_x_n__mangled_ | _n_x_n__mangled__start_ |
å | _Dr__mangled_ | _Dr__mangled__start_ |