S-Function 'FAST_SFunc' does not exist

Dear All;
This error message appear when i run the FAST model in Matlab/Simulink.
Please, Can anyone help me to know the reason and fix it?

Thanks in advance

This error means Matlab can’t find the file ‘FAST_SFunc’. If you are running 32-bit MATLAB on Windows, it is trying to find ‘FAST_SFunc.mexw32’; if you’re running 64-bit MATLAB, it’s looking for ‘FAST_SFunc.mexw64’.

You must make sure the file exists and that MATLAB can find it (i.e., the directory where the file exists must be on the MATLAB path). You can look at the CertTest/Simulink_CertTest.m file in FAST v7 for an example of how to add that directory to the MATLAB path.

Thanks Bonnie.Jonkman a lot


I want to be able to run the FAST and Simulink interface.
Even I have been facing the error-
Error using Run_OpenLoop (line 32)
Error in S-function ‘OpenLoop/FAST Nonlinear Wind Turbine/S-Function’: S-Function ‘FAST_SFunc’ does not exist
I am using FASTv8 and MATLAB 2015b-64bit on a 64bit Windows machine

The only mex file that is installed in the FAST bin folder is FAST_SFunc.mexw32. The FAST_SFunc.mexw64 file is not there.
As the FAST_SFunc.mexw64 file is missing I tried running create_FAST_SFunc.m.
I am copying the code that I ran inside create_FAST_SFunc.m

%% 64-bit Matlab:
mex -v -L…/…/bin -lFAST_Library_x64…
-I…/…/Source -I…/…/Source/dependencies/OpenFOAM -outdir …/…/bin COMPFLAGS=’$COMPFLAGS /MT’ FAST_SFunc.c

I am using a Mingw-win64 compiler
On running this code I get another error
Error using mex
…/…/bin/FAST_Library_x64.lib: error adding symbols: File in wrong format
collect2.exe: error: ld returned 1 exit status

Error in create_FAST_SFunc (line 13)
mex -v -L…/…/bin -lFAST_Library_x64 …

If someone gives a solution to get around these errors and run the FAST-Simulink interface it would be of immense help to me.

Dear Shar,

I’m not familiar with that error, and I’m not sure which version of FAST v8 you are using, but FAST_SFunc.mexw64 is included in the archive of the latest public release of FAST, FAST v8.16, available here: nwtc.nrel.gov/FAST8.

Best regards,

Dear Jason,

Thank you very much.I installed FAST v8.16 from the site.I copied the FAST_Sfunc.mex64 file into my FAST bin folder.
I was successfully able to run Run_Test01_SIG.m after doing this and changing a few paths.
Once again , thanks a lot for your fast and prompt reply.


Dear All;
I want to run the FAST in MATLAB/Simulink at the first time. But these error messages have been appeared.
Please, Can anyone help me to know the reason and fix it?

Dear Vahid,

It doesn’t look like you are running the Run_Test01_SIG.m script.

Please review the documentation on the Simulink-FAST v8 interface available in the FAST v8 ReadMe file: wind.nrel.gov/nwtc/docs/README_FAST8.pdf.

Best regards,

Hello Jason,

             I am running FASTV7, I got the same error "FAST_SFunc" does not exist. I tried but could not find FAST_SFunc.mexw64 file. it was not in archive that i download and extract. Please can you provide link to download FAST_SFunc.mexw64 file or instruction for how to compile FAST_SFunc.mexw64 file.

Thank you

Best regards
Muddassir Nawaz

Dear Muddassir,

Please find my post dated May 17, 2018 in the following forum topic for a link to the FAST_SFunc.mexw64 compatible with FAST v7: http://forums.nrel.gov/t/fast-sfunc-mex-file-problem/1848/4.

Best regards,

hello Jason,
I am trying to work with Matlab 2015a but this problem occurs.
I have a folder called “myfolder” in CerTest.

Matlab: Set Path [c:\user\nawaz\Downloads\fast7\CerTest\myfolder]

“myfolder” contains FAST_SFunc.mexw32, FAST_SFunc.mexw64, Read_FAST_Input.m

I tried to simulate OpenLoop.mdl with Test06.fst in CerTest folder[Which contains Simsetup.m]. I Already run Simsetup.m and got values in Workspace. But when simulate model, i got this problem. This problem is related to MEX file. But i already gave correct path to MEX file, so why this happens?

Dear Muddassir,

In FAST v7, the name of the FAST input file is stored in a MATLAB variable named input_fast. In FAST v8, the name of the FAST input file is stored in a MATLAB variable named FAST_InputFileName. I thought you were trying to run FAST v7, but the error seems to be generated by a mex function for FAST v8.

Best regards,

Dear Jason Jonkman,

I have just downloaded the FAST_v7 from i[/i], section Running FAST, I have been able to run the FAST_v7 tool.

The problem arises when I try to follow the “Simulation for Wind Turbine Generators—With FAST and MATLAB-Simulink Modules” instructions i[/i]. In section “3.1 Stet-by-Step Preparation” of that document, when running OpenLoop.mdl I got the Error in S-function ‘OpenLoop/FAST Nonlinear Wind Turbine/S-Function’: S-Function ‘FAST_SFunc’ does not exist.

I’ve tried to follow this link you posted and replace my FAST_SFunc.mexw32 file with a FAST_SFunc.mexw64 file just like you mentioned, but the link seems to be broken.

Could you please provide me with that file to try running the OpenLoop.mdl Simulink model?

Thanks in advance!
Juan Lopez Muro

Dear Juan Lopez Muro,

The FAST S-Function compatible with FAST v7.02.00d-bjj is available from my Google Drive: drive.google.com/drive/folders/ … sp=sharing.

Best regards,