External Functions

1 General Description

It is possible to call functions defined outside the Modelica language. The body of an external function is marked with the keyword external possibly followed by any of he optional items language_spec, external_function_call_spec or external_function_annotation. If you just user the keyword external without any of the optional items a number of default rules apply, e.g. , if no external language is specified the implementation language for the function is assumed to be C.

(??Note- should also give examples of executable external calls)

2 Default Call

In the function log, the default mapping rules apply.

3 Specified Call

The leastSquares function uses an external function. Here the language is specified to be Fortran 77.

4 A Large Example

The external function interface supports a number of advanced features such as in-out parameters and declaration of temporary work variables, which are illustrated by the following rather complicated example.

The following Modelica class contains an example call to BilinearSampling, which via the external function interface is transformed to a call to