0% found this document useful (0 votes)
338 views5 pages

OpenFAST Simulink

This document provides instructions for generating the "FAST_SFunc.mexw64" MEX file required to run OpenFAST simulations from Simulink. It involves: 1) Compiling the OpenFAST library by opening the solution file in Visual Studio, setting the configuration to Release_MATLAB x64, and building the solution. 2) Running the "create_FAST_SFunc.m" MATLAB file to generate "FAST_SFunc.mexw64" using the compiled OpenFAST library files. 3) Copying the generated "FAST_SFunc.mexw64" MEX file along with other DLL files to the folder containing the .fst input file to run OpenFAST simulations from

Uploaded by

Arvin Monster
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
338 views5 pages

OpenFAST Simulink

This document provides instructions for generating the "FAST_SFunc.mexw64" MEX file required to run OpenFAST simulations from Simulink. It involves: 1) Compiling the OpenFAST library by opening the solution file in Visual Studio, setting the configuration to Release_MATLAB x64, and building the solution. 2) Running the "create_FAST_SFunc.m" MATLAB file to generate "FAST_SFunc.mexw64" using the compiled OpenFAST library files. 3) Copying the generated "FAST_SFunc.mexw64" MEX file along with other DLL files to the folder containing the .fst input file to run OpenFAST simulations from

Uploaded by

Arvin Monster
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Generating “FAST_SFunc.

mexw64”
Kumara Raja E

This document is prepared keeping OpenFAST-2.2.0, may be valid for other versions of
OpenFAST also. Unlike in the FASTV8, the OpenFAST -2.2.0 does not have precompiled FAST
library and MEX files need to run OpenFAST through MATLAB (Simulink).
Generating “FAST_SFunc.mex64” requires the OpenFAST library files built prior to it. The
procedure for the same is given below.

1) Generating Compiling OpenFAST for generating OpenFAST compilation

Notice that “E: \OpenFAST\openfast-2.2.0 \build\bin” is empty. Because, files are added here
automatically after successful compilation.

Step01)

Open “FAST.sln” file located in “E:\OpenFAST\openfast-2.2.0\vs-build\FAST”.

Note that “FAST.sln” is a Visual Studio solution file, so you need Visual studio installed on your
machine. I have used Visual Studio 2019 with Intel Parallel Studio_XE2019.

In the “Visual studio”, you should see a screen like below.

All the related projects loaded.


Step02) Chose “Release_MATLAB” from the drop-down menu and “x64” as shown below.

Step03)

Right click on “OpenFAST-Simulink” and select “properties” as shown below.


Step04)

A new dialogue box as shown in the below will popup.

Configuration Properties LinkerInput Additional Dependencies Choose the right path for
the libmex.lib file based on your matlab installation

Step05)

Build Build Solution


Step06)

As already mentioned in the step01 new files are created in “E: \OpenFAST\openfast-
2.2.0_Test\build\bin”

2) To create “FAST_SFunc.mexw64”

NOTE: OpenFAST should be compiled before this step using the procedure illustrated above.

Open the matlab file “E:\OpenFAST\openfast-2.2.0 \glue-codes\simulink\src\create_FAST_SFunc.m”

Make sure the variables “libDir” and “includeDir” are set correct. The “libDir” is the path where
“FASTlib_x64_Matlab.lib” and “MAP_x64.lib” are present.

libDir = 'E:\OpenFAST\openfast-2.2.0\build\bin';

includeDir = 'E:\OpenFAST\openfast-2.2.0\modules\openfast-library\src';

Now run the “creat_FAST_SFunc.m”. Upon successful run “FAST_SFunc.mexw64” is


created in the location “libDir” as shown below.
3) To run OpenFAST through Simulink

The procedure is same as FASTV8 except, copy the files


“FAST_SFunc.mexw64”, “MAP_x64.dll” and “OpenFAST-
Simulink_x64.dll” to the folder where .fst file is present.

You might also like