# S-Function 'FAST\_SFunc' does not exist

**URL:** <https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080>\
**Category:** Controls\
**Created:** [February 24, 2015, 7:39pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080 "2015-02-24T19:39:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbdelRahman.Elkattan](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@AbdelRahman.Elkattan](https://forums.nlr.gov/u/AbdelRahman.Elkattan)\
**Post date:** [February 24, 2015, 7:39pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/1 "2015-02-24T19:39:26Z")

</div>

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

 ![Untitled.jpg](https://europe1.discourse-cdn.com/nrel/original/1X/e2e6c5fa79ab96ccfb4c1b5bc39ecbb5b487096e.jpeg)

---

<div class="post-metadata">

**Author:** ![Bonnie.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/bonnie.jonkman/32/3230_2.png) [@Bonnie.Jonkman](https://forums.nlr.gov/u/Bonnie.Jonkman)\
**Post date:** [February 25, 2015, 4:31pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/2 "2015-02-25T16:31:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AbdelRahman.Elkattan](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@AbdelRahman.Elkattan](https://forums.nlr.gov/u/AbdelRahman.Elkattan)\
**Post date:** [February 26, 2015, 5:55am UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/3 "2015-02-26T05:55:27Z")

</div>

Thanks Bonnie.Jonkman a lot

---

<div class="post-metadata">

**Author:** ![Shar.Shah](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@Shar.Shah](https://forums.nlr.gov/u/Shar.Shah)\
**Post date:** [July 5, 2017, 6:41am UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/4 "2017-07-05T06:41:31Z")

</div>

Hello!

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

addpath(‘C:\Users\shar\Desktop\project\witumetron\software\bin’);  
addpath(‘C:\Users\shar\Desktop\project\witumetron\software\Simulink\Samples’);  
%% 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.

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [July 5, 2017, 12:36pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/5 "2017-07-05T12:36:46Z")

</div>

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](https://nwtc.nrel.gov/FAST8).

Best regards,

---

<div class="post-metadata">

**Author:** ![Shar.Shah](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@Shar.Shah](https://forums.nlr.gov/u/Shar.Shah)\
**Post date:** [July 6, 2017, 10:56am UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/6 "2017-07-06T10:56:34Z")

</div>

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.

Regards,  
Shar

---

<div class="post-metadata">

**Author:** ![Vahid.Fazlollahi](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@Vahid.Fazlollahi](https://forums.nlr.gov/u/Vahid.Fazlollahi)\
**Post date:** [December 7, 2017, 11:25am UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/7 "2017-12-07T11:25:01Z")

</div>

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?

 ![fast error.jpg](https://europe1.discourse-cdn.com/nrel/original/2X/8/85952fc098212ed5c1fb19ad064219b033543093.jpeg)

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [December 7, 2017, 2:15pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/8 "2017-12-07T14:15:02Z")

</div>

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](https://wind.nrel.gov/nwtc/docs/README_FAST8.pdf).

Best regards,

---

<div class="post-metadata">

**Author:** ![Muddassir.Nawaz](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@Muddassir.Nawaz](https://forums.nlr.gov/u/Muddassir.Nawaz)\
**Post date:** [August 29, 2018, 2:16pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/9 "2018-08-29T14:16:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [August 29, 2018, 9:23pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/10 "2018-08-29T21:23:37Z")

</div>

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: [FAST\_SFunc | MEX-file problem - #4 by Jason.Jonkman](http://forums.nlr.gov/t/fast-sfunc-mex-file-problem/1848/4).

Best regards,

---

<div class="post-metadata">

**Author:** ![Muddassir.Nawaz](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@Muddassir.Nawaz](https://forums.nlr.gov/u/Muddassir.Nawaz)\
**Post date:** [November 5, 2018, 11:42am UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/11 "2018-11-05T11:42:21Z")

</div>

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?  
 ![error.jpg](https://europe1.discourse-cdn.com/nrel/original/2X/2/2a60385c021f63cabfcf063efd7192c83367b3a9.jpeg)

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [November 5, 2018, 4:04pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/12 "2018-11-05T16:04:21Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Juan.LopezMuro](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Juan.LopezMuro](https://forums.nlr.gov/u/Juan.LopezMuro)\
**Post date:** [July 12, 2021, 1:52pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/13 "2021-07-12T13:52:17Z")

</div>

> [@Jason.Jonkman](#):
>
> 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: [FAST\_SFunc | MEX-file problem - #4 by Jason.Jonkman](http://forums.nlr.gov/t/fast-sfunc-mex-file-problem/1848/4).
> 
> 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

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [July 12, 2021, 1:56pm UTC](https://forums.nlr.gov/t/s-function-fast-sfunc-does-not-exist/1080/14 "2021-07-12T13:56:40Z")

</div>

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](https://drive.google.com/drive/folders/1Cx0FuLHtMoAN_f5xkFnoAd2SjCKvdatx?usp=sharing).

Best regards,
