Run openFAST from simulink

Hello Mr Jonkman,
I am a user of FAST v8, but now I want to migrate to openFAST.
I tried to run the openloop.m contained in folder D:\openfast-main\glue-codes\simulink\examples, but it gives me an error:
Error in S-function ‘OpenLoop2/FAST Nonlinear Wind Turbine/S-Function’: S-Function ‘FAST_SFunc’ does not exist
I verified that the script FAST_SFunc exists in the folder D:\openfast-main\glue-codes\simulink\src and it is the entire openfast-main folder is added to path. How can I solve this problem?
thanks you for your attention,
best regards,
Massimo Sirigu

Dear Massimo,

Did you compile the OpenFAST S-Function yourself or are you using the precompiled OpenFAST S-Function for 64-bit MATLAB on Windows (FAST_SFunc.mexw64) provided on the OpenFAST release page: Is this S-Function in your MATLAB search path?

Best regards,

I solved the problem,I did not install the binary codes for openfast.

Now I’m trying to implement U-maine 15 MW using Simulink interface. I solved all the problems except for this one:

Error using runFAST (line 57)
Error reported by S-function ‘FAST_SFunc’ in ‘UmaineSim/FAST Nonlinear Wind Turbine/S-Function’:
FAST_InitializeAll: MD_Init:MDIO_ReadInput:Failed to read line data for Line 1

How can I solve this error?

Hi, this looks to be a problem with what is in the MoorDyn input file for the first Line entry. The required number of columns has changed in recent version of OpenFAST. Most likely, there is one addition column required at the end (it is the CtrlChan column and can have a value of 0 for each line). Hopefully, adding this last column will solve the problem.

Otherwise, I would suggest going to the r-test repo (, finding the tag for the same version of OpenFAST that you are running, then looking at the format of the MoorDyn input file in the folder glue-codes/openfast/5MW_OC4Semi_WSt_WavesWN.


Ok, MD stands for moordyn, I didn’t catch that. Thank you for your reply.