problem with Using Fast V8 by microsoft visual studio c/c++ 2013

Provide feedback, request enhancements, and get help with wind-turbine computer-aided engineering tools.

Moderators: Bonnie.Jonkman, Jason.Jonkman

Chen.xmscut
Posts: 3
Joined: Wed Apr 04, 2018 2:21 am
Organization: self
Location: China

problem with Using Fast V8 by microsoft visual studio c/c++ 2013

Postby Chen.xmscut » Sat Apr 07, 2018 9:05 pm

Dear all,

I have a question about Using Fast V8 by microsoft visual studio c/c++ 2013.

I want to use Microsoft visual studio c/c + + 2013 to develop a program to use the function of FAST V8, by calling the FAST_Library. DLL .
the method like this:

(1)I bulid a vc + + project, put the code of FAST_Prog.c in to the project,and then make a configuration of the corresponding header file and running environment, etc..finally the project is compiled through.

(2)When I use the program to run the cases of the test18 example of FAST v8 , the running window appear.However,When it running to ServoDyn module,a parameter errors appear,and then run unexpected errors appear.so the program fails.

(3)I didn't change any parameters in the process
of Using Fast V8 by microsoft visual studio c/c++ 2013.
(4)what is problem? How can I avoid the problem
.


Results are as follows:

Code: Select all

**************************************************************************************************
 FAST (v8.16.00a-bjj, 27-Jul-2016)

 Copyright (C) 2016 National Renewable Energy Laboratory

 This program comes with ABSOLUTELY NO WARRANTY. See the "license.txt" file distributed with this
 software for details.
 **************************************************************************************************

  Running FAST (v8.16.00a-bjj, 27-Jul-2016), compiled as a DLL S-Function for Simulink as a 32-bit
  application using single precision
  linked with NWTC Subroutine Library (v2.09.00, 23-Jul-2016)

  Heading of the FAST input file:
    FAST Certification Test #18: NREL 5.0 MW Baseline Wind Turbine (Onshore)

  Running ElastoDyn (v1.04.00a-bjj, 26-Jul-2016).

  Running AeroDyn (v15.03.00, 27-Jul-2016).

  Running AirfoilInfo (v1.01.00a-bjj, 5-Apr-2016).

  Running BEM (v1.02.00, 29-Jun-2016).
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 3

  Running InflowWind (v3.03.00, 26-Jul-2016).
  Opening InflowWind input file:
  D:/fredj/03_Sources2008/AqwaTest/Release/jf_CertTest/5MW_Baseline/NRELOffshrBsline5MW_InflowWin
  d_12mps.dat

    Reading a 31x31 grid (145 m wide, 17.5 m to 162.5 m above ground) with a characteristic wind
    speed of 12 m/s. This full-field file was generated by TurbSim (v1.06.00, 21-Sep-2012) on
    07-Jan-2014 at 12:50:45.

    Processed 1442 time steps of 20-Hz full-field data (72.05 seconds).

  Running ServoDyn (v1.06.00a-bjj, 26-Jul-2016).

  Running ServoDyn Interface for Bladed Controllers (using Intel Visual Fortran for
  Windows/Matlab, 14-Oct-2015).
FAST_InitializeAll:SrvD_Init:ValidatePrimaryData:Yaw angle and rate are not commanded from Simulink model.
ValidatePrimaryData:Pitch angles are not commanded from Simulink model.
ValidatePrimaryData:Generator torque and power are not commanded from Simulink model.
ValidatePrimaryData:HSS brake is not commanded from Simulink model.
  Timestep: 0 of 60 seconds.


Thank you for your help,
Xiaoming chen

Jason.Jonkman
Posts: 4224
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: problem with Using Fast V8 by microsoft visual studio c/c++ 2013

Postby Jason.Jonkman » Mon Apr 09, 2018 8:47 am

Dear Xiaoming Chen,

I would guess that there is a problem trying to access the Bladed-style DLL controller (DISCON.dll), but I don't see any specific error message in your command window. Perhaps the path to the DLL or the addressing scheme (32 versus 64 bit) is incorrect? Can you run the same simulation without calling the Bladed-style DLL controller (i.e. by setting PCMode = VSContrl = 0 in the ServoDyn input file)?

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Chen.xmscut
Posts: 3
Joined: Wed Apr 04, 2018 2:21 am
Organization: self
Location: China

Re: problem with Using Fast V8 by microsoft visual studio c/c++ 2013

Postby Chen.xmscut » Tue Apr 10, 2018 8:27 am

Dear Jason,

thank you for your advice.

According to your hint, I do the following jobs :
1) if I setting PCMode = VSContrl = 0 in the ServoDyn input file,the same problem appear.

2) I change the the addressing scheme of the program from 32-bit to 64 - bit, but the problem is still the same.


3) if I set CompServo = 0 in test18. FST file,It not appear the initialization parameter error.however,the result seems not normal,some problems like this:
(a) Firstly,after computing,the output files are "Test18.SFunc.T1.AD .sum,Test18.SFunc.T1.ED.sum,Test18.SFunc.T1.sum,Test18.SFunc.T1.outb,but the size of outb file(Test18.SFunc.T1.outb) is very small(compare to the result by
FAST_x32/64. Exe), It seem that the computation is not complete.
(b) Secondliy,In the command window, the timestep is no change in the computation,always being"Timestep: 0 of 60 seconds."
(c) I guess that the calculation abnomally exits in the process to cause the problem(a、b).So,I modified some code to catch the exception error.I find statment error in the 'FAST_CreateCheckpoint(CheckpointFileRoot, &ErrStat, ErrMsg),which is Line 101 in the FAST_Prog.c files.however ,I can't get more detailed information about the error.
the codes of command window like this:

Code: Select all

"
==========================fredj test================================
MATLAB DLL Path: C:\Program Files\MATLAB\MATLAB Compiler Runtime\v84\bin\win64
Current Directory: D:\fredj\03_Source\vs2008\AqwaTest\x64\Debug

 **************************************************************************************************
 FAST (v8.16.00a-bjj, 27-Jul-2016)

 Copyright (C) 2016 National Renewable Energy Laboratory

 This program comes with ABSOLUTELY NO WARRANTY. See the "license.txt" file distributed with this
 software for details.
 **************************************************************************************************

  Running FAST (v8.16.00a-bjj, 27-Jul-2016), compiled as a DLL S-Function for Simulink as a 64-bit
  application using single precision
  linked with NWTC Subroutine Library (v2.09.00, 23-Jul-2016)

  Heading of the FAST input file:
    FAST Certification Test #18: NREL 5.0 MW Baseline Wind Turbine (Onshore)

  Running ElastoDyn (v1.04.00a-bjj, 26-Jul-2016).

  Running AeroDyn (v15.03.00, 27-Jul-2016).

  Running AirfoilInfo (v1.01.00a-bjj, 5-Apr-2016).

  Running BEM (v1.02.00, 29-Jun-2016).
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 3

  Running InflowWind (v3.03.00, 26-Jul-2016).
  Opening InflowWind input file:  jf_CertTest/5MW_Baseline/NRELOffshrBsline5MW_InflowWind_12mps.dat

    Reading a 31x31 grid (145 m wide, 17.5 m to 162.5 m above ground) with a characteristic wind
    speed of 12 m/s. This full-field file was generated by TurbSim (v1.06.00, 21-Sep-2012) on
    07-Jan-2014 at 12:50:45.

    Processed 1442 time steps of 20-Hz full-field data (72.05 seconds).
  Timestep: 0 of 60 seconds.
The Cpp-Code 'FAST_CreateCheckpoint(CheckpointFileRoot, &ErrStat, ErrMsg);' EXCEPTION Error.

  FAST completed.


"



4) There is also a doubt, FAST v8 can not rely on the MATLAB runtime library to run, but when I build vc + + project, the MATLAB runtime library support is need. is it that using FAST_Prog. C building engineer has special requirements,which make
FAST_x64. Exe need not call MATLAB library files?



Best regards,

Xiaoming chen

Bonnie.Jonkman
Posts: 557
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: problem with Using Fast V8 by microsoft visual studio c/c++ 2013

Postby Bonnie.Jonkman » Tue Apr 10, 2018 12:51 pm

Hi, Xioming.

The pre-compiled FAST Library was really designed to be used with Simulink, which is why it is linking with Matlab libraries. If you aren't going to be using this in Matlab, you can compile with the SysIVF.f90 file instead of SysMatlab.f90 and then remove the Matlab libraries from the linking command (see the FAST for Simulink instructions in the FAST8 ReadMe for details).

If you recompile the FAST_Library.dll and you are still having issues, I'd next remove the call to create the checkpoint files for (restart capability) and see if the example file runs to completion.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

Chen.xmscut
Posts: 3
Joined: Wed Apr 04, 2018 2:21 am
Organization: self
Location: China

Re: problem with Using Fast V8 by microsoft visual studio c/c++ 2013

Postby Chen.xmscut » Wed Apr 11, 2018 7:37 am

Dear Jason,

thank you for your advice very much.
According to your hint, I try to recompile the bat file of FAST_Library_x64. DLL by myself. However,I didn't find the bat file in the compiling directory.what I find is another bat file named Compile_FAST. Bat,which is compiled to FAST_x64/32. Exe.
Can you tell me Where I can find the the bat file of FAST_Library_x64. DLL in the FAST V8? Or if you can give me a compiler generated FAST_Library_x64. DLL bat file?

Best regards,

Xiaoming chen

Bonnie.Jonkman
Posts: 557
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: problem with Using Fast V8 by microsoft visual studio c/c++ 2013

Postby Bonnie.Jonkman » Thu Apr 12, 2018 2:15 pm

Hi Xiaomin,

There should be a Visual Studio project in the FAST8 archive for compiling the FAST library. Please read the instructions in the FAST8 ReadMe (see page 54) for help in compiling with it.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016


Return to “Computer-Aided Engineering Software Tools”

Who is online

Users browsing this forum: No registered users and 1 guest